public abstract class AbstractSWTGraphDrawer<T extends org.eclipse.swt.widgets.Control> extends java.lang.Object implements GraphDrawer
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractSWTGraphDrawer.AreaSelectionListener |
protected class |
AbstractSWTGraphDrawer.EventListener |
| Modifier and Type | Field and Description |
|---|---|
protected T |
control |
protected DrawingFrame |
frame |
protected Graph |
graph |
protected IntermediateLayout |
intermediateLayout |
protected AbstractSWTGraphDrawer.EventListener |
mouseListener |
protected AbstractSWTGraphDrawer.AreaSelectionListener |
selectionListener |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSWTGraphDrawer(org.eclipse.swt.widgets.Composite parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMouseListener(MouseEventListener listener) |
void |
addPopupMenu(Position position,
java.util.Collection<PopupItem> entries) |
void |
addSelectionListener(SelectionEventListener listener) |
protected abstract T |
createControl(org.eclipse.swt.widgets.Composite parent) |
protected abstract void |
drawCurrentGraph() |
void |
drawGraph(Graph graph,
DrawingFrame frame) |
protected abstract org.eclipse.swt.graphics.Rectangle |
getBoundsForNode(Node node) |
protected Color |
getColorForNode(Node node) |
T |
getControl() |
Graph |
getCurrentGraph() |
protected Shape |
getShapeForNode(Node node) |
java.awt.Dimension |
getSize() |
protected org.eclipse.swt.graphics.Point |
graphToScreenCoord(Position position) |
boolean |
isReadyForInteractions() |
void |
moveNode(Node node,
Position newPosition) |
protected void |
notifyMouseListeners(java.util.List<Node> nodesUnderMouse,
MouseEvent event) |
protected void |
notifySelectionListeners(java.util.List<Node> selectedNodes,
MouseEvent event) |
void |
redraw() |
void |
redrawNodes(java.util.Collection<Node> nodes) |
void |
removeMouseListener(MouseEventListener listener) |
void |
removeSelectionListener(SelectionEventListener listener) |
void |
resetNodeBackgroundColor(Node node) |
protected Position |
screenToGraphCoord(int x,
int y) |
void |
setIntermediateLayout(IntermediateLayout intermediateLayout) |
void |
setNodeBackgroundColor(Node node,
Color color) |
void |
setNodeShape(Node node,
Shape shape) |
protected boolean |
shouldHandleSelectionEvent(MouseEvent event) |
protected abstract void |
updateSize(double width,
double height) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPopupMenuprotected final AbstractSWTGraphDrawer.EventListener mouseListener
protected final AbstractSWTGraphDrawer.AreaSelectionListener selectionListener
protected Graph graph
protected DrawingFrame frame
protected IntermediateLayout intermediateLayout
protected final T extends org.eclipse.swt.widgets.Control control
protected AbstractSWTGraphDrawer(org.eclipse.swt.widgets.Composite parent)
public T getControl()
public void drawGraph(Graph graph, DrawingFrame frame)
drawGraph in interface GraphDrawerpublic Graph getCurrentGraph()
getCurrentGraph in interface GraphDrawerpublic boolean isReadyForInteractions()
isReadyForInteractions in interface GraphDrawerpublic void moveNode(Node node, Position newPosition)
moveNode in interface GraphDrawerpublic void addMouseListener(MouseEventListener listener)
addMouseListener in interface GraphDrawerpublic void removeMouseListener(MouseEventListener listener)
removeMouseListener in interface GraphDrawerpublic void addSelectionListener(SelectionEventListener listener)
addSelectionListener in interface GraphDrawerpublic void removeSelectionListener(SelectionEventListener listener)
removeSelectionListener in interface GraphDrawerpublic void setIntermediateLayout(IntermediateLayout intermediateLayout)
setIntermediateLayout in interface GraphDrawerpublic java.awt.Dimension getSize()
getSize in interface GraphDrawerpublic void addPopupMenu(Position position, java.util.Collection<PopupItem> entries)
addPopupMenu in interface GraphDrawerpublic void setNodeBackgroundColor(Node node, Color color)
setNodeBackgroundColor in interface GraphDrawerpublic void resetNodeBackgroundColor(Node node)
resetNodeBackgroundColor in interface GraphDrawerpublic void setNodeShape(Node node, Shape shape)
setNodeShape in interface GraphDrawerpublic void redraw()
redraw in interface GraphDrawerpublic void redrawNodes(java.util.Collection<Node> nodes)
redrawNodes in interface GraphDrawerprotected org.eclipse.swt.graphics.Point graphToScreenCoord(Position position)
protected Position screenToGraphCoord(int x, int y)
protected abstract void updateSize(double width,
double height)
protected abstract org.eclipse.swt.graphics.Rectangle getBoundsForNode(Node node)
protected abstract T createControl(org.eclipse.swt.widgets.Composite parent)
protected abstract void drawCurrentGraph()
protected void notifyMouseListeners(java.util.List<Node> nodesUnderMouse, MouseEvent event)
protected void notifySelectionListeners(java.util.List<Node> selectedNodes, MouseEvent event)
protected boolean shouldHandleSelectionEvent(MouseEvent event)