fdda.dialog.java2d
Class LineCreator

java.lang.Object
  |
  +--fdda.dialog.java2d.AbstractManipulator
        |
        +--fdda.dialog.java2d.LineCreator
All Implemented Interfaces:
Manipulator, SelectionModifier

public class LineCreator
extends AbstractManipulator
implements SelectionModifier

Adds lines between nodes. The starting component must be a node.

Author:
Jörg Rüdenauer

Field Summary
static int LINE_IS_LOOP
          Reason for Exception: loop
static int NO_END_NODE
          Reason for Exception: line not ended above node
static int NODES_ALREADY_CONNECTED
          Reason for Exception: nodes already connected
 
Fields inherited from class fdda.dialog.java2d.AbstractManipulator
graphicHolder, painter
 
Constructor Summary
LineCreator(GraphicHolder graphicHolder, boolean directedLine)
          Constructor
 
Method Summary
 void execute(double x, double y)
          Executes the action.
 void finish(double x, double y)
          Finishes the action, making the changes permanent.
 void start(Component component)
          Starts the action, using the specified component
 void start(double x, double y)
          Starts the action.
 
Methods inherited from class fdda.dialog.java2d.AbstractManipulator
getGraphicHolder, moveToGrid, setGraphicHolder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_END_NODE

public static final int NO_END_NODE
Reason for Exception: line not ended above node

See Also:
Constant Field Values

NODES_ALREADY_CONNECTED

public static final int NODES_ALREADY_CONNECTED
Reason for Exception: nodes already connected

See Also:
Constant Field Values

LINE_IS_LOOP

public static final int LINE_IS_LOOP
Reason for Exception: loop

See Also:
Constant Field Values
Constructor Detail

LineCreator

public LineCreator(GraphicHolder graphicHolder,
                   boolean directedLine)
Constructor

Parameters:
graphicHolder - the graphic holder
directedLine - whether the line shall be directed
Method Detail

start

public void start(Component component)
           throws NoSuitableComponentException
Description copied from interface: Manipulator
Starts the action, using the specified component

Specified by:
start in interface Manipulator
Parameters:
component - the component
Throws:
NoSuitableComponentException - if the component can't be used for the action of the manipulator

start

public void start(double x,
                  double y)
           throws NoSuitableComponentException
Description copied from interface: Manipulator
Starts the action. The component is specified by its coordinates.

Specified by:
start in interface Manipulator
Parameters:
x - the x coordinate
y - the y coordinate
Throws:
NoSuitableComponentException - if no component that could be used for the action of the manipulator is at that point

execute

public void execute(double x,
                    double y)
             throws NoSuitableComponentException
Description copied from interface: Manipulator
Executes the action.

Specified by:
execute in interface Manipulator
Parameters:
x - the new x coordinate (may not be important)
y - the new y coordinate (may not be important)
Throws:
NoSuitableComponentException - if no suitable component was selected first by calling start

finish

public void finish(double x,
                   double y)
            throws NoSuitableComponentException
Description copied from interface: Manipulator
Finishes the action, making the changes permanent.

Specified by:
finish in interface Manipulator
Parameters:
x - the new x coordinate (may not be important)
y - the new y coordinate (may not be important)
Throws:
NoSuitableComponentException - if no suitable component was selected first by calling start


API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.