org.gnu.gtk

Class TreeModel

public class TreeModel extends GObject

Deprecated: This class is part of the java-gnome 2.x family of libraries, which, due to their inefficiency and complexity, are no longer being maintained and have been abandoned by the java-gnome project. This class may in the future have an equivalent in java-gnome 4.0, try looking for org.gnome.gtk.TreeModel. You should be aware that there is a considerably different API in the new library: the architecture is completely different and most notably internals are no longer exposed to public view.

A generic tree interface for use with TreeView widgets. Internally, the TreeStore and ListStore objects are constructed on top of TreeModels. If you were using the C version of gtk, you would be able to construct other objects like those (although I find no reason for doing so). This object provides a number of useful methods which can be used with either the TreeStore or ListStore.

For a full overview of the tree, list and table widgets, please see the TreeView description.

Method Summary
voidaddListener(TreeModelListener listener)
Register an object to handle button events.
intgetColumnCount()
Returns the number of data blocks supported by the model
intgetDataBlockCount()
Returns the number of data blocks supported by the model
ClassgetEventListenerClass(String signal)
EventTypegetEventType(String signal)
TreeItergetFirstIter()
Returns the iterator at the start of the model (the one at the path "0"), or returns null if the tree is empty.
TreeItergetIter(TreePath path)
Returns a valid iterator pointing to path, or null/
TreeItergetIter(String pathString)
Returns a valid iterator pointing to the path represented by pathString, or returns null if the path is invalid.
TypegetType(int index)
Returns the type of the data block.
StringgetValue(TreeIter iter, DataColumnString dataBlock)
Returns the Value at the given iter in the specified data block.
intgetValue(TreeIter iter, DataColumnInt dataBlock)
Returns the Value at the given iter in the specified data block.
longgetValue(TreeIter iter, DataColumnLong dataBlock)
Returns the long at the row specified by iter and column specified data block.
booleangetValue(TreeIter iter, DataColumnBoolean dataBlock)
Returns the Value at the given iter in the specified data block.
doublegetValue(TreeIter iter, DataColumnDouble dataBlock)
Returns the Value at the given iter in the specified data block.
ObjectgetValue(TreeIter iter, DataColumnObject dataBlock)
Returns the Value at the given iter in the specified data block.
PixbufgetValue(TreeIter iter, DataColumnPixbuf dataBlock)
Returns the Value at the given iter in the specified data block.
intgetValue(TreeIter iter, DataColumnIconSize dataBlock)
Returns the Value at the given iter in the specified data block.
StringgetValue(TreeIter iter, DataColumnStockItem dataBlock)
Returns the Value at the given iter in the specified data block.
voidremoveListener(TreeModelListener listener)
Removes a listener

Method Detail

addListener

public void addListener(TreeModelListener listener)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Register an object to handle button events.

See Also: TreeModelListener

getColumnCount

public int getColumnCount()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the number of data blocks supported by the model

getDataBlockCount

public int getDataBlockCount()

Deprecated: use getColumnCount instead. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the number of data blocks supported by the model

getEventListenerClass

public Class getEventListenerClass(String signal)

getEventType

public EventType getEventType(String signal)

getFirstIter

public TreeIter getFirstIter()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the iterator at the start of the model (the one at the path "0"), or returns null if the tree is empty.

getIter

public TreeIter getIter(TreePath path)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns a valid iterator pointing to path, or null/

getIter

public TreeIter getIter(String pathString)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns a valid iterator pointing to the path represented by pathString, or returns null if the path is invalid.

getType

public Type getType(int index)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the type of the data block.

Parameters: index The index of the data block

getValue

public String getValue(TreeIter iter, DataColumnString dataBlock)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the Value at the given iter in the specified data block.

getValue

public int getValue(TreeIter iter, DataColumnInt dataBlock)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the Value at the given iter in the specified data block.

getValue

public long getValue(TreeIter iter, DataColumnLong dataBlock)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the long at the row specified by iter and column specified data block.

Since: 2.8.5

getValue

public boolean getValue(TreeIter iter, DataColumnBoolean dataBlock)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the Value at the given iter in the specified data block.

getValue

public double getValue(TreeIter iter, DataColumnDouble dataBlock)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the Value at the given iter in the specified data block.

getValue

public Object getValue(TreeIter iter, DataColumnObject dataBlock)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the Value at the given iter in the specified data block.

getValue

public Pixbuf getValue(TreeIter iter, DataColumnPixbuf dataBlock)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the Value at the given iter in the specified data block.

getValue

public int getValue(TreeIter iter, DataColumnIconSize dataBlock)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the Value at the given iter in the specified data block.

getValue

public String getValue(TreeIter iter, DataColumnStockItem dataBlock)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the Value at the given iter in the specified data block.

removeListener

public void removeListener(TreeModelListener listener)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Removes a listener

See Also: addListener