public abstract class AbstractStructuredGraphViewer extends AbstractZoomableViewer
StructuredViewer.ColorAndFontCollector, StructuredViewer.ColorAndFontCollectorWithProviders
WIDGET_DATA_KEY
Modifier | Constructor and Description |
---|---|
protected |
AbstractStructuredGraphViewer(int graphStyle) |
Modifier and Type | Method and Description |
---|---|
GraphConnection |
addGraphModelConnection(java.lang.Object element,
GraphNode source,
GraphNode target) |
GraphNode |
addGraphModelContainer(java.lang.Object element) |
GraphNode |
addGraphModelNode(GraphContainer container,
java.lang.Object element) |
GraphNode |
addGraphModelNode(java.lang.Object element,
org.eclipse.draw2d.IFigure figure) |
void |
addNode(java.lang.Object element)
Creates a new node and adds it to the graph.
|
void |
addRelationship(java.lang.Object connection)
Adds a new relationship given the connection.
|
void |
addRelationship(java.lang.Object connection,
java.lang.Object srcNode,
java.lang.Object destNode)
Creates a new relationship between the source node and the destination
node.
|
abstract void |
applyLayout()
Applies the viewers layouts.
|
protected Widget |
doFindInputItem(java.lang.Object element) |
protected Widget |
doFindItem(java.lang.Object element) |
protected void |
doUpdateItem(Widget item,
java.lang.Object element,
boolean fullMap) |
protected void |
filterVisuals() |
protected GraphItem[] |
findItems(java.util.List l) |
java.lang.Object[] |
getConnectionElements() |
protected GraphConnection[] |
getConnectionsArray(GraphWidget graph)
Converts the list of GraphModelConnection objects into an array and
returns it.
|
int |
getConnectionStyle() |
protected abstract org.eclipse.gef4.zest.core.viewers.internal.IStylingGraphModelFactory |
getFactory()
Returns the factory used to create the model.
|
GraphWidget |
getGraphControl() |
GraphConnection |
getGraphModelConnection(java.lang.Object obj) |
GraphNode |
getGraphModelNode(java.lang.Object obj) |
int |
getGraphStyle()
Returns the style set for the graph
|
protected abstract org.eclipse.gef4.layout.LayoutAlgorithm |
getLayoutAlgorithm()
Gets the current layout algorithm.
|
java.lang.Object[] |
getNodeElements() |
protected GraphNode[] |
getNodesArray(GraphWidget graph)
Converts the list of GraphModelNode objects into an array an returns it.
|
java.util.HashMap<java.lang.Object,GraphItem> |
getNodesMap() |
int |
getNodeStyle()
Returns the style set for the nodes.
|
protected java.lang.Object[] |
getRawChildren(java.lang.Object parent) |
protected java.util.List<java.lang.Object> |
getSelectionFromWidget() |
protected java.util.List |
getWidgetSelection()
Gets the internal model elements that are selected.
|
protected void |
inputChanged(java.lang.Object input,
java.lang.Object oldInput) |
protected void |
internalRefresh(java.lang.Object element) |
void |
removeGraphModelConnection(java.lang.Object obj) |
void |
removeGraphModelNode(java.lang.Object obj) |
void |
removeNode(java.lang.Object element)
Removes the given element from the layout algorithm and the model.
|
void |
removeRelationship(java.lang.Object connection)
Removes the given connection object from the layout algorithm and the
model.
|
void |
reveal(java.lang.Object element) |
void |
setConnectionStyle(int connectionStyle)
Sets the default style for connections in this graph.
|
void |
setLayoutAlgorithm(org.eclipse.gef4.layout.LayoutAlgorithm algorithm)
Equivalent to setLayoutAlgorithm(algorithm, false).
|
abstract void |
setLayoutAlgorithm(org.eclipse.gef4.layout.LayoutAlgorithm algorithm,
boolean run)
Sets the layout algorithm for this viewer.
|
void |
setNodeStyle(int nodeStyle)
Sets the default style for nodes in this graph.
|
protected void |
setSelectionToWidget(java.util.List l,
boolean reveal) |
void |
unReveal(java.lang.Object element) |
getZoomManager, zoomTo
addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertContentProviderType, assertElementsNotNull, associate, buildLabel, disassociate, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, firePostSelectionChanged, getColorAndFontCollector, getComparator, getComparer, getFilteredChildren, getFilters, getItem, getRoot, getSelection, getSortedChildren, getSorter, handleDispose, handleDoubleSelect, handleInvalidSelection, handleLabelProviderChanged, handleOpen, handlePostSelect, handleSelect, hasFilters, hookControl, internalRefresh, internalUpdate, mapElement, needsRefilter, preservingSelection, refresh, refresh, refresh, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setContentProvider, setFilters, setInput, setLabelProvider, setSelection, setSelectionToWidget, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, update, updateItem, updateSelection, usingElementMap
getContentProvider, getInput, getLabelProvider, labelProviderChanged
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getControl, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addSelectionChangedListener, removeSelectionChangedListener, setSelection
protected AbstractStructuredGraphViewer(int graphStyle)
public void setNodeStyle(int nodeStyle)
nodeStyle
- the style for the nodes.#ZestStyles
public void setConnectionStyle(int connectionStyle)
connectionStyle
- the style for the connections.#ZestStyles
public int getGraphStyle()
public int getNodeStyle()
public GraphWidget getGraphControl()
public int getConnectionStyle()
public abstract void setLayoutAlgorithm(org.eclipse.gef4.layout.LayoutAlgorithm algorithm, boolean run)
algorithm
- the layout algorithmrun
- true if the layout algorithm should be run immediately. This
is a hint.protected abstract org.eclipse.gef4.layout.LayoutAlgorithm getLayoutAlgorithm()
public void setLayoutAlgorithm(org.eclipse.gef4.layout.LayoutAlgorithm algorithm)
algorithm
- public java.lang.Object[] getNodeElements()
public java.lang.Object[] getConnectionElements()
public java.util.HashMap<java.lang.Object,GraphItem> getNodesMap()
public GraphNode addGraphModelContainer(java.lang.Object element)
element
- public GraphNode addGraphModelNode(GraphContainer container, java.lang.Object element)
container
- element
- public GraphNode addGraphModelNode(java.lang.Object element, org.eclipse.draw2d.IFigure figure)
element
- figure
- public GraphConnection addGraphModelConnection(java.lang.Object element, GraphNode source, GraphNode target)
element
- source
- target
- public GraphConnection getGraphModelConnection(java.lang.Object obj)
obj
- public GraphNode getGraphModelNode(java.lang.Object obj)
obj
- public void removeGraphModelConnection(java.lang.Object obj)
obj
- public void removeGraphModelNode(java.lang.Object obj)
protected void internalRefresh(java.lang.Object element)
internalRefresh
in class StructuredViewer
protected void doUpdateItem(Widget item, java.lang.Object element, boolean fullMap)
doUpdateItem
in class StructuredViewer
protected Widget doFindInputItem(java.lang.Object element)
doFindInputItem
in class StructuredViewer
protected Widget doFindItem(java.lang.Object element)
doFindItem
in class StructuredViewer
protected java.util.List<java.lang.Object> getSelectionFromWidget()
getSelectionFromWidget
in class StructuredViewer
protected GraphItem[] findItems(java.util.List l)
protected void setSelectionToWidget(java.util.List l, boolean reveal)
setSelectionToWidget
in class StructuredViewer
protected java.util.List getWidgetSelection()
protected void inputChanged(java.lang.Object input, java.lang.Object oldInput)
inputChanged
in class Viewer
protected abstract org.eclipse.gef4.zest.core.viewers.internal.IStylingGraphModelFactory getFactory()
protected void filterVisuals()
protected java.lang.Object[] getRawChildren(java.lang.Object parent)
getRawChildren
in class StructuredViewer
public void reveal(java.lang.Object element)
reveal
in class StructuredViewer
public void unReveal(java.lang.Object element)
public abstract void applyLayout()
public void removeRelationship(java.lang.Object connection)
connection
- public void addNode(java.lang.Object element)
newNode
- public void removeNode(java.lang.Object element)
element
- The node element to remove.public void addRelationship(java.lang.Object connection, java.lang.Object srcNode, java.lang.Object destNode)
connection
- The connection data object.srcNode
- The source node data object.destNode
- The destination node data object.public void addRelationship(java.lang.Object connection)
connection
- The connection data object.protected GraphConnection[] getConnectionsArray(GraphWidget graph)
protected GraphNode[] getNodesArray(GraphWidget graph)
Copyright (c) 2014 itemis AG and others. All rights reserved.