public class Graph extends FigureCanvas implements IContainer
Modifier and Type | Field and Description |
---|---|
static int |
ANIMATION_TIME |
protected java.util.List |
connections |
Color |
DARK_BLUE |
Color |
DEFAULT_NODE_COLOR |
static int |
FISHEYE_ANIMATION_TIME |
Color |
GREY_BLUE |
Color |
HIGHLIGHT_ADJACENT_COLOR |
Color |
HIGHLIGHT_COLOR |
Color |
LIGHT_BLUE |
Color |
LIGHT_BLUE_CYAN |
Color |
LIGHT_YELLOW |
ALWAYS, AUTOMATIC, NEVER
Constructor and Description |
---|
Graph(Composite parent,
int style)
Constructor for a Graph.
|
Modifier and Type | Method and Description |
---|---|
void |
addConstraintAdapter(ConstraintAdapter constraintAdapter)
Adds a new constraint adapter to the list of constraint adapters
|
void |
addSelectionListener(SelectionListener selectionListener)
This adds a listener to the set of listeners that will be called when a
selection event occurs.
|
void |
applyLayout()
Runs the layout on this graph.
|
void |
dispose()
Dispose of the nodes and edges when the graph is disposed.
|
java.util.List |
getConnections()
Gets the list of GraphModelConnection objects.
|
int |
getConnectionStyle()
Gets the default connection style.
|
IFigure |
getFigureAt(int x,
int y)
Finds a figure at the location X, Y in the graph
This point should be translated to relative before calling findFigureAt
|
Graph |
getGraph() |
Graph |
getGraphModel() |
int |
getItemType() |
LayoutAlgorithm |
getLayoutAlgorithm() |
java.util.List |
getNodes()
Gets a list of the GraphModelNode children objects under the root node in
this diagram.
|
int |
getNodeStyle()
Gets the default node style.
|
ScalableFigure |
getRootLayer()
Gets the root layer for this graph
|
java.util.List |
getSelection()
Gets the list of currently selected GraphNodes
|
void |
notifyListeners(int eventType,
Event event) |
void |
removeSelectionListener(SelectionListener selectionListener) |
void |
selectAll() |
void |
setConnectionStyle(int connectionStyle)
Sets the default connection style.
|
void |
setConstraintAdapters(java.util.List constraintAdapters)
Sets the constraint adapters on this model
|
void |
setLayoutAlgorithm(LayoutAlgorithm algorithm,
boolean applyLayout)
Sets the LayoutAlgorithm for this container and optionally applies it.
|
void |
setNodeStyle(int nodeStyle)
Sets the default node style.
|
void |
setPreferredSize(int width,
int height)
Sets the preferred size of the layout area.
|
void |
setSelection(GraphItem[] items)
Changes the selection to the list of items
|
java.lang.String |
toString() |
computeSize, getContents, getFont, getHorizontalScrollBarVisibility, getLightweightSystem, getVerticalScrollBarVisibility, getViewport, scrollSmoothTo, scrollTo, scrollToX, scrollToY, setBorder, setContents, setFont, setHorizontalScrollBarVisibility, setScrollBarVisibility, setVerticalScrollBarVisibility, setViewport
drawBackground, getCaret, getIME, scroll, setCaret, setIME
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
public static final int ANIMATION_TIME
public static final int FISHEYE_ANIMATION_TIME
public Color LIGHT_BLUE
public Color LIGHT_BLUE_CYAN
public Color GREY_BLUE
public Color DARK_BLUE
public Color LIGHT_YELLOW
public Color HIGHLIGHT_COLOR
public Color HIGHLIGHT_ADJACENT_COLOR
public Color DEFAULT_NODE_COLOR
protected java.util.List connections
public Graph(Composite parent, int style)
parent
- style
- public void addSelectionListener(SelectionListener selectionListener)
selectionListener
- public void removeSelectionListener(SelectionListener selectionListener)
public java.util.List getNodes()
getNodes
in interface IContainer
public void addConstraintAdapter(ConstraintAdapter constraintAdapter)
constraintAdapter
- public void setConstraintAdapters(java.util.List constraintAdapters)
constraintAdapters
- public ScalableFigure getRootLayer()
public void setConnectionStyle(int connectionStyle)
connection
- style the connection style to setorg.eclipse.mylar.zest.core.widgets.ZestStyles
public int getConnectionStyle()
org.eclipse.mylar.zest.core.widgets.ZestStyles
public void setNodeStyle(int nodeStyle)
nodeStyle
- the node style to setorg.eclipse.mylar.zest.core.widgets.ZestStyles
public int getNodeStyle()
org.eclipse.mylar.zest.core.widgets.ZestStyles
public java.util.List getConnections()
public void setSelection(GraphItem[] items)
l
- public void selectAll()
public java.util.List getSelection()
public Graph getGraphModel()
public void dispose()
public void applyLayout()
applyLayout
in interface IContainer
public void setPreferredSize(int width, int height)
width
- height
- public void setLayoutAlgorithm(LayoutAlgorithm algorithm, boolean applyLayout)
IContainer
setLayoutAlgorithm
in interface IContainer
algorithm
- public LayoutAlgorithm getLayoutAlgorithm()
public IFigure getFigureAt(int x, int y)
public void notifyListeners(int eventType, Event event)
notifyListeners
in class Widget
public Graph getGraph()
getGraph
in interface IContainer
public int getItemType()
getItemType
in interface IContainer
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.