fdda.dialog.java2d
Class Mover

java.lang.Object
  |
  +--fdda.dialog.java2d.AbstractManipulator
        |
        +--fdda.dialog.java2d.Mover
All Implemented Interfaces:
ComponentVisitor, Java2DComponentVisitor, Manipulator

public class Mover
extends AbstractManipulator
implements Java2DComponentVisitor

Moves a component (may be a Container, e.g. the selection)

Author:
Jörg Rüdenauer

Field Summary
 
Fields inherited from class fdda.dialog.java2d.AbstractManipulator
graphicHolder, painter
 
Constructor Summary
Mover(GraphicHolder graphicHolder)
          Constructor
 
Method Summary
 void execute(double x, double y)
          Moves the components.
 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)
          The current selection is used as the component to move.
 Object visitComponent(Component component)
          General visit method for not otherwise specified components
 Object visitContainer(Container container)
          Visit a container
 Object visitLine(Line line)
          Visit a line
 Object visitLineSegment(LineSegment segment)
          Visit a segment of a line
 Object visitMessage(Message message)
          Visit a message
 Object visitNode(Node node)
          Visit a node
 Object visitPoint(Point point)
          Visit a point.
 
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
 

Constructor Detail

Mover

public Mover(GraphicHolder graphicHolder)
Constructor

Parameters:
graphicHolder - the graphicHolder
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
The current selection is used as the component to move.

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
See Also:
Manipulator.start(double, double)

execute

public void execute(double x,
                    double y)
             throws NoSuitableComponentException
Moves the components.

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
See Also:
Manipulator.execute(double, double)

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

visitLine

public Object visitLine(Line line)
Description copied from interface: ComponentVisitor
Visit a line

Specified by:
visitLine in interface ComponentVisitor
Parameters:
line - the line
Returns:
depends on subclass

visitLineSegment

public Object visitLineSegment(LineSegment segment)
Description copied from interface: Java2DComponentVisitor
Visit a segment of a line

Specified by:
visitLineSegment in interface Java2DComponentVisitor
Parameters:
segment - the segment
Returns:
depends on subclass

visitComponent

public Object visitComponent(Component component)
Description copied from interface: ComponentVisitor
General visit method for not otherwise specified components

Specified by:
visitComponent in interface ComponentVisitor
Parameters:
component - the component to visit
Returns:
depends on subclass

visitNode

public Object visitNode(Node node)
Description copied from interface: ComponentVisitor
Visit a node

Specified by:
visitNode in interface ComponentVisitor
Parameters:
node - the node
Returns:
depends on subclass

visitPoint

public Object visitPoint(Point point)
Description copied from interface: Java2DComponentVisitor
Visit a point.

Specified by:
visitPoint in interface Java2DComponentVisitor
Parameters:
point - the point
Returns:
depends on subclass

visitContainer

public Object visitContainer(Container container)
Description copied from interface: ComponentVisitor
Visit a container

Specified by:
visitContainer in interface ComponentVisitor
Parameters:
container - the container
Returns:
depends on subclass

visitMessage

public Object visitMessage(Message message)
Description copied from interface: ComponentVisitor
Visit a message

Specified by:
visitMessage in interface ComponentVisitor
Parameters:
message - the message
Returns:
depends on subclass


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