org.objectweb.jac.ide.diagrams
Class PointcutLinkCreationTool

java.lang.Object
  |
  +--CH.ifa.draw.standard.AbstractTool
        |
        +--org.objectweb.jac.ide.diagrams.PointcutLinkCreationTool
All Implemented Interfaces:
EventListener, CH.ifa.draw.framework.Tool, CH.ifa.draw.framework.ViewChangeListener

public class PointcutLinkCreationTool
extends CH.ifa.draw.standard.AbstractTool


Field Summary
 
Fields inherited from class CH.ifa.draw.standard.AbstractTool
fAnchorX, fAnchorY
 
Constructor Summary
PointcutLinkCreationTool(CH.ifa.draw.framework.DrawingEditor newDrawingEditor, CH.ifa.draw.framework.ConnectionFigure newPrototype)
           
 
Method Summary
protected  CH.ifa.draw.framework.ConnectionFigure createConnection()
          Creates the ConnectionFigure.
protected  void createRelation(Class source, ModelElement target)
           
 void deactivate()
           
protected  CH.ifa.draw.framework.ConnectionFigure findConnection(int x, int y, CH.ifa.draw.framework.Drawing drawing)
          Finds an existing connection figure.
protected  CH.ifa.draw.framework.Figure findConnectionStart(int x, int y, CH.ifa.draw.framework.Drawing drawing)
          Finds a connection start figure.
protected  CH.ifa.draw.framework.Figure findSource(int x, int y, CH.ifa.draw.framework.Drawing drawing)
          Finds a connectable figure target.
protected  CH.ifa.draw.framework.Figure findTarget(int x, int y, CH.ifa.draw.framework.Drawing drawing)
          Finds a connectable figure target.
protected  CH.ifa.draw.framework.Figure getAddedFigure()
          Gets the figure that was actually added Note, this can be a different figure from the one which has been created.
protected  CH.ifa.draw.framework.ConnectionFigure getConnection()
          Gets the connection which is created by this tool
protected  CH.ifa.draw.framework.Connector getEndConnector()
           
protected  CH.ifa.draw.framework.Connector getStartConnector()
           
protected  CH.ifa.draw.framework.Connector getTargetConnector()
           
protected  CH.ifa.draw.framework.Figure getTargetFigure()
           
 void mouseDown(MouseEvent e, int x, int y)
          Manipulates connections in a context dependent way.
 void mouseDrag(MouseEvent e, int x, int y)
          Adjust the created connection or split segment.
 void mouseMove(MouseEvent e, int x, int y)
          Handles mouse move events in the drawing view.
 void mouseUp(MouseEvent e, int x, int y)
          Connects the figures if the mouse is released over another figure.
protected  void trackConnectors(MouseEvent e, int x, int y)
           
 
Methods inherited from class CH.ifa.draw.standard.AbstractTool
activate, addToolListener, checkUsable, createEventDispatcher, drawing, editor, getEventDispatcher, isActive, isEnabled, isUsable, keyDown, removeToolListener, setEnabled, setUsable, view, viewCreated, viewDestroying, viewSelectionChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointcutLinkCreationTool

public PointcutLinkCreationTool(CH.ifa.draw.framework.DrawingEditor newDrawingEditor,
                                CH.ifa.draw.framework.ConnectionFigure newPrototype)
Method Detail

mouseMove

public void mouseMove(MouseEvent e,
                      int x,
                      int y)
Handles mouse move events in the drawing view.

Specified by:
mouseMove in interface CH.ifa.draw.framework.Tool
Overrides:
mouseMove in class CH.ifa.draw.standard.AbstractTool

mouseDown

public void mouseDown(MouseEvent e,
                      int x,
                      int y)
Manipulates connections in a context dependent way. If the mouse down hits a figure start a new connection. If the mousedown hits a connection split a segment or join two segments.

Specified by:
mouseDown in interface CH.ifa.draw.framework.Tool
Overrides:
mouseDown in class CH.ifa.draw.standard.AbstractTool

mouseDrag

public void mouseDrag(MouseEvent e,
                      int x,
                      int y)
Adjust the created connection or split segment.

Specified by:
mouseDrag in interface CH.ifa.draw.framework.Tool
Overrides:
mouseDrag in class CH.ifa.draw.standard.AbstractTool

mouseUp

public void mouseUp(MouseEvent e,
                    int x,
                    int y)
Connects the figures if the mouse is released over another figure.

Specified by:
mouseUp in interface CH.ifa.draw.framework.Tool
Overrides:
mouseUp in class CH.ifa.draw.standard.AbstractTool

createRelation

protected void createRelation(Class source,
                              ModelElement target)

deactivate

public void deactivate()
Specified by:
deactivate in interface CH.ifa.draw.framework.Tool
Overrides:
deactivate in class CH.ifa.draw.standard.AbstractTool

createConnection

protected CH.ifa.draw.framework.ConnectionFigure createConnection()
Creates the ConnectionFigure. By default the figure prototype is cloned.


findSource

protected CH.ifa.draw.framework.Figure findSource(int x,
                                                  int y,
                                                  CH.ifa.draw.framework.Drawing drawing)
Finds a connectable figure target.


findTarget

protected CH.ifa.draw.framework.Figure findTarget(int x,
                                                  int y,
                                                  CH.ifa.draw.framework.Drawing drawing)
Finds a connectable figure target.


findConnection

protected CH.ifa.draw.framework.ConnectionFigure findConnection(int x,
                                                                int y,
                                                                CH.ifa.draw.framework.Drawing drawing)
Finds an existing connection figure.


getConnection

protected CH.ifa.draw.framework.ConnectionFigure getConnection()
Gets the connection which is created by this tool


trackConnectors

protected void trackConnectors(MouseEvent e,
                               int x,
                               int y)

findConnectionStart

protected CH.ifa.draw.framework.Figure findConnectionStart(int x,
                                                           int y,
                                                           CH.ifa.draw.framework.Drawing drawing)
Finds a connection start figure.


getStartConnector

protected CH.ifa.draw.framework.Connector getStartConnector()

getEndConnector

protected CH.ifa.draw.framework.Connector getEndConnector()

getTargetConnector

protected CH.ifa.draw.framework.Connector getTargetConnector()

getTargetFigure

protected CH.ifa.draw.framework.Figure getTargetFigure()

getAddedFigure

protected CH.ifa.draw.framework.Figure getAddedFigure()
Gets the figure that was actually added Note, this can be a different figure from the one which has been created.