Back to index

moin  1.9.0~rc2
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
CH.ifa.draw.standard.ChangeConnectionEndHandle Class Reference

A handle to reconnect the end point of a connection to another figure. More...

Inheritance diagram for CH.ifa.draw.standard.ChangeConnectionEndHandle:
Inheritance graph
[legend]
Collaboration diagram for CH.ifa.draw.standard.ChangeConnectionEndHandle:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ChangeConnectionEndHandle (Figure owner)
 Constructs the connection handle.
Point locate ()
 Returns the end point of the connection.
void invokeStart (int x, int y, DrawingView view)
 Disconnects the connection.
void invokeStart (int x, int y, Drawing drawing)
 @ deprecated As of version 4.1, use invokeStart(x, y, drawingView) Tracks the start of the interaction.
void invokeStep (int x, int y, int anchorX, int anchorY, DrawingView view)
 Finds a new target of the connection.
void invokeStep (int dx, int dy, Drawing drawing)
 @ deprecated As of version 4.1, use invokeStep(x, y, anchorX, anchorY, drawingView)
void invokeEnd (int x, int y, int anchorX, int anchorY, DrawingView view)
 Connects the figure to the new target.
void invokeEnd (int dx, int dy, Drawing drawing)
void draw (Graphics g)
 Draws this handle.
Figure owner ()
 Gets the handle's owner.
Rectangle displayBox ()
 Gets the display box of the handle.
boolean containsPoint (int x, int y)
 Tests if a point is contained in the handle.

Static Public Attributes

static final int HANDLESIZE = 8
 The standard size of a handle.

Protected Member Functions

Connector target ()
 Gets the end figure of a connection.
void disconnect ()
 Disconnects the end figure.
void connect (Connector c)
 Sets the end of the connection.
void setPoint (int x, int y)
 Sets the end point of the connection.
Connector source ()
 Gets the side of the connection that is unaffected by the change.
Connector findConnector (int x, int y, Figure f)

Protected Attributes

Connector fOriginalTarget
Figure fTarget
ConnectionFigure fConnection
Point fStart

Detailed Description

A handle to reconnect the end point of a connection to another figure.

Definition at line 17 of file ChangeConnectionEndHandle.java.


Constructor & Destructor Documentation

Constructs the connection handle.

Definition at line 22 of file ChangeConnectionEndHandle.java.

                                                   {
        super(owner);
    }

Member Function Documentation

void CH.ifa.draw.standard.ChangeConnectionEndHandle.connect ( Connector  c) [inline, protected, virtual]

Sets the end of the connection.

Implements CH.ifa.draw.standard.ChangeConnectionHandle.

Definition at line 43 of file ChangeConnectionEndHandle.java.

                                        {
        fConnection.connectEnd(c);
    }

Here is the caller graph for this function:

boolean CH.ifa.draw.standard.AbstractHandle.containsPoint ( int  x,
int  y 
) [inline, inherited]

Tests if a point is contained in the handle.

Definition at line 124 of file AbstractHandle.java.

                                               {
        return displayBox().contains(x, y);
    }

Here is the call graph for this function:

void CH.ifa.draw.standard.ChangeConnectionEndHandle.disconnect ( ) [inline, protected, virtual]

Disconnects the end figure.

Implements CH.ifa.draw.standard.ChangeConnectionHandle.

Definition at line 36 of file ChangeConnectionEndHandle.java.

                                {
        fConnection.disconnectEnd();
    }
Rectangle CH.ifa.draw.standard.AbstractHandle.displayBox ( ) [inline, inherited]

Gets the display box of the handle.

Definition at line 112 of file AbstractHandle.java.

                                  {
        Point p = locate();
        return new Rectangle(
                p.x - HANDLESIZE / 2,
                p.y - HANDLESIZE / 2,
                HANDLESIZE,
                HANDLESIZE);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.standard.ChangeConnectionHandle.draw ( Graphics  g) [inline, inherited]

Draws this handle.

Reimplemented from CH.ifa.draw.standard.AbstractHandle.

Definition at line 133 of file ChangeConnectionHandle.java.

                                 {
        Rectangle r = displayBox();

        g.setColor(Color.green);
        g.fillRect(r.x, r.y, r.width, r.height);

        g.setColor(Color.black);
        g.drawRect(r.x, r.y, r.width, r.height);
    }

Here is the call graph for this function:

Connector CH.ifa.draw.standard.ChangeConnectionHandle.findConnector ( int  x,
int  y,
Figure  f 
) [inline, protected, inherited]

Definition at line 126 of file ChangeConnectionHandle.java.

                                                              {
        return f.connectorAt(x, y);
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.ChangeConnectionHandle.invokeEnd ( int  x,
int  y,
int  anchorX,
int  anchorY,
DrawingView  view 
) [inline, inherited]

Connects the figure to the new target.

If there is no new target the connection reverts to its original one.

Reimplemented from CH.ifa.draw.standard.AbstractHandle.

Definition at line 100 of file ChangeConnectionHandle.java.

                                                                                    {
        Connector target = findConnectionTarget(x, y, view.drawing());
        if (target == null)
            target = fOriginalTarget;

        setPoint(x, y);
        connect(target);
        fConnection.updateConnection();
        if (fTarget != null) {
            fTarget.connectorVisibility(false);
            fTarget = null;
        }
    }

Here is the call graph for this function:

void CH.ifa.draw.standard.AbstractHandle.invokeEnd ( int  dx,
int  dy,
Drawing  drawing 
) [inline, inherited]
Deprecated:
As of version 4.1, use invokeEnd(x, y, anchorX, anchorY, drawingView).

Tracks the end of the interaction.

Definition at line 100 of file AbstractHandle.java.

{ }
void CH.ifa.draw.standard.AbstractHandle.invokeStart ( int  x,
int  y,
Drawing  drawing 
) [inline, inherited]

@ deprecated As of version 4.1, use invokeStart(x, y, drawingView) Tracks the start of the interaction.

The default implementation does nothing.

Parameters:
xthe x position where the interaction started
ythe y position where the interaction started

Definition at line 47 of file AbstractHandle.java.

{ }

Here is the caller graph for this function:

void CH.ifa.draw.standard.ChangeConnectionHandle.invokeStart ( int  x,
int  y,
DrawingView  view 
) [inline, inherited]

Disconnects the connection.

Reimplemented from CH.ifa.draw.standard.AbstractHandle.

Definition at line 69 of file ChangeConnectionHandle.java.

                                                              {
        fOriginalTarget = target();
        fStart = new Point(x, y);
        disconnect();
    }

Here is the call graph for this function:

void CH.ifa.draw.standard.AbstractHandle.invokeStep ( int  dx,
int  dy,
Drawing  drawing 
) [inline, inherited]

@ deprecated As of version 4.1, use invokeStep(x, y, anchorX, anchorY, drawingView)

Tracks a step of the interaction.

Parameters:
dxx delta of this step
dyy delta of this step

Definition at line 70 of file AbstractHandle.java.

{ }

Here is the caller graph for this function:

void CH.ifa.draw.standard.ChangeConnectionHandle.invokeStep ( int  x,
int  y,
int  anchorX,
int  anchorY,
DrawingView  view 
) [inline, inherited]

Finds a new target of the connection.

Reimplemented from CH.ifa.draw.standard.AbstractHandle.

Definition at line 78 of file ChangeConnectionHandle.java.

                                                                                      {
        Point p = new Point(x, y);
        Figure f = findConnectableFigure(x, y, view.drawing());
        // track the figure containing the mouse
        if (f != fTarget) {
            if (fTarget != null)
                fTarget.connectorVisibility(false);
            fTarget = f;
            if (fTarget != null)
                fTarget.connectorVisibility(true);
        }

        Connector target = findConnectionTarget(p.x, p.y, view.drawing());
        if (target != null)
            p = Geom.center(target.displayBox());
        setPoint(p.x, p.y);
    }

Here is the call graph for this function:

Returns the end point of the connection.

Implements CH.ifa.draw.standard.AbstractHandle.

Definition at line 57 of file ChangeConnectionEndHandle.java.

                          {
        return fConnection.endPoint();
    }
Figure CH.ifa.draw.standard.AbstractHandle.owner ( ) [inline, inherited]

Gets the handle's owner.

Definition at line 105 of file AbstractHandle.java.

                          {
        return fOwner;
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.ChangeConnectionEndHandle.setPoint ( int  x,
int  y 
) [inline, protected, virtual]

Sets the end point of the connection.

Implements CH.ifa.draw.standard.ChangeConnectionHandle.

Definition at line 50 of file ChangeConnectionEndHandle.java.

                                          {
        fConnection.endPoint(x, y);
    }
Connector CH.ifa.draw.standard.ChangeConnectionHandle.source ( ) [inline, protected, inherited]

Gets the side of the connection that is unaffected by the change.

Definition at line 60 of file ChangeConnectionHandle.java.

                                 {
        if (target() == fConnection.start())
            return fConnection.end();
        return fConnection.start();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Connector CH.ifa.draw.standard.ChangeConnectionEndHandle.target ( ) [inline, protected, virtual]

Gets the end figure of a connection.

Implements CH.ifa.draw.standard.ChangeConnectionHandle.

Definition at line 29 of file ChangeConnectionEndHandle.java.

                                 {
        return fConnection.end();
    }

Member Data Documentation

ConnectionFigure CH.ifa.draw.standard.ChangeConnectionHandle.fConnection [protected, inherited]

Definition at line 24 of file ChangeConnectionHandle.java.

Definition at line 22 of file ChangeConnectionHandle.java.

Definition at line 25 of file ChangeConnectionHandle.java.

Definition at line 23 of file ChangeConnectionHandle.java.

final int CH.ifa.draw.standard.AbstractHandle.HANDLESIZE = 8 [static, inherited]

The standard size of a handle.

Definition at line 23 of file AbstractHandle.java.


The documentation for this class was generated from the following file: