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.


Method Summary
 void drawComponent(Graphics g, Component c, Selection s, Rectangle r, Color color, boolean expanded, int m)
          Draws the given component in the given rectangle.
 ComponentPart getComponentPart(Component c, Rectangle r, boolean expanded, int x, int y)
          Returns the part of the given component that corresponds to the given point.
 Point getInterfacePosition(Component c, Rectangle r, Interface i)
          Returns the position of the given interface.
 Rectangle getSubComponentArea(Component c, Rectangle r)
          Returns the area of the given component into which its sub components must be drawn.
 

Method Detail

drawComponent

public void drawComponent(Graphics g,
                          Component c,
                          Selection s,
                          Rectangle r,
                          Color color,
                          boolean expanded,
                          int m)
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.

getComponentPart

public ComponentPart getComponentPart(Component c,
                                      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 Point getInterfacePosition(Component c,
                                  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 Rectangle getSubComponentArea(Component c,
                                     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.