org.jgraph.plaf

Class GraphUI

public abstract class GraphUI extends ComponentUI

Pluggable look and feel interface for JGraph.
Method Summary
abstract voidcancelEditing(JGraph graph)
Cancels the current editing session.
abstract intgetDropAction()
Returns the current drop action.
abstract ObjectgetEditingCell(JGraph graph)
Returns the cell that is being edited.
abstract CellHandlegetHandle()
Returns the CellHandle that is currently active, or null if no handle is active.
abstract PointgetInsertionLocation()
Returns the insertion location for DnD operations.
abstract Dimension2DgetPreferredSize(JGraph graph, CellView view)
Returns the preferred size for view.
abstract booleanisEditing(JGraph graph)
Returns true if the graph is being edited.
abstract voidpaintCell(Graphics g, CellView view, Rectangle2D bounds, boolean preview)
Paints the renderer of view to g at bounds.
abstract voidpaintPorts(Graphics g, CellView[] portViews)
Paints the renderers of portViews to g.
abstract voidselectCellsForEvent(JGraph graph, Object[] cells, MouseEvent event)
Messaged to update the selection based on a MouseEvent for a group of cells.
abstract voidsetInsertionLocation(Point p)
Sets the current location for Drag-and-Drop activity.
abstract voidstartEditingAtCell(JGraph graph, Object cell)
Selects the cell and tries to edit it.
abstract booleanstopEditing(JGraph graph)
Stops the current editing session.
abstract voidupdateHandle()
Updates the handle.

Method Detail

cancelEditing

public abstract void cancelEditing(JGraph graph)
Cancels the current editing session. This has no effect if the graph isn't being edited. Returns true if the editor allows the editing session to stop.

getDropAction

public abstract int getDropAction()
Returns the current drop action.

getEditingCell

public abstract Object getEditingCell(JGraph graph)
Returns the cell that is being edited.

getHandle

public abstract CellHandle getHandle()
Returns the CellHandle that is currently active, or null if no handle is active.

getInsertionLocation

public abstract Point getInsertionLocation()
Returns the insertion location for DnD operations.

getPreferredSize

public abstract Dimension2D getPreferredSize(JGraph graph, CellView view)
Returns the preferred size for view.

isEditing

public abstract boolean isEditing(JGraph graph)
Returns true if the graph is being edited. The item that is being edited can be returned by getEditingCell().

paintCell

public abstract void paintCell(Graphics g, CellView view, Rectangle2D bounds, boolean preview)
Paints the renderer of view to g at bounds.

paintPorts

public abstract void paintPorts(Graphics g, CellView[] portViews)
Paints the renderers of portViews to g.

selectCellsForEvent

public abstract void selectCellsForEvent(JGraph graph, Object[] cells, MouseEvent event)
Messaged to update the selection based on a MouseEvent for a group of cells. If the event is a toggle selection event, the cells are either selected, or deselected. Otherwise the cells are selected.

setInsertionLocation

public abstract void setInsertionLocation(Point p)
Sets the current location for Drag-and-Drop activity. Should be set to null after a drop.

startEditingAtCell

public abstract void startEditingAtCell(JGraph graph, Object cell)
Selects the cell and tries to edit it. Editing will fail if the CellEditor won't allow it for the selected item.

stopEditing

public abstract boolean stopEditing(JGraph graph)
Stops the current editing session. This has no effect if the graph isn't being edited. Returns true if the editor allows the editing session to stop.

updateHandle

public abstract void updateHandle()
Updates the handle.
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.