|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.standard.AbstractTool
org.jhotdraw.standard.ConnectionTool
A tool that can be used to connect figures, to split connections, and to join two segments of a connection. ConnectionTools turns the visibility of the Connectors on when it enters a figure. The connection object to be created is specified by a prototype.
Prototype
ConnectionTools creates the connection by cloning a prototype.
ConnectionFigure
,
Object.clone()
Nested Class Summary | |
static class |
ConnectionTool.UndoActivity
|
Nested classes inherited from class org.jhotdraw.standard.AbstractTool |
AbstractTool.EventDispatcher |
Constructor Summary | |
ConnectionTool(DrawingEditor newDrawingEditor,
ConnectionFigure newPrototype)
|
Method Summary | |
protected ConnectionFigure |
createConnection()
Creates the ConnectionFigure. |
protected Undoable |
createUndoActivity()
Factory method for undo activity |
void |
deactivate()
Deactivates the tool. |
protected Figure |
findConnectableFigure(int x,
int y,
Drawing drawing)
Returns the topmost? |
protected ConnectionFigure |
findConnection(int x,
int y,
Drawing drawing)
Finds an existing connection figure. |
protected Figure |
findConnectionStart(int x,
int y,
Drawing drawing)
Finds a connection start figure. |
protected Connector |
findConnector(int x,
int y,
Figure f)
|
protected Figure |
findSource(int x,
int y,
Drawing drawing)
Finds a connectable figure target. |
protected Figure |
findTarget(int x,
int y,
Drawing drawing)
Finds a connectable figure target at the current mouse location that can 1. |
protected Figure |
getAddedFigure()
Gets the figure that was actually added Note, this can be a different figure from the one which has been created. |
protected ConnectionFigure |
getConnection()
Gets the connection which is created by this tool |
protected Connector |
getEndConnector()
|
protected Connector |
getStartConnector()
|
protected Connector |
getTargetConnector()
|
protected Figure |
getTargetFigure()
|
void |
mouseDown(java.awt.event.MouseEvent e,
int x,
int y)
Manipulates connections in a context dependent way. |
void |
mouseDrag(java.awt.event.MouseEvent e,
int x,
int y)
Adjust the created connection or split segment. |
void |
mouseMove(java.awt.event.MouseEvent e,
int x,
int y)
Handles mouse move events in the drawing view. |
void |
mouseUp(java.awt.event.MouseEvent e,
int x,
int y)
Connects the figures if the mouse is released over another figure. |
protected void |
setAddedFigure(Figure newAddedFigure)
|
protected void |
setConnection(ConnectionFigure newConnection)
|
protected void |
setEndConnector(Connector newEndConnector)
|
protected void |
setStartConnector(Connector newStartConnector)
|
protected void |
setTargetConnector(Connector newTargetConnector)
|
protected void |
setTargetFigure(Figure newTarget)
|
protected void |
trackConnectors(java.awt.event.MouseEvent e,
int x,
int y)
Attempts to set the Connector to be connected to based on the current location of the mouse. |
Methods inherited from class org.jhotdraw.standard.AbstractTool |
activate, addToolListener, checkUsable, createEventDispatcher, createViewChangeListener, drawing, editor, getActiveDrawing, getActiveView, getAnchorX, getAnchorY, getEventDispatcher, getUndoActivity, isActive, isEnabled, isUsable, keyDown, removeToolListener, setAnchorX, setAnchorY, setEditor, setEnabled, setUndoActivity, setUsable, setView, view, viewCreated, viewDestroying, viewSelectionChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ConnectionTool(DrawingEditor newDrawingEditor, ConnectionFigure newPrototype)
Method Detail |
public void mouseMove(java.awt.event.MouseEvent e, int x, int y)
mouseMove
in interface Tool
mouseMove
in class AbstractTool
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)
mouseDown
in interface Tool
mouseDown
in class AbstractTool
public void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
mouseDrag
in interface Tool
mouseDrag
in class AbstractTool
public void mouseUp(java.awt.event.MouseEvent e, int x, int y)
mouseUp
in interface Tool
mouseUp
in class AbstractTool
public void deactivate()
AbstractTool
deactivate
in interface Tool
deactivate
in class AbstractTool
protected ConnectionFigure createConnection()
protected Figure findSource(int x, int y, Drawing drawing)
protected Figure findTarget(int x, int y, Drawing drawing)
protected ConnectionFigure findConnection(int x, int y, Drawing drawing)
protected void setConnection(ConnectionFigure newConnection)
protected ConnectionFigure getConnection()
protected void trackConnectors(java.awt.event.MouseEvent e, int x, int y)
protected Connector findConnector(int x, int y, Figure f)
protected Figure findConnectionStart(int x, int y, Drawing drawing)
protected Figure findConnectableFigure(int x, int y, Drawing drawing)
protected void setStartConnector(Connector newStartConnector)
protected Connector getStartConnector()
protected void setEndConnector(Connector newEndConnector)
protected Connector getEndConnector()
protected void setTargetConnector(Connector newTargetConnector)
protected Connector getTargetConnector()
protected void setTargetFigure(Figure newTarget)
protected Figure getTargetFigure()
protected Figure getAddedFigure()
protected void setAddedFigure(Figure newAddedFigure)
protected Undoable createUndoActivity()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |