org.gnu.gtk

Class IconView

public class IconView extends Container

Constructor Summary
IconView()
Create a new IconView
IconView(TreeModel model)
Create a new IconView specifying the model.
IconView(Handle handle)
Create a new IconView with a handle to a native resource returned from a call to the native libraries.
Method Summary
voidaddListener(IconViewListener listener)
Register an object to handle IconView events.
CellRenderergetCellRendererAtPosition(int x, int y)
Finds the cell at the point (x,y), relative to widget coordinates.
intgetColumns()
Returns the number of columns for this IconView.
intgetColumnSpacing()
CellRenderergetCursorCellRenderer()
Returns the current cursor cell.
TreePathgetCursorPath()
Returns the current cursor path.
ClassgetEventListenerClass(String signal)
EventTypegetEventType(String signal)
static IconViewgetIconView(Handle handle)
Internal static factory method to be used by Java-Gnome only.
intgetItemWidth()
Returns the width of each item.
intgetMargin()
intgetMarkupColumn()
Returns the column with markup text for this IconView.
TreeModelgetModel()
Returns the model that the IconView is using.
OrientationgetOrientation()
Returns the Orientation for this IconView.
TreePathgetPathAtPosition(int x, int y)
Find the path at the point (x,y) relative to widget coordinates.
intgetPixbufColumn()
Returns the column with Pixbufs for this IconView.
booleangetReorderable()
Retrieves whether the user can reorder the list via drag-and-drop.
intgetRowSpacing()
TreePath[]getSelectedItems()
Returns an array of all selected paths.
SelectionModegetSelectionMode()
Returns the selection mode for this IconView.
intgetSpacing()
intgetTextColumn()
Returns the column with text fro this IconView.
voiditemActivated(TreePath path)
Activate the item specified by path.
booleanpathIsSelected(TreePath path)
returns true if the path is currently selected.
voidremoveListener(IconViewListener listener)
Removes a listener.
voidselectAll()
Selects all of the icons.
voidselectPath(TreePath path)
Selects the row at the specified path.
voidsetColumns(int columns)
Set the number of columns for this IconView.
voidsetColumnSpacing(int columnSpacing)
voidsetCursor(TreePath path, CellRenderer renderer, boolean startEditing)
Sets the current keyboard focus to be at path, and selects it.
voidsetItemWidth(int width)
Sets the width of each item.
voidsetMargin(int margin)
voidsetMarkupColumn(int column)
Sets the column with markup information for this IconView to be the specified column.
voidsetModel(TreeModel model)
Sets the model for this IconView.
voidsetOrientation(Orientation orientation)
Sets the orientation of this IconView which determines whether the labels are drawn beside instead of below the icons.
voidsetPixbufColumn(int column)
Sets the column with Pixbufs for this IconView to be the specified column.
voidsetReorderable(boolean reorderable)
Convenience method that allows the caller to set whether models that support TreeDragSource and TreeDragDest should be reorderable by the users.
voidsetRowSpacing(int rowSpacing)
voidsetSelectionMode(SelectionMode mode)
Sets the selection mode for this IconView.
voidsetSpacing(int spacing)
voidsetTextColumn(int column)
Sets the column with text for this IconView to be the specified column.
voidunselectAll()
Unselects all of the icons.
voidunselectPath(TreePath path)
Unselects the row at the specified path.

Constructor Detail

IconView

public IconView()
Create a new IconView

IconView

public IconView(TreeModel model)
Create a new IconView specifying the model.

Parameters: model

IconView

public IconView(Handle handle)
Create a new IconView with a handle to a native resource returned from a call to the native libraries. This constructor should only be used internally by Java-Gnome.

Parameters: handle The handle that represents a pointer to a native resource.

Method Detail

addListener

public void addListener(IconViewListener listener)
Register an object to handle IconView events.

See Also: IconViewListener

getCellRendererAtPosition

public CellRenderer getCellRendererAtPosition(int x, int y)
Finds the cell at the point (x,y), relative to widget coordinates.

Parameters: x The x position to be identified. y The y position to be identified.

Returns: CellRenderer responsible for the cell at (x,y) or null if no item exists at the specified position.

getColumns

public int getColumns()
Returns the number of columns for this IconView.

getColumnSpacing

public int getColumnSpacing()

getCursorCellRenderer

public CellRenderer getCursorCellRenderer()
Returns the current cursor cell. If no cell currently has focus, then null will be returned.

Returns: current cursor CellRenderer or null.

getCursorPath

public TreePath getCursorPath()
Returns the current cursor path. If the cursor isn't currently set, then null will be returned.

Returns: current cursor TreePath or null.

getEventListenerClass

public Class getEventListenerClass(String signal)

getEventType

public EventType getEventType(String signal)

getIconView

public static IconView getIconView(Handle handle)
Internal static factory method to be used by Java-Gnome only.

getItemWidth

public int getItemWidth()
Returns the width of each item.

getMargin

public int getMargin()

getMarkupColumn

public int getMarkupColumn()
Returns the column with markup text for this IconView.

getModel

public TreeModel getModel()
Returns the model that the IconView is using. It will return null if a model is the IconView currently does not have a model.

getOrientation

public Orientation getOrientation()
Returns the Orientation for this IconView.

getPathAtPosition

public TreePath getPathAtPosition(int x, int y)
Find the path at the point (x,y) relative to widget coordinates.

Parameters: x y

getPixbufColumn

public int getPixbufColumn()
Returns the column with Pixbufs for this IconView.

getReorderable

public boolean getReorderable()
Retrieves whether the user can reorder the list via drag-and-drop.

Returns: true if the list can be reordered.

Since: 2.8.1

getRowSpacing

public int getRowSpacing()

getSelectedItems

public TreePath[] getSelectedItems()
Returns an array of all selected paths.

getSelectionMode

public SelectionMode getSelectionMode()
Returns the selection mode for this IconView.

getSpacing

public int getSpacing()

getTextColumn

public int getTextColumn()
Returns the column with text fro this IconView.

itemActivated

public void itemActivated(TreePath path)
Activate the item specified by path.

Parameters: path

pathIsSelected

public boolean pathIsSelected(TreePath path)
returns true if the path is currently selected.

Parameters: path

removeListener

public void removeListener(IconViewListener listener)
Removes a listener.

See Also: addListener

selectAll

public void selectAll()
Selects all of the icons. The IconView must have its' selection mode set to SelectionMode.MULTIPLE.

selectPath

public void selectPath(TreePath path)
Selects the row at the specified path.

Parameters: path

setColumns

public void setColumns(int columns)
Set the number of columns for this IconView.

Parameters: columns

setColumnSpacing

public void setColumnSpacing(int columnSpacing)

Parameters: columnSpacing

setCursor

public void setCursor(TreePath path, CellRenderer renderer, boolean startEditing)
Sets the current keyboard focus to be at path, and selects it. This is useful when you want to focus the user's attention on a particular item. If renderer is not null, then focus is given to the cell specified by it. Additionally, if startEditing is true, then editing should be started in the specified cell.

Due to a bug in gtk+, calling this method will cause the virtual machine to crash (because of a segmentation fault) if the CellRenderer is not a part of this IconView and startEditing is set to true. This issue is fixed in gtk+ 2.8.17 and higher and will cause an assertion failure instead (which does not crash the virtual machine).

Parameters: path A TreePath renderer A CellRenderer of this IconView or null startEditing true if the specified cell should start being edited.

Throws: IllegalArgumentException If renderer is null and startEditing is true

setItemWidth

public void setItemWidth(int width)
Sets the width of each item.

Parameters: width

setMargin

public void setMargin(int margin)

Parameters: margin

setMarkupColumn

public void setMarkupColumn(int column)
Sets the column with markup information for this IconView to be the specified column. The markup column must be of type DataColumnString. If the markup column is set to something it overrides the text column set by setTextColumn

Parameters: column

setModel

public void setModel(TreeModel model)
Sets the model for this IconView. If the IconView already has a model it will remove it before setting the new model. If model is null it will unset the old model.

Parameters: model

setOrientation

public void setOrientation(Orientation orientation)
Sets the orientation of this IconView which determines whether the labels are drawn beside instead of below the icons.

Parameters: orientation

setPixbufColumn

public void setPixbufColumn(int column)
Sets the column with Pixbufs for this IconView to be the specified column. This pixubf column must be of type DataColumnPixbuf.

Parameters: column

setReorderable

public void setReorderable(boolean reorderable)
Convenience method that allows the caller to set whether models that support TreeDragSource and TreeDragDest should be reorderable by the users. Both TreeStore and ListStore support these.

If reorderable is true, then the user can reorder the model by dragging and dropping rows. Those interested in notification when these changes take place should add a TreeModelListener to the model, and listen to TreeModelEvents of type ROW_INSERTED and ROW_DELETED.

This method does not give any degree of control over the order -- any reordering is allowed. If more control is needed, drag and drop should be handled manually.

Parameters: reorderable if the list of items can be reordered.

Since: 2.8.1

setRowSpacing

public void setRowSpacing(int rowSpacing)

Parameters: rowSpacing

setSelectionMode

public void setSelectionMode(SelectionMode mode)
Sets the selection mode for this IconView.

Parameters: mode

setSpacing

public void setSpacing(int spacing)

Parameters: spacing

setTextColumn

public void setTextColumn(int column)
Sets the column with text for this IconView to be the specified column. The text column must be of type DataColumnString.

Parameters: column

unselectAll

public void unselectAll()
Unselects all of the icons.

unselectPath

public void unselectPath(TreePath path)
Unselects the row at the specified path.

Parameters: path