Back to index

moin  1.9.0~rc2
Public Member Functions
CH.ifa.draw.framework.Figure Interface Reference

The interface of a graphical figure. More...

Inheritance diagram for CH.ifa.draw.framework.Figure:
Inheritance graph
[legend]
Collaboration diagram for CH.ifa.draw.framework.Figure:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void moveBy (int dx, int dy)
 Moves the Figure to a new location.
void basicDisplayBox (Point origin, Point corner)
 Changes the display box of a figure.
void displayBox (Point origin, Point corner)
 Changes the display box of a figure.
Rectangle displayBox ()
 Gets the display box of a figure.
void draw (Graphics g, boolean showGuides)
 Draws the figure.
Vector handles ()
 Returns the handles used to manipulate the figure.
Dimension size ()
 Gets the size of the figure.
Point center ()
 Gets the figure's center.
boolean isEmpty ()
 Checks if the Figure should be considered as empty.
FigureEnumeration figures ()
 Returns an Enumeration of the figures contained in this figure.
Figure findFigureInside (int x, int y)
 Returns the figure that contains the given point.
boolean containsPoint (int x, int y)
 Checks if a point is inside the figure.
Object clone ()
 Returns a Clone of this figure.
void displayBox (Rectangle r)
 Changes the display box of a figure.
boolean includes (Figure figure)
 Checks whether the given figure is contained in this 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.
FigureChangeListener listener ()
 Gets the Figure's listeners.
void addFigureChangeListener (FigureChangeListener l)
 Adds a listener for this figure.
void removeFigureChangeListener (FigureChangeListener l)
 Removes a listener for this figure.
void release ()
 Releases a figure's resources.
void invalidate ()
 Invalidates the figure.
void willChange ()
 Informes that a figure is about to change such that its display box is affected.
void changed ()
 Informes that a figure has changed its display box.
boolean canConnect ()
 Checks if this figure can be connected.
Connector connectorAt (int x, int y)
 Gets a connector for this figure at the given location.
void connectorVisibility (boolean isVisible)
 Sets whether the connectors should be visible.
Insets connectionInsets ()
 Returns the connection inset.
Locator connectedTextLocator (Figure text)
 Returns the locator used to located connected text.
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.
void write (StorableOutput dw)
 Writes the object to the StorableOutput.
String getMap ()
 Writes a map image of the object.
void read (StorableInput dr) throws IOException
 Reads the object from the StorableInput.

Detailed Description

The interface of a graphical figure.

A figure knows its display box and can draw itself. A figure can be composed of several figures. To interact and manipulate with a figure it can provide Handles and Connectors.

A figure has a set of handles to manipulate its shape or attributes. A figure has one or more connectors that define how to locate a connection point.

Figures can have an open ended set of attributes. An attribute is identified by a string.

Default implementations for the Figure interface are provided by AbstractFigure.

See also:
Handle
Connector
AbstractFigure

Definition at line 31 of file Figure.java.


Member Function Documentation

Adds a listener for this figure.

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.

void CH.ifa.draw.framework.Figure.basicDisplayBox ( Point  origin,
Point  corner 
)

Changes the display box of a figure.

This method is always implemented in figure subclasses. It only changes the displaybox and does not announce any changes. It is usually not called by the client. Clients typically call displayBox to change the display box.

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

Checks if this figure can be connected.

Gets the figure's center.

Informes that a figure has changed its display box.

This method also triggers an update call for its registered observers.

See also:
invalidate
willChange

Returns a Clone of this figure.

Returns the locator used to located connected text.

Returns the connection inset.

This is only a hint that connectors can use to determine the connection location. The inset defines the area where the display box of a figure should not be connected.

Gets a connector for this figure at the given location.

A figure can have different connectors at different locations.

Sets whether the connectors should be visible.

Connectors can be optionally visible. Implement this method and react on isVisible to turn the connectors on or off.

boolean CH.ifa.draw.framework.Figure.containsPoint ( int  x,
int  y 
)

Checks if a point is inside the figure.

Decomposes a figure into its parts.

A figure is considered as a part of itself.

void CH.ifa.draw.framework.Figure.displayBox ( Point  origin,
Point  corner 
)

Changes the display box of a figure.

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

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

Gets the display box of a figure.

See also:
basicDisplayBox

Changes the display box of a figure.

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

See also:
displayBox
void CH.ifa.draw.framework.Figure.draw ( Graphics  g,
boolean  showGuides 
)

Draws the figure.

Parameters:
gthe Graphics to draw into

Returns an Enumeration of the figures contained in this figure.

Returns the figure that contains the given point.

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

All figures support the attribute names FillColor and FrameColor

String CH.ifa.draw.util.Storable.getMap ( ) [inherited]

Writes a map image of the object.

Implemented in CH.ifa.draw.figures.ArrowTip.

Returns the handles used to manipulate the figure.

Handles is a Factory Method for creating handle objects.

Returns:
a Vector of handles
See also:
Handle

Checks whether the given figure is contained in this figure.

Invalidates the figure.

This method informs its listeners that its current display box is invalid and should be refreshed.

Checks if the Figure should be considered as empty.

Gets the Figure's listeners.

void CH.ifa.draw.framework.Figure.moveBy ( int  dx,
int  dy 
)

Moves the Figure to a new location.

Parameters:
xthe x delta
ythe y delta
void CH.ifa.draw.util.Storable.read ( StorableInput  dr) throws IOException [inherited]

Reads the object from the StorableInput.

Here is the caller graph for this function:

Releases a figure's resources.

Release is called when a figure is removed from a drawing. Informs the listeners that the figure is removed by calling figureRemoved.

Here is the caller graph for this function:

Removes a listener for this figure.

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

void CH.ifa.draw.framework.Figure.setAttribute ( String  name,
Object  value 
)

Sets the named attribute to the new value.

Gets the size of the figure.

Informes that a figure is about to change such that its display box is affected.

Here is an example of how it is used together with changed()

 public void move(int x, int y) {
      willChange();
      // change the figure's location
      changed();
  }
 
See also:
invalidate
changed

Writes the object to the StorableOutput.

Here is the caller graph for this function:


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