Back to index

moin  1.9.0~rc2
Public Member Functions | Private Attributes | Static Private Attributes
CH.ifa.draw.figures.GroupFigure Class Reference

A Figure that groups a collection of figures. More...

List of all members.

Public Member Functions

boolean canConnect ()
 GroupFigures cannot be connected.
Rectangle displayBox ()
 Gets the display box.
void basicDisplayBox (Point origin, Point corner)
 Transform all components proportionally.
FigureEnumeration decompose ()
Vector handles ()
 Gets the handles for the GroupFigure.
void setAttribute (String name, Object value)
 Sets the attribute of all the contained figures.

Private Attributes

int groupFigureSerializedDataVersion = 1

Static Private Attributes

static final long serialVersionUID = 8311226373023297933L

Detailed Description

A Figure that groups a collection of figures.

Definition at line 17 of file

Member Function Documentation

void CH.ifa.draw.figures.GroupFigure.basicDisplayBox ( Point  origin,
Point  corner 
) [inline]

Transform all components proportionally.

Note that because components are position at integer locations, we may get some odd-looking results!

Crawford Currie, Motorola

Definition at line 51 of file

       Rectangle srcr = displayBox();
       Rectangle dstr = new Rectangle(
           origin.x, origin.y,
           corner.x - origin.x, corner.y - origin.y);

       if (srcr.equals(dstr) ||
           corner.x <= origin.x || corner.y <= origin.y)

       // Scaling transform
       double xtx = (double)(corner.x - origin.x) / srcr.width;
       double ytx = (double)(corner.y - origin.y) / srcr.height;

        FigureEnumeration k = figures();

        while (k.hasMoreElements()) {
           Figure child = k.nextFigure();
           Rectangle sr = child.displayBox();
           Point childOrigin = new Point(
              (int)Math.round(dstr.x + (sr.x - srcr.x) * xtx),
              (int)Math.round(dstr.y + (sr.y - srcr.y) * ytx));
           Point childCorner = new Point(
              (int)Math.round(childOrigin.x + sr.width * xtx),
              (int)Math.round(childOrigin.y + sr.height * ytx));
           child.displayBox(childOrigin, childCorner);

Here is the call graph for this function:

GroupFigures cannot be connected.

Definition at line 28 of file

        return false;
FigureEnumeration CH.ifa.draw.figures.GroupFigure.decompose ( ) [inline]

Definition at line 80 of file

        return new FigureEnumerator(fFigures);

Gets the display box.

The display box is defined as the union of the contained figures.

Definition at line 36 of file

        FigureEnumeration k = figures();
        Rectangle r = k.nextFigure().displayBox();

        while (k.hasMoreElements())
        return r;

Here is the caller graph for this function:

Gets the handles for the GroupFigure.

Definition at line 87 of file

        Vector handles = new Vector();
       // Handles changed to standard handles to support group scaling
       // Crawford Currie, Motorola
       BoxHandleKit.addCornerHandles(this, handles);
       /* Was:
       handles.addElement(new GroupHandle(this, RelativeLocator.northWest()));
        handles.addElement(new GroupHandle(this, RelativeLocator.northEast()));
        handles.addElement(new GroupHandle(this, RelativeLocator.southWest()));
        handles.addElement(new GroupHandle(this, RelativeLocator.southEast()));
        return handles;
void CH.ifa.draw.figures.GroupFigure.setAttribute ( String  name,
Object  value 
) [inline]

Sets the attribute of all the contained figures.

Definition at line 104 of file

        super.setAttribute(name, value);
        FigureEnumeration k = figures();
        while (k.hasMoreElements())
            k.nextFigure().setAttribute(name, value);

Member Data Documentation

Definition at line 23 of file

final long CH.ifa.draw.figures.GroupFigure.serialVersionUID = 8311226373023297933L [static, private]

Definition at line 22 of file

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