|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectweb.fractal.gui.graph.view.BasicComponentRenderer
Basic implementation of the ComponentRenderer interface. This
implementation draws components as illustrated in the figure below.

| Field Summary |
| Fields inherited from interface org.objectweb.fractal.gui.Constants |
BINDING_COLOR, BOLD_STROKE, COMPONENT_COLOR, DASHED_STROKE, ERROR_COLOR, NAME_FONT, NORMAL_STROKE, PROVIDED_COLOR, PROVIDED_FONT, REQUIRED_COLOR, REQUIRED_FONT, SELECTION_COLOR, WARNING_COLOR |
| Constructor Summary | |
BasicComponentRenderer()
Constructs a new BasicComponentRenderer component. |
|
| Method Summary | |
void |
drawComponent(Graphics g,
Component c,
Selection s,
Rectangle r,
Color color,
boolean expanded,
int mode)
Draws the given component in the given rectangle. |
protected void |
drawString(Graphics g,
String s,
int x,
int y,
int dx,
int dy,
int insets,
boolean left)
Draws a string in the given rectangle. |
ComponentPart |
getComponentPart(Component c,
Rectangle r,
boolean expanded,
int x0,
int y0)
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. |
protected void |
initialize(Component c,
Rectangle r)
Prepares this component to draw the given component. |
protected int |
isBorder(int x,
int y,
int w,
int h,
int x0,
int y0)
Returns the border of the given rectangle to which the given point corresponds. |
protected int |
isCorner(int x,
int y,
int w,
int h,
int x0,
int y0)
Returns the corner of the given rectangle to which the given point corresponds. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BasicComponentRenderer()
BasicComponentRenderer component.
| Method Detail |
public void drawComponent(Graphics g,
Component c,
Selection s,
Rectangle r,
Color color,
boolean expanded,
int mode)
ComponentRenderer
drawComponent in interface ComponentRendererg - 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.mode - the displaying mode for interface name.
public ComponentPart getComponentPart(Component c,
Rectangle r,
boolean expanded,
int x0,
int y0)
ComponentRenderer
getComponentPart in interface ComponentRendererc - 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.x0 - the x coordinate of the point of interest.y0 - the y coordinate of the point of interest.
public Point getInterfacePosition(Component c,
Rectangle r,
Interface i)
ComponentRenderer
getInterfacePosition in interface ComponentRendererc - a component.r - where the component is drawn.i - the interface whose position must be returned.
public Rectangle getSubComponentArea(Component c,
Rectangle r)
ComponentRenderer
getSubComponentArea in interface ComponentRendererc - a component.r - where the component is drawn.
protected void initialize(Component c,
Rectangle r)
c - the component that will be drawn.r - where the component will be drawn.
protected void drawString(Graphics g,
String s,
int x,
int y,
int dx,
int dy,
int insets,
boolean left)
g - the graphics to be used to draw the string.s - the string to be drawn.x - left border of the rectangle where s must be drawn.y - top border of the rectangle where s must be drawn.dx - w of the rectangle where s must be drawn.dy - h of the rectangle where s must be drawn.insets - horizontal insets to be removed from (x,y,dx,dy).left - if the string must drawn left justified or right justified.
protected int isCorner(int x,
int y,
int w,
int h,
int x0,
int y0)
x - left border of the rectangle.y - top border of the rectangle.w - w of the rectangle.h - h of the rectangle.x0 - x coordinate of the point.y0 - y coordinate of the point.
protected int isBorder(int x,
int y,
int w,
int h,
int x0,
int y0)
x - left border of the rectangle.y - top border of the rectangle.w - w of the rectangle.h - h of the rectangle.x0 - x coordinate of the point.y0 - y coordinate of the point.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||