Back to index

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

A Figure that is composed of several figures. More...

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

List of all members.

Public Member Functions

Figure add (Figure figure)
 Adds a figure to the list of figures.
void addAll (Vector newFigures)
 Adds a vector of figures.
Figure remove (Figure figure)
 Removes a figure from the composite.
void removeAll (Vector figures)
 Removes a vector of figures.
void removeAll ()
 Removes all children.
synchronized Figure orphan (Figure figure)
 Removes a figure from the figure list, but doesn't release it.
void orphanAll (Vector newFigures)
 Removes a vector of figures from the figure's list without releasing the figures.
synchronized void replace (Figure figure, Figure replacement)
 Replaces a figure in the drawing without removing it from the drawing.
synchronized void sendToBack (Figure figure)
 Sends a figure to the back of the drawing.
synchronized void bringToFront (Figure figure)
 Brings a figure to the front.
void draw (Graphics g, boolean showGuides)
 Draws all the contained figures.
Figure figureAt (int i)
 Gets a figure at the given index.
final FigureEnumeration figures ()
 Returns an Enumeration for accessing the contained figures.
int figureCount ()
 Gets number of child figures.
final FigureEnumeration figuresReverse ()
 Returns an Enumeration for accessing the contained figures in the reverse drawing order.
Figure findFigure (int x, int y)
 Finds a top level Figure.
Figure findFigure (Rectangle r)
 Finds a top level Figure that intersects the given rectangle.
Figure findFigureWithout (int x, int y, Figure without)
 Finds a top level Figure, but supresses the passed in figure.
Figure findFigure (Rectangle r, Figure without)
 Finds a top level Figure that intersects the given rectangle.
Figure findFigureInside (int x, int y)
 Finds a figure but descends into a figure's children.
Figure findFigureInsideWithout (int x, int y, Figure without)
 Finds a figure but descends into a figure's children.
boolean includes (Figure figure)
 Checks if the composite figure has the argument as one of its children.
void release ()
 Releases the figure and all its children.
void figureInvalidated (FigureChangeEvent e)
 Propagates the figureInvalidated event to my listener.
void figureRequestRemove (FigureChangeEvent e)
 Propagates the removeFromDrawing request up to the container.
void figureRequestUpdate (FigureChangeEvent e)
 Propagates the requestUpdate request up to the container.
void figureChanged (FigureChangeEvent e)
void figureRemoved (FigureChangeEvent e)
void write (StorableOutput dw)
 Writes the contained figures to the StorableOutput.
String getMap ()
void read (StorableInput dr) throws IOException
 Reads the contained figures from StorableInput.
void moveBy (int dx, int dy)
 Moves the figure by the given offset.
void displayBox (Point origin, Point corner)
 Changes the display box of a figure.
abstract Rectangle displayBox ()
 Gets the display box of a figure.
void displayBox (Rectangle r)
 Changes the display box of a figure.
abstract void basicDisplayBox (Point origin, Point corner)
 Sets the display box of a figure.
abstract Vector handles ()
 Returns the handles of a Figure that can be used to manipulate some of its attributes.
Dimension size ()
 Gets the size of the figure.
boolean isEmpty ()
 Checks if the figure is empty.
boolean containsPoint (int x, int y)
 Checks if a point is inside the figure.
FigureEnumeration decompose ()
 Decomposes a figure into its parts.
void addToContainer (FigureChangeListener c)
 Sets the Figure's container and registers the container as a figure change listener.
void removeFromContainer (FigureChangeListener c)
 Removes a figure from the given container and unregisters it as a change listener.
void addFigureChangeListener (FigureChangeListener l)
 Adds a listener for this figure.
void removeFigureChangeListener (FigureChangeListener l)
 Removes a listener for this figure.
FigureChangeListener listener ()
 Gets the figure's listners.
void invalidate ()
 Invalidates the figure.
void willChange ()
 Informes that a figure is about to change something that affects the contents of its display box.
void changed ()
 Informs that a figure changed the area of its display box.
Point center ()
 Gets the center of a figure.
boolean canConnect ()
 Checks if this figure can be connected.
Insets connectionInsets ()
 Returns the connection inset.
Connector connectorAt (int x, int y)
 Returns the Figures connector for the specified location.
void connectorVisibility (boolean isVisible)
 Sets whether the connectors should be visible.
Locator connectedTextLocator (Figure text)
 Returns the locator used to located connected text.
Object defaultAttribute (String name)
 Gets a the default value for a named attribute.
Object getAttribute (String name)
 Returns the named attribute or null if a a figure doesn't have an attribute.
void setAttribute (String name, Object value)
 Sets the named attribute to the new value.
Object clone ()
 Clones a figure.

Protected Member Functions

 CompositeFigure ()
void basicMoveBy (int x, int y)
 Moves all the given figures by x and y.

Protected Attributes

Vector fFigures
 The figures that this figure is composed of.

Static Protected Attributes

static Font dialogFont = Font.decode("dialog-PLAIN-12")

Private Member Functions

void readObject (ObjectInputStream s) throws ClassNotFoundException, IOException

Private Attributes

int compositeFigureSerializedDataVersion = 1

Static Private Attributes

static final long serialVersionUID = 7408153435700021866L

Detailed Description

A Figure that is composed of several figures.

A CompositeFigure doesn't define any layout behavior. It is up to subclassers to arrange the contained figures.


Design Patterns

 o

Composite
CompositeFigure enables to treat a composition of figures like a single figure.

See also:
Figure

Definition at line 27 of file CompositeFigure.java.


Constructor & Destructor Documentation

Definition at line 44 of file CompositeFigure.java.

                                {
        fFigures = new Vector();
    }

Member Function Documentation

Figure CH.ifa.draw.standard.CompositeFigure.add ( Figure  figure) [inline]

Adds a figure to the list of figures.

Initializes the the figure's container.

Definition at line 52 of file CompositeFigure.java.

                                     {
        if (!fFigures.contains(figure)) {
            fFigures.addElement(figure);
            figure.addToContainer(this);
        }
        return figure;
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.CompositeFigure.addAll ( Vector  newFigures) [inline]

Adds a vector of figures.

See also:
add

Definition at line 64 of file CompositeFigure.java.

                                          {
        Enumeration k = newFigures.elements();
        while (k.hasMoreElements())
            add((Figure) k.nextElement());
    }

Here is the call graph for this function:

void CH.ifa.draw.standard.AbstractFigure.addFigureChangeListener ( FigureChangeListener  l) [inline, inherited]

Adds a listener for this figure.

Definition at line 211 of file AbstractFigure.java.

                                                                {
        fListener = FigureChangeEventMulticaster.add(fListener, l);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.standard.AbstractFigure.addToContainer ( FigureChangeListener  c) [inline, inherited]

Sets the Figure's container and registers the container as a figure change listener.

A figure's container can be any kind of FigureChangeListener. A figure is not restricted to have a single container.

Definition at line 193 of file AbstractFigure.java.

Here is the call graph for this function:

abstract void CH.ifa.draw.standard.AbstractFigure.basicDisplayBox ( Point  origin,
Point  corner 
) [pure virtual, inherited]

Sets the display box of a figure.

This is the method that subclassers override. Clients usually call displayBox.

See also:
displayBox

Implemented in CH.ifa.draw.standard.StandardDrawing, and CH.ifa.draw.standard.DecoratorFigure.

Here is the caller graph for this function:

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

Moves all the given figures by x and y.

Doesn't announce any changes. Subclassers override basicMoveBy. Clients usually call moveBy.

See also:
moveBy

Implements CH.ifa.draw.standard.AbstractFigure.

Definition at line 327 of file CompositeFigure.java.

                                             {
        FigureEnumeration k = figures();
        while (k.hasMoreElements()) {
            Figure fig = k.nextFigure();
            Figure obsrvd = (Figure) fig.getAttribute("observed.figure");
            if (obsrvd == null || !includes(obsrvd)) {
                fig.moveBy(x, y);
            }
        }
    }

Here is the call graph for this function:

synchronized void CH.ifa.draw.standard.CompositeFigure.bringToFront ( Figure  figure) [inline]

Brings a figure to the front.

Definition at line 153 of file CompositeFigure.java.

                                                         {
        if (fFigures.contains(figure)) {
            fFigures.removeElement(figure);
            fFigures.addElement(figure);
            figure.changed();
        }
    }
boolean CH.ifa.draw.standard.AbstractFigure.canConnect ( ) [inline, inherited]

Checks if this figure can be connected.

By default AbstractFigures can be connected.

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 287 of file AbstractFigure.java.

                                {
        return true;
    }
Point CH.ifa.draw.standard.AbstractFigure.center ( ) [inline, inherited]

Gets the center of a figure.

A convenice method that is rarely overridden.

Definition at line 279 of file AbstractFigure.java.

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

Here is the call graph for this function:

void CH.ifa.draw.standard.AbstractFigure.changed ( ) [inline, inherited]

Informs that a figure changed the area of its display box.

See also:
FigureChangeEvent
Figure::changed

Definition at line 268 of file AbstractFigure.java.

                          {
        invalidate();
        if (fListener != null)
            fListener.figureChanged(new FigureChangeEvent(this));

    }

Here is the call graph for this function:

Here is the caller graph for this function:

Object CH.ifa.draw.standard.AbstractFigure.clone ( ) [inline, inherited]

Clones a figure.

Creates a clone by using the storable mechanism to flatten the Figure to stream followed by resurrecting it from the same stream.

See also:
Figure::clone

Definition at line 364 of file AbstractFigure.java.

                          {
        Object clone = null;
        ByteArrayOutputStream output = new ByteArrayOutputStream(200);
        try {
            ObjectOutput writer = new ObjectOutputStream(output);
            writer.writeObject(this);
            writer.close();
        } catch (IOException e) {
            System.out.println("Class not found: " + e);
        }

        InputStream input = new ByteArrayInputStream(output.toByteArray());
        try {
            ObjectInput reader = new ObjectInputStream(input);
            clone = (Object) reader.readObject();
        } catch (IOException e) {
            System.out.println(e.toString());
        }
        catch (ClassNotFoundException e) {
            System.out.println("Class not found: " + e);
        }
        return clone;
    }
Locator CH.ifa.draw.standard.AbstractFigure.connectedTextLocator ( Figure  text) [inline, inherited]

Returns the locator used to located connected text.

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 321 of file AbstractFigure.java.

                                                     {
        return RelativeLocator.center();
    }

Here is the call graph for this function:

Returns the connection inset.

The connection inset defines the area where the display box of a figure can't be connected. By default the entire display box can be connected.

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 298 of file AbstractFigure.java.

                                     {
        return new Insets(0, 0, 0, 0);
    }
Connector CH.ifa.draw.standard.AbstractFigure.connectorAt ( int  x,
int  y 
) [inline, inherited]

Returns the Figures connector for the specified location.

By default a ChopBoxConnector is returned.

See also:
ChopBoxConnector

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 307 of file AbstractFigure.java.

                                               {
        return new ChopBoxConnector(this);
    }
void CH.ifa.draw.standard.AbstractFigure.connectorVisibility ( boolean  isVisible) [inline, inherited]

Sets whether the connectors should be visible.

By default they are not visible and

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 315 of file AbstractFigure.java.

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

Checks if a point is inside the figure.

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 154 of file AbstractFigure.java.

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

Here is the call graph for this function:

Here is the caller graph for this function:

FigureEnumeration CH.ifa.draw.standard.AbstractFigure.decompose ( ) [inline, inherited]

Decomposes a figure into its parts.

It returns a Vector that contains itself.

Returns:
an Enumeration for a Vector with itself as the only element.

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 181 of file AbstractFigure.java.

                                         {
        Vector figures = new Vector(1);
        figures.addElement(this);
        return new FigureEnumerator(figures);
    }

Here is the call graph for this function:

Object CH.ifa.draw.standard.AbstractFigure.defaultAttribute ( String  name) [inline, inherited]

Gets a the default value for a named attribute.

See also:
getAttribute

Definition at line 329 of file AbstractFigure.java.

                                                {
       return null;
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.AbstractFigure.displayBox ( Point  origin,
Point  corner 
) [inline, inherited]

Changes the display box of a figure.

Clients usually call this method. It changes the display box and announces the corresponding change.

Parameters:
originthe new origin
cornerthe new corner
See also:
displayBox

Definition at line 85 of file AbstractFigure.java.

                                                       {
        willChange();
        basicDisplayBox(origin, corner);
        changed();
    }

Here is the call graph for this function:

abstract Rectangle CH.ifa.draw.standard.AbstractFigure.displayBox ( ) [pure virtual, inherited]

Gets the display box of a figure.

Implemented in CH.ifa.draw.standard.StandardDrawing, and CH.ifa.draw.standard.DecoratorFigure.

Here is the caller graph for this function:

void CH.ifa.draw.standard.AbstractFigure.displayBox ( Rectangle  r) [inline, inherited]

Changes the display box of a figure.

This is a convenience method. Implementors should only have to override basicDisplayBox

See also:
displayBox

Definition at line 164 of file AbstractFigure.java.

                                        {
        displayBox(new Point(r.x, r.y), new Point(r.x+r.width, r.y+r.height));
    }

Here is the call graph for this function:

void CH.ifa.draw.standard.CompositeFigure.draw ( Graphics  g,
boolean  showGuides 
) [inline]

Draws all the contained figures.

See also:
Figure::draw

Definition at line 165 of file CompositeFigure.java.

                                                     {
        FigureEnumeration k = figures();
        while (k.hasMoreElements())
            k.nextFigure().draw(g, showGuides);
    }

Here is the call graph for this function:

Gets a figure at the given index.

Definition at line 174 of file CompositeFigure.java.

                                  {
        return (Figure)fFigures.elementAt(i);
    }
void CH.ifa.draw.standard.CompositeFigure.figureChanged ( FigureChangeEvent  e) [inline]

Definition at line 377 of file CompositeFigure.java.

                                                   {
    }

Gets number of child figures.

Definition at line 189 of file CompositeFigure.java.

                             {
        return fFigures.size();
    }
void CH.ifa.draw.standard.CompositeFigure.figureInvalidated ( FigureChangeEvent  e) [inline]

Propagates the figureInvalidated event to my listener.

See also:
FigureChangeListener

Reimplemented in CH.ifa.draw.standard.StandardDrawing.

Definition at line 354 of file CompositeFigure.java.

                                                       {
        if (listener() != null)
            listener().figureInvalidated(e);
    }

Here is the call graph for this function:

void CH.ifa.draw.standard.CompositeFigure.figureRemoved ( FigureChangeEvent  e) [inline]

Definition at line 380 of file CompositeFigure.java.

                                                   {
    }
void CH.ifa.draw.standard.CompositeFigure.figureRequestRemove ( FigureChangeEvent  e) [inline]

Propagates the removeFromDrawing request up to the container.

See also:
FigureChangeListener

Reimplemented in CH.ifa.draw.standard.StandardDrawing.

Definition at line 363 of file CompositeFigure.java.

                                                         {
        if (listener() != null)
            listener().figureRequestRemove(new FigureChangeEvent(this));
    }

Here is the call graph for this function:

void CH.ifa.draw.standard.CompositeFigure.figureRequestUpdate ( FigureChangeEvent  e) [inline]

Propagates the requestUpdate request up to the container.

See also:
FigureChangeListener

Reimplemented in CH.ifa.draw.standard.StandardDrawing.

Definition at line 372 of file CompositeFigure.java.

                                                         {
        if (listener() != null)
            listener().figureRequestUpdate(e);
    }

Here is the call graph for this function:

final FigureEnumeration CH.ifa.draw.standard.CompositeFigure.figures ( ) [inline]

Returns an Enumeration for accessing the contained figures.

The figures are returned in the drawing order.

Reimplemented from CH.ifa.draw.standard.AbstractFigure.

Definition at line 182 of file CompositeFigure.java.

                                             {
        return new FigureEnumerator(fFigures);
    }

Here is the caller graph for this function:

final FigureEnumeration CH.ifa.draw.standard.CompositeFigure.figuresReverse ( ) [inline]

Returns an Enumeration for accessing the contained figures in the reverse drawing order.

Definition at line 197 of file CompositeFigure.java.

                                                    {
        return new ReverseFigureEnumerator(fFigures);
    }

Here is the caller graph for this function:

Figure CH.ifa.draw.standard.CompositeFigure.findFigure ( int  x,
int  y 
) [inline]

Finds a top level Figure.

Use this call for hit detection that should not descend into the figure's children.

Definition at line 205 of file CompositeFigure.java.

                                           {
        FigureEnumeration k = figuresReverse();
        while (k.hasMoreElements()) {
            Figure figure = k.nextFigure();
            if (figure.containsPoint(x, y))
                return figure;
        }
        return null;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Figure CH.ifa.draw.standard.CompositeFigure.findFigure ( Rectangle  r) [inline]

Finds a top level Figure that intersects the given rectangle.

Definition at line 218 of file CompositeFigure.java.

                                          {
        FigureEnumeration k = figuresReverse();
        while (k.hasMoreElements()) {
            Figure figure = k.nextFigure();
            Rectangle fr = figure.displayBox();
            if (r.intersects(fr))
                return figure;
        }
        return null;
    }

Here is the call graph for this function:

Figure CH.ifa.draw.standard.CompositeFigure.findFigure ( Rectangle  r,
Figure  without 
) [inline]

Finds a top level Figure that intersects the given rectangle.

It supresses the passed in figure. Use this method to ignore a figure that is temporarily inserted into the drawing.

Definition at line 256 of file CompositeFigure.java.

                                                          {
        if (without == null)
            return findFigure(r);
        FigureEnumeration k = figuresReverse();
        while (k.hasMoreElements()) {
            Figure figure = k.nextFigure();
            Rectangle fr = figure.displayBox();
            if (r.intersects(fr) && !figure.includes(without))
                return figure;
        }
        return null;
    }

Here is the call graph for this function:

Figure CH.ifa.draw.standard.CompositeFigure.findFigureInside ( int  x,
int  y 
) [inline]

Finds a figure but descends into a figure's children.

Use this method to implement click-through hit detection, that is, you want to detect the inner most figure containing the given point.

Reimplemented from CH.ifa.draw.standard.AbstractFigure.

Definition at line 275 of file CompositeFigure.java.

                                                 {
        FigureEnumeration k = figuresReverse();
        while (k.hasMoreElements()) {
            Figure figure = k.nextFigure().findFigureInside(x, y);
            if (figure != null)
                return figure;
        }
        return null;
    }

Here is the call graph for this function:

Figure CH.ifa.draw.standard.CompositeFigure.findFigureInsideWithout ( int  x,
int  y,
Figure  without 
) [inline]

Finds a figure but descends into a figure's children.

It supresses the passed in figure. Use this method to ignore a figure that is temporarily inserted into the drawing.

Definition at line 291 of file CompositeFigure.java.

                                                                        {
        FigureEnumeration k = figuresReverse();
        while (k.hasMoreElements()) {
            Figure figure = k.nextFigure();
            if (figure != without) {
                Figure found = figure.findFigureInside(x, y);
                if (found != null)
                    return found;
            }
        }
        return null;
    }

Here is the call graph for this function:

Figure CH.ifa.draw.standard.CompositeFigure.findFigureWithout ( int  x,
int  y,
Figure  without 
) [inline]

Finds a top level Figure, but supresses the passed in figure.

Use this method to ignore a figure that is temporarily inserted into the drawing.

Parameters:
xthe x coordinate
ythe y coordinate
withoutthe figure to be ignored during the find.

Definition at line 238 of file CompositeFigure.java.

                                                                  {
        if (without == null)
            return findFigure(x, y);
        FigureEnumeration k = figuresReverse();
        while (k.hasMoreElements()) {
            Figure figure = k.nextFigure();
            if (figure.containsPoint(x, y) && !figure.includes(without))
                return figure;
        }
        return null;
    }

Here is the call graph for this function:

Object CH.ifa.draw.standard.AbstractFigure.getAttribute ( String  name) [inline, inherited]

Returns the named attribute or null if a a figure doesn't have an attribute.

All figures support the attribute names FillColor and FrameColor

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 339 of file AbstractFigure.java.

                                            {
        if (fAttributes != null) {
            if (fAttributes.hasDefined(name))
                return fAttributes.get(name);
        }
        return defaultAttribute(name);
    }

Here is the call graph for this function:

Definition at line 394 of file CompositeFigure.java.

                           {
       String areas = "";
        Enumeration k = fFigures.elements();
        while (k.hasMoreElements())
            areas = ((Storable) k.nextElement()).getMap() + areas;
       return areas;
    }
abstract Vector CH.ifa.draw.standard.AbstractFigure.handles ( ) [pure virtual, inherited]

Returns the handles of a Figure that can be used to manipulate some of its attributes.

Returns:
a Vector of handles
See also:
Handle

Implemented in CH.ifa.draw.standard.StandardDrawing, and CH.ifa.draw.standard.DecoratorFigure.

boolean CH.ifa.draw.standard.CompositeFigure.includes ( Figure  figure) [inline]

Checks if the composite figure has the argument as one of its children.

Reimplemented from CH.ifa.draw.standard.AbstractFigure.

Definition at line 308 of file CompositeFigure.java.

                                           {
        if (super.includes(figure))
            return true;

        FigureEnumeration k = figures();
        while (k.hasMoreElements()) {
            Figure f = k.nextFigure();
            if (f.includes(figure))
                return true;
        }
        return false;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.standard.AbstractFigure.invalidate ( ) [inline, inherited]

Invalidates the figure.

This method informs the listeners that the figure's current display box is invalid and should be refreshed.

Definition at line 244 of file AbstractFigure.java.

                             {
        if (fListener != null) {
            Rectangle r = displayBox();
            r.grow(Handle.HANDLESIZE, Handle.HANDLESIZE);
            fListener.figureInvalidated(new FigureChangeEvent(this, r));
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean CH.ifa.draw.standard.AbstractFigure.isEmpty ( ) [inline, inherited]

Checks if the figure is empty.

The default implementation returns true if the width or height of its display box is < 3

See also:
Figure::isEmpty

Definition at line 134 of file AbstractFigure.java.

                             {
        return (size().width < 3) || (size().height < 3);
    }

Here is the call graph for this function:

FigureChangeListener CH.ifa.draw.standard.AbstractFigure.listener ( ) [inline, inherited]

Gets the figure's listners.

Definition at line 225 of file AbstractFigure.java.

                                           {
        return fListener;
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.AbstractFigure.moveBy ( int  dx,
int  dy 
) [inline, inherited]

Moves the figure by the given offset.

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 63 of file AbstractFigure.java.

                                       {
        willChange();
        basicMoveBy(dx, dy);
        changed();
    }

Here is the call graph for this function:

synchronized Figure CH.ifa.draw.standard.CompositeFigure.orphan ( Figure  figure) [inline]

Removes a figure from the figure list, but doesn't release it.

Use this method to temporarily manipulate a figure outside of the drawing.

Definition at line 110 of file CompositeFigure.java.

                                                     {
        fFigures.removeElement(figure);
        return figure;
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.CompositeFigure.orphanAll ( Vector  newFigures) [inline]

Removes a vector of figures from the figure's list without releasing the figures.

See also:
orphan

Definition at line 120 of file CompositeFigure.java.

                                             {
        Enumeration k = newFigures.elements();
        while (k.hasMoreElements())
            orphan((Figure) k.nextElement());
    }

Here is the call graph for this function:

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

Reads the contained figures from StorableInput.

Reimplemented from CH.ifa.draw.standard.AbstractFigure.

Definition at line 405 of file CompositeFigure.java.

                                                          {
        super.read(dr);
        int size = dr.readInt();
        fFigures = new Vector(size);
        for (int i=0; i<size; i++)
            add((Figure)dr.readStorable());
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.standard.CompositeFigure.readObject ( ObjectInputStream  s) throws ClassNotFoundException, IOException [inline, private]

Reimplemented in CH.ifa.draw.standard.StandardDrawing.

Definition at line 413 of file CompositeFigure.java.

                                                   {

        s.defaultReadObject();

        FigureEnumeration k = figures();
        while (k.hasMoreElements()) {
            Figure figure = k.nextFigure();
            figure.addToContainer(this);
        }
    }

Here is the call graph for this function:

Releases the figure and all its children.

Reimplemented from CH.ifa.draw.standard.AbstractFigure.

Definition at line 341 of file CompositeFigure.java.

                          {
        super.release();
        FigureEnumeration k = figures();
        while (k.hasMoreElements()) {
            Figure figure = k.nextFigure();
            figure.release();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Figure CH.ifa.draw.standard.CompositeFigure.remove ( Figure  figure) [inline]

Removes a figure from the composite.

See also:
removeAll

Reimplemented in CH.ifa.draw.standard.StandardDrawing.

Definition at line 74 of file CompositeFigure.java.

                                        {
        if (fFigures.contains(figure)) {
            figure.removeFromContainer(this);
            fFigures.removeElement(figure);
        }
        return figure;
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.CompositeFigure.removeAll ( Vector  figures) [inline]

Removes a vector of figures.

See also:
remove

Definition at line 86 of file CompositeFigure.java.

                                          {
        Enumeration k = figures.elements();
        while (k.hasMoreElements())
            remove((Figure) k.nextElement());
    }

Removes all children.

See also:
remove

Definition at line 96 of file CompositeFigure.java.

                            {
        FigureEnumeration k = figures();
        while (k.hasMoreElements()) {
            Figure figure = k.nextFigure();
            figure.removeFromContainer(this);
        }
        fFigures.removeAllElements();
    }

Here is the call graph for this function:

void CH.ifa.draw.standard.AbstractFigure.removeFigureChangeListener ( FigureChangeListener  l) [inline, inherited]

Removes a listener for this figure.

Definition at line 218 of file AbstractFigure.java.

                                                                   {
        fListener = FigureChangeEventMulticaster.remove(fListener, l);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.standard.AbstractFigure.removeFromContainer ( FigureChangeListener  c) [inline, inherited]

Removes a figure from the given container and unregisters it as a change listener.

Definition at line 202 of file AbstractFigure.java.

Here is the call graph for this function:

synchronized void CH.ifa.draw.standard.CompositeFigure.replace ( Figure  figure,
Figure  replacement 
) [inline]

Replaces a figure in the drawing without removing it from the drawing.

Definition at line 130 of file CompositeFigure.java.

                                                                        {
        int index = fFigures.indexOf(figure);
        if (index != -1) {
            replacement.addToContainer(this);   // will invalidate figure
            figure.changed();
            fFigures.setElementAt(replacement, index);
        }
    }

Here is the caller graph for this function:

synchronized void CH.ifa.draw.standard.CompositeFigure.sendToBack ( Figure  figure) [inline]

Sends a figure to the back of the drawing.

Definition at line 142 of file CompositeFigure.java.

                                                       {
        if (fFigures.contains(figure)) {
            fFigures.removeElement(figure);
            fFigures.insertElementAt(figure,0);
            figure.changed();
        }
    }
void CH.ifa.draw.standard.AbstractFigure.setAttribute ( String  name,
Object  value 
) [inline, inherited]

Sets the named attribute to the new value.

Reimplemented in CH.ifa.draw.standard.DecoratorFigure.

Definition at line 350 of file AbstractFigure.java.

                                                        {
        if (fAttributes == null)
            fAttributes = new FigureAttributes();
        fAttributes.set(name, value);
        changed();
    }

Here is the call graph for this function:

Dimension CH.ifa.draw.standard.AbstractFigure.size ( ) [inline, inherited]

Gets the size of the figure.

A convenience method.

Definition at line 125 of file AbstractFigure.java.

                            {
        return new Dimension(displayBox().width, displayBox().height);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.standard.AbstractFigure.willChange ( ) [inline, inherited]

Informes that a figure is about to change something that affects the contents of its display box.

See also:
Figure::willChange

Definition at line 258 of file AbstractFigure.java.

                             {
        invalidate();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.standard.CompositeFigure.write ( StorableOutput  dw) [inline]

Writes the contained figures to the StorableOutput.

Reimplemented from CH.ifa.draw.standard.AbstractFigure.

Definition at line 386 of file CompositeFigure.java.

                                         {
        super.write(dw);
        dw.writeInt(fFigures.size());
        Enumeration k = fFigures.elements();
        while (k.hasMoreElements())
            dw.writeStorable((Storable) k.nextElement());
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 42 of file CompositeFigure.java.

Font CH.ifa.draw.standard.AbstractFigure.dialogFont = Font.decode("dialog-PLAIN-12") [static, protected, inherited]

Definition at line 56 of file AbstractFigure.java.

The figures that this figure is composed of.

See also:
add
remove

Definition at line 36 of file CompositeFigure.java.

final long CH.ifa.draw.standard.CompositeFigure.serialVersionUID = 7408153435700021866L [static, private]

Reimplemented from CH.ifa.draw.standard.AbstractFigure.

Reimplemented in CH.ifa.draw.standard.StandardDrawing.

Definition at line 41 of file CompositeFigure.java.


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