org.objectweb.fractal.gui.graph.view
Interface ComponentRenderer

All Known Implementing Classes:
BasicComponentRenderer

public interface ComponentRenderer

A component that draws components. This component only draws single components, i.e. does not draw the sub components of a component, nor the internal or external bingings of components.


Field Summary
static int INSTANCE
          The flags corresponding to a component whit instances no started
static int NO_INSTANCE
          The flags corresponding to a component whitout instances.
static int STARTED
          The flags corresponding to a component whit instances started
static int STOPPED
          The flags corresponding to a component whit instances started then stopped
 
Method Summary
 void drawComponent(java.awt.Graphics g, Component c, Selection s, java.awt.Rectangle r, java.awt.Color color, boolean expanded, int m, int state)
          Draws the given component in the given rectangle.
 ComponentPart getComponentPart(Component c, java.awt.Rectangle r, boolean expanded, int x, int y)
          Returns the part of the given component that corresponds to the given point.
 java.awt.Point getInterfacePosition(Component c, java.awt.Rectangle r, Interface i)
          Returns the position of the given interface.
 java.awt.Rectangle getSubComponentArea(Component c, java.awt.Rectangle r)
          Returns the area of the given component into which its sub components must be drawn.
 

Field Detail

NO_INSTANCE

public static final int NO_INSTANCE
The flags corresponding to a component whitout instances.

See Also:
Constant Field Values

INSTANCE

public static final int INSTANCE
The flags corresponding to a component whit instances no started

See Also:
Constant Field Values

STARTED

public static final int STARTED
The flags corresponding to a component whit instances started

See Also:
Constant Field Values

STOPPED

public static final int STOPPED
The flags corresponding to a component whit instances started then stopped

See Also:
Constant Field Values
Method Detail

drawComponent

public void drawComponent(java.awt.Graphics g,
                          Component c,
                          Selection s,
                          java.awt.Rectangle r,
                          java.awt.Color color,
                          boolean expanded,
                          int m,
                          int state)
Draws the given component in the given rectangle.

Parameters:
g - the graphics to be used to draw the component.
c - the component to be drawn.
s - the selected component.
r - where the component must be drawn.
color - the component color.
expanded - if the component is exanded or not, i.e., if its sub components will be drawn (with other calls to this method) also or not.
m - the displaying mode for interface name.
state - the status for component (either STARTED or STOPPED).

getComponentPart

public ComponentPart getComponentPart(Component c,
                                      java.awt.Rectangle r,
                                      boolean expanded,
                                      int x,
                                      int y)
Returns the part of the given component that corresponds to the given point.

Parameters:
c - a component.
r - where the component is drawn.
expanded - if the component is exanded or not, i.e., if its sub components will be drawn also or not.
x - the x coordinate of the point of interest.
y - the y coordinate of the point of interest.
Returns:
the part of the given component that corresponds to the given point, or null if the given point does not correspond to any part of the given component.

getInterfacePosition

public java.awt.Point getInterfacePosition(Component c,
                                           java.awt.Rectangle r,
                                           Interface i)
Returns the position of the given interface.

Parameters:
c - a component.
r - where the component is drawn.
i - the interface whose position must be returned.
Returns:
the position of the given interface.

getSubComponentArea

public java.awt.Rectangle getSubComponentArea(Component c,
                                              java.awt.Rectangle r)
Returns the area of the given component into which its sub components must be drawn.

Parameters:
c - a component.
r - where the component is drawn.
Returns:
the area of the given component into which its sub components must be drawn.