|
JHotDraw 7.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.AbstractTool
org.jhotdraw.draw.BidirectionalConnectionTool
public class BidirectionalConnectionTool
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.
FIXME: Use a Tracker instance for each state of this tool.
Field Summary |
---|
Fields inherited from class org.jhotdraw.draw.AbstractTool |
---|
anchor, editor, isWorking, listenerList |
Fields inherited from class org.jhotdraw.beans.AbstractBean |
---|
propertySupport |
Constructor Summary | |
---|---|
BidirectionalConnectionTool(ConnectionFigure prototype)
Creates a new instance. |
|
BidirectionalConnectionTool(ConnectionFigure prototype,
java.util.Map<AttributeKey,java.lang.Object> attributes)
|
Method Summary | |
---|---|
void |
activate(DrawingEditor editor)
Activates the tool for the given editor. |
void |
areaInvalidated(FigureEvent evt)
Sent when the drawing area used by the figure needs to be repainted. |
void |
attributeChanged(FigureEvent e)
Sent when an attribute of the figure has changed. |
protected ConnectionFigure |
createFigure()
Creates the ConnectionFigure. |
void |
deactivate(DrawingEditor editor)
Deactivates the tool. |
void |
draw(java.awt.Graphics2D g)
Draws the tool. |
void |
figureAdded(FigureEvent e)
Sent when a figure was added to a drawing. |
void |
figureChanged(FigureEvent e)
Sent when the geometry (for example the bounds) of the figure has changed. |
void |
figureHandlesChanged(FigureEvent e)
Sent when handles of a Figure have been added, removed or replaced. |
void |
figureRemoved(FigureEvent e)
Sent when a figure was removed from a drawing. |
void |
figureRequestRemove(FigureEvent e)
Sent when the figure requests to be removed from a drawing. |
protected ConnectionFigure |
findConnection(java.awt.geom.Point2D.Double p,
Drawing drawing)
Finds an existing connection figure. |
protected Figure |
findConnectionStart(java.awt.geom.Point2D.Double p,
Drawing drawing)
Finds a connection start figure. |
protected Figure |
findSource(java.awt.geom.Point2D.Double p,
Drawing drawing)
Finds a connectable figure target. |
protected Figure |
findTarget(java.awt.geom.Point2D.Double p,
Drawing drawing)
Finds a connectable figure target. |
protected ConnectionFigure |
getConnection()
Gets the connection which is created by this tool |
protected Figure |
getCreatedFigure()
Gets the figure that was actually added Note, this can be a different figure from the one which has been created. |
protected Connector |
getEndConnector()
|
protected Connector |
getStartConnector()
|
protected Connector |
getTargetConnector()
|
protected Figure |
getTargetFigure()
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Adjust the created connection or split segment. |
void |
mouseMoved(java.awt.event.MouseEvent evt)
|
void |
mousePressed(java.awt.event.MouseEvent evt)
Manipulates connections in a context dependent way. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Connects the figures if the mouse is released over another figure. |
protected void |
trackConnectors(java.awt.event.MouseEvent e)
|
Methods inherited from class org.jhotdraw.draw.AbstractTool |
---|
addToolListener, addUndoableEditListener, constrainPoint, constrainPoint, createActionMap, createInputMap, editCopy, editCut, editDelete, editDuplicate, editPaste, fireAreaInvalidated, fireAreaInvalidated, fireToolDone, fireToolStarted, getActionMap, getDrawing, getEditor, getInputMap, getView, isActive, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, removeToolListener, removeUndoableEditListener, setActionMap, setInputMap, updateCursor, viewToDrawing |
Methods inherited from class org.jhotdraw.beans.AbstractBean |
---|
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BidirectionalConnectionTool(ConnectionFigure prototype)
public BidirectionalConnectionTool(ConnectionFigure prototype, java.util.Map<AttributeKey,java.lang.Object> attributes)
Method Detail |
---|
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class AbstractTool
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class AbstractTool
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class AbstractTool
public void activate(DrawingEditor editor)
Tool
activate
in interface Tool
activate
in class AbstractTool
public void deactivate(DrawingEditor editor)
Tool
deactivate
in interface Tool
deactivate
in class AbstractTool
protected ConnectionFigure createFigure()
protected Figure findSource(java.awt.geom.Point2D.Double p, Drawing drawing)
protected Figure findTarget(java.awt.geom.Point2D.Double p, Drawing drawing)
protected ConnectionFigure findConnection(java.awt.geom.Point2D.Double p, Drawing drawing)
protected ConnectionFigure getConnection()
protected void trackConnectors(java.awt.event.MouseEvent e)
public void draw(java.awt.Graphics2D g)
Tool
draw
in interface Tool
draw
in class AbstractTool
protected Figure findConnectionStart(java.awt.geom.Point2D.Double p, Drawing drawing)
protected Connector getStartConnector()
protected Connector getEndConnector()
protected Connector getTargetConnector()
protected Figure getTargetFigure()
protected Figure getCreatedFigure()
public void areaInvalidated(FigureEvent evt)
FigureListener
areaInvalidated
in interface FigureListener
public void figureAdded(FigureEvent e)
FigureListener
figureAdded
in interface FigureListener
public void figureChanged(FigureEvent e)
FigureListener
figureChanged
in interface FigureListener
public void figureRemoved(FigureEvent e)
FigureListener
figureRemoved
in interface FigureListener
public void figureRequestRemove(FigureEvent e)
FigureListener
figureRequestRemove
in interface FigureListener
public void attributeChanged(FigureEvent e)
FigureListener
attributeChanged
in interface FigureListener
public void figureHandlesChanged(FigureEvent e)
FigureListener
DrawingViews listen to this event to repopulate the Handles.
A Figure should not fire this event, if just the state or the location of Handle has changed.
figureHandlesChanged
in interface FigureListener
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |