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, wait
addPopupMenu
protected 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 GraphDrawer
public Graph getCurrentGraph()
getCurrentGraph
in interface GraphDrawer
public boolean isReadyForInteractions()
isReadyForInteractions
in interface GraphDrawer
public void moveNode(Node node, Position newPosition)
moveNode
in interface GraphDrawer
public void addMouseListener(MouseEventListener listener)
addMouseListener
in interface GraphDrawer
public void removeMouseListener(MouseEventListener listener)
removeMouseListener
in interface GraphDrawer
public void addSelectionListener(SelectionEventListener listener)
addSelectionListener
in interface GraphDrawer
public void removeSelectionListener(SelectionEventListener listener)
removeSelectionListener
in interface GraphDrawer
public void setIntermediateLayout(IntermediateLayout intermediateLayout)
setIntermediateLayout
in interface GraphDrawer
public java.awt.Dimension getSize()
getSize
in interface GraphDrawer
public void addPopupMenu(Position position, java.util.Collection<PopupItem> entries)
addPopupMenu
in interface GraphDrawer
public void setNodeBackgroundColor(Node node, Color color)
setNodeBackgroundColor
in interface GraphDrawer
public void resetNodeBackgroundColor(Node node)
resetNodeBackgroundColor
in interface GraphDrawer
public void setNodeShape(Node node, Shape shape)
setNodeShape
in interface GraphDrawer
public void redraw()
redraw
in interface GraphDrawer
public void redrawNodes(java.util.Collection<Node> nodes)
redrawNodes
in interface GraphDrawer
protected 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)