All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Interface CH.ifa.draw.framework.Figure
  -  public interface interface Figure
  -  extends Storable, Cloneable, Serializable
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
   
  -   addFigureChangeListener(FigureChangeListener) addFigureChangeListener(FigureChangeListener)
-   Adds a listener for this figure.
  
-   addToContainer(FigureChangeListener) addToContainer(FigureChangeListener)
-   Sets the Figure's container and registers the container
 as a figure change listener.
  
-   basicDisplayBox(Point, Point) basicDisplayBox(Point, Point)
-   Changes the display box of a figure.
  
-   canConnect() canConnect()
-   Checks if this figure can be connected
  
-   center() center()
-   Gets the figure's center
  
-   changed() changed()
-   Informes that a figure has changed its display box.
  
-   clone() clone()
-   Returns a Clone of this figure
  
-   connectedTextLocator(Figure) connectedTextLocator(Figure)
-   Returns the locator used to located connected text.
  
-   connectionInsets() connectionInsets()
-   Returns the connection inset.
  
-   connectorAt(int, int) connectorAt(int, int)
-   Gets a connector for this figure at the given location.
  
-   connectorVisibility(boolean) connectorVisibility(boolean)
-   Sets whether the connectors should be visible.
  
-   containsPoint(int, int) containsPoint(int, int)
-   Checks if a point is inside the figure.
  
-   decompose() decompose()
-   Decomposes a figure into its parts.
  
-   displayBox() displayBox()
-   Gets the display box of a figure
 
  
-   displayBox(Point, Point) displayBox(Point, Point)
-   Changes the display box of a figure.
  
-   displayBox(Rectangle) displayBox(Rectangle)
-   Changes the display box of a figure.
  
-   draw(Graphics) draw(Graphics)
-   Draws the figure.
  
-   figures() figures()
-   Returns an Enumeration of the figures contained in this figure
  
-   findFigureInside(int, int) findFigureInside(int, int)
-   Returns the figure that contains the given point.
  
-   getAttribute(String) getAttribute(String)
-   Returns the named attribute or null if a
 a figure doesn't have an attribute.
  
-   handles() handles()
-   Returns the handles used to manipulate
 the figure.
  
-   includes(Figure) includes(Figure)
-   Checks whether the given figure is contained in this figure.
  
-   invalidate() invalidate()
-   Invalidates the figure.
  
-   isEmpty() isEmpty()
-   Checks if the Figure should be considered as empty.
  
-   listener() listener()
-   Gets the Figure's listeners.
  
-   moveBy(int, int) moveBy(int, int)
-   Moves the Figure to a new location.
  
-   release() release()
-   Releases a figure's resources.
  
-   removeFigureChangeListener(FigureChangeListener) removeFigureChangeListener(FigureChangeListener)
-   Removes a listener for this figure.
  
-   removeFromContainer(FigureChangeListener) removeFromContainer(FigureChangeListener)
-   Removes a figure from the given container and unregisters
 it as a change listener.
  
-   setAttribute(String, Object) setAttribute(String, Object)
-   Sets the named attribute to the new value
  
-   size() size()
-   Gets the size of the figure
  
-   willChange() willChange()
-   Informes that a figure is about to change such that its
 display box is affected.
   
 moveBy
moveBy
 public abstract void moveBy(int dx,
                             int dy)
  -  Moves the Figure to a new location.
   
- 
    -  Parameters:
    
-  x - the x delta
    -  y - the y delta
  
 
 basicDisplayBox
basicDisplayBox
 public abstract void 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:
    
-  origin - the new origin
    -  corner - the new corner
    
-  See Also:
    
-  displayBox
  
 
 displayBox
displayBox
 public abstract void 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:
    
-  origin - the new origin
    -  corner - the new corner
    
-  See Also:
    
-  displayBox
  
 
 displayBox
displayBox
 public abstract Rectangle displayBox()
  -  Gets the display box of a figure
   
- 
    -  See Also:
    
-  basicDisplayBox
  
 
 draw
draw
 public abstract void draw(Graphics g)
  -  Draws the figure.
   
- 
    -  Parameters:
    
-  g - the Graphics to draw into
  
 
 handles
handles
 public abstract Vector handles()
  -  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
  
 
 size
size
 public abstract Dimension size()
  -  Gets the size of the figure
 
 center
center
 public abstract Point center()
  -  Gets the figure's center
 
 isEmpty
isEmpty
 public abstract boolean isEmpty()
  -  Checks if the Figure should be considered as empty.
 
 figures
figures
 public abstract FigureEnumeration figures()
  -  Returns an Enumeration of the figures contained in this figure
 
 findFigureInside
findFigureInside
 public abstract Figure findFigureInside(int x,
                                         int y)
  -  Returns the figure that contains the given point.
 
 containsPoint
containsPoint
 public abstract boolean containsPoint(int x,
                                       int y)
  -  Checks if a point is inside the figure.
 
 clone
clone
 public abstract Object clone()
  -  Returns a Clone of this figure
   
- 
    -  Overrides:
    
-  clone in class Object
  
 
 displayBox
displayBox
 public abstract void displayBox(Rectangle r)
  -  Changes the display box of a figure. This is a
 convenience method. Implementors should only
 have to override basicDisplayBox
   
- 
    -  See Also:
    
-  displayBox
  
 
 includes
includes
 public abstract boolean includes(Figure figure)
  -  Checks whether the given figure is contained in this figure.
 
 decompose
decompose
 public abstract FigureEnumeration decompose()
  -  Decomposes a figure into its parts. A figure is considered
 as a part of itself.
 
 addToContainer
addToContainer
 public abstract void addToContainer(FigureChangeListener c)
  -  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.
 
 removeFromContainer
removeFromContainer
 public abstract void removeFromContainer(FigureChangeListener c)
  -  Removes a figure from the given container and unregisters
 it as a change listener.
 
 listener
listener
 public abstract FigureChangeListener listener()
  -  Gets the Figure's listeners.
 
 addFigureChangeListener
addFigureChangeListener
 public abstract void addFigureChangeListener(FigureChangeListener l)
  -  Adds a listener for this figure.
 
 removeFigureChangeListener
removeFigureChangeListener
 public abstract void removeFigureChangeListener(FigureChangeListener l)
  -  Removes a listener for this figure.
 
 release
release
 public abstract void release()
  -  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.
 
 invalidate
invalidate
 public abstract void invalidate()
  -  Invalidates the figure. This method informs its listeners
 that its current display box is invalid and should be
 refreshed.
 
 willChange
willChange
 public abstract void willChange()
  -  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
  
 
 changed
changed
 public abstract void changed()
  -  Informes that a figure has changed its display box.
 This method also triggers an update call for its
 registered observers.
   
- 
    -  See Also:
    
-  invalidate, willChange
  
 
 canConnect
canConnect
 public abstract boolean canConnect()
  -  Checks if this figure can be connected
 
 connectorAt
connectorAt
 public abstract Connector connectorAt(int x,
                                       int y)
  -  Gets a connector for this figure at the given location.
 A figure can have different connectors at different locations.
 
 connectorVisibility
connectorVisibility
 public abstract void connectorVisibility(boolean isVisible)
  -  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.
 
 connectionInsets
connectionInsets
 public abstract Insets connectionInsets()
  -  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.
 
 connectedTextLocator
connectedTextLocator
 public abstract Locator connectedTextLocator(Figure text)
  -  Returns the locator used to located connected text.
 
 getAttribute
getAttribute
 public abstract Object getAttribute(String name)
  -  Returns the named attribute or null if a
 a figure doesn't have an attribute.
 All figures support the attribute names
 FillColor and FrameColor
 
 setAttribute
setAttribute
 public abstract void setAttribute(String name,
                                   Object value)
  -  Sets the named attribute to the new value
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index