org.objectweb.jac.ide.diagrams
Class RelationLinkCreationTool

java.lang.Object
  extended byCH.ifa.draw.standard.AbstractTool
      extended byorg.objectweb.jac.ide.diagrams.AbstractTool
          extended byorg.objectweb.jac.ide.diagrams.RelationLinkCreationTool
All Implemented Interfaces:
EventListener, CH.ifa.draw.framework.Tool, CH.ifa.draw.framework.ViewChangeListener
Direct Known Subclasses:
AggregationCreationTool, InheritanceLinkCreationTool

public class RelationLinkCreationTool
extends AbstractTool


Nested Class Summary
 
Nested classes inherited from class CH.ifa.draw.standard.AbstractTool
CH.ifa.draw.standard.AbstractTool.EventDispatcher
 
Field Summary
 
Fields inherited from class CH.ifa.draw.standard.AbstractTool
fAnchorX, fAnchorY
 
Constructor Summary
RelationLinkCreationTool(CH.ifa.draw.framework.DrawingEditor newDrawingEditor)
           
 
Method Summary
protected  LinkFigure createLinkFigure()
           
protected  void createRelation(Class source, Class target)
          Create a RelationLink between two classes.
 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  ModelElementFigure findTarget(int x, int y, CH.ifa.draw.framework.Drawing drawing)
          Finds a connectable figure target.
 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 org.objectweb.jac.ide.diagrams.AbstractTool
diagramView, isActive
 
Methods inherited from class CH.ifa.draw.standard.AbstractTool
activate, addToolListener, checkUsable, createEventDispatcher, drawing, editor, getEventDispatcher, 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

RelationLinkCreationTool

public RelationLinkCreationTool(CH.ifa.draw.framework.DrawingEditor newDrawingEditor)
Method Detail

mouseMove

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


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.


createLinkFigure

protected LinkFigure createLinkFigure()

mouseDrag

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


mouseUp

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


createRelation

protected void createRelation(Class source,
                              Class target)
Create a RelationLink between two classes.

Parameters:
source - start class of the link
target - end class of the link

deactivate

public void deactivate()

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 ModelElementFigure 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.


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.