Back to index

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

A ChopBoxConnector locates connection points by choping the connection between the centers of the two figures at the display box. More...

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

List of all members.

Public Member Functions

 ChopBoxConnector ()
 ChopBoxConnector (Figure owner)
Point findStart (ConnectionFigure connection)
Point findEnd (ConnectionFigure connection)
Figure owner ()
 Gets the connector's owner.
Rectangle displayBox ()
 Gets the display box of the connector.
boolean containsPoint (int x, int y)
 Tests if a point is contained in the connector.
void draw (Graphics g)
 Draws this connector.
void write (StorableOutput dw)
 Stores the connector and its owner to a StorableOutput.
String getMap ()
void read (StorableInput dr) throws IOException
 Reads the connector and its owner from a StorableInput.

Protected Member Functions

Point chop (Figure target, Point from)
Point findPoint (ConnectionFigure connection)
 Gets the connection point.

Static Private Attributes

static final long serialVersionUID = -1461450322712345462L

Detailed Description

A ChopBoxConnector locates connection points by choping the connection between the centers of the two figures at the display box.

See also:
Connector

Definition at line 18 of file ChopBoxConnector.java.


Constructor & Destructor Documentation

Definition at line 25 of file ChopBoxConnector.java.

                              { // only used for Storable implementation
    }

Definition at line 28 of file ChopBoxConnector.java.

                                          {
        super(owner);
    }

Member Function Documentation

Point CH.ifa.draw.standard.ChopBoxConnector.chop ( Figure  target,
Point  from 
) [inline, protected]

Definition at line 58 of file ChopBoxConnector.java.

                                                    {
        Rectangle r = target.displayBox();
        return Geom.angleToPoint(r, (Geom.pointToAngle(r, from)));
    }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Tests if a point is contained in the connector.

Reimplemented in CH.ifa.draw.standard.LocatorConnector.

Definition at line 80 of file AbstractConnector.java.

                                               {
        return owner().containsPoint(x, y);
    }

Here is the call graph for this function:

Rectangle CH.ifa.draw.standard.AbstractConnector.displayBox ( ) [inline, inherited]

Gets the display box of the connector.

Reimplemented in CH.ifa.draw.standard.LocatorConnector.

Definition at line 73 of file AbstractConnector.java.

                                  {
        return owner().displayBox();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Draws this connector.

By default connectors are invisible.

Reimplemented in CH.ifa.draw.standard.LocatorConnector.

Definition at line 87 of file AbstractConnector.java.

                                 {
        // invisible by default
    }
Point CH.ifa.draw.standard.ChopBoxConnector.findEnd ( ConnectionFigure  connection) [inline]

Reimplemented from CH.ifa.draw.standard.AbstractConnector.

Definition at line 45 of file ChopBoxConnector.java.

                                                      {
        Figure endFigure = connection.end().owner();
        Rectangle r1 = connection.start().displayBox();
        Point r1c = null;

        if (connection.pointCount() == 2)
            r1c = new Point(r1.x + r1.width/2, r1.y + r1.height/2);
         else
            r1c = connection.pointAt(connection.pointCount()-2);

        return chop(endFigure, r1c);
    }

Here is the call graph for this function:

Point CH.ifa.draw.standard.AbstractConnector.findPoint ( ConnectionFigure  connection) [inline, protected, inherited]

Gets the connection point.

Override when the connector does not need to distinguish between the start and end point of a connection.

Definition at line 66 of file AbstractConnector.java.

                                                           {
        return Geom.center(displayBox());
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Point CH.ifa.draw.standard.ChopBoxConnector.findStart ( ConnectionFigure  connection) [inline]

Reimplemented from CH.ifa.draw.standard.AbstractConnector.

Definition at line 32 of file ChopBoxConnector.java.

                                                        {
        Figure startFigure = connection.start().owner();
        Rectangle r2 = connection.end().displayBox();
        Point r2c = null;

        if (connection.pointCount() == 2)
            r2c = new Point(r2.x + r2.width/2, r2.y + r2.height/2);
         else
            r2c = connection.pointAt(1);

        return chop(startFigure, r2c);
    }

Here is the call graph for this function:

String CH.ifa.draw.standard.AbstractConnector.getMap ( ) [inline, inherited]

Definition at line 98 of file AbstractConnector.java.

                           {
       return "";
    }
Figure CH.ifa.draw.standard.AbstractConnector.owner ( ) [inline, inherited]

Gets the connector's owner.

Definition at line 49 of file AbstractConnector.java.

                          {
        return fOwner;
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.AbstractConnector.read ( StorableInput  dr) throws IOException [inline, inherited]

Reads the connector and its owner from a StorableInput.

Reimplemented in CH.ifa.draw.standard.LocatorConnector.

Definition at line 105 of file AbstractConnector.java.

                                                          {
        fOwner = (Figure)dr.readStorable();
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.AbstractConnector.write ( StorableOutput  dw) [inline, inherited]

Stores the connector and its owner to a StorableOutput.

Reimplemented in CH.ifa.draw.standard.LocatorConnector.

Definition at line 94 of file AbstractConnector.java.

                                         {
        dw.writeStorable(fOwner);
    }

Here is the caller graph for this function:


Member Data Documentation

final long CH.ifa.draw.standard.ChopBoxConnector.serialVersionUID = -1461450322712345462L [static, private]

Reimplemented from CH.ifa.draw.standard.AbstractConnector.

Definition at line 23 of file ChopBoxConnector.java.


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