|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.draw2d.AbstractBorder | +--org.eclipse.draw2d.CompoundBorder
CompoundBorder allows for the nesting of two borders. The nested borders are referred to as the inner and outer borders.
Field Summary | |
protected Border |
inner
The inner Border. |
protected Border |
outer
The outer Border. |
Fields inherited from class org.eclipse.draw2d.AbstractBorder |
tempRect |
Constructor Summary | |
CompoundBorder()
Constructs a default CompoundBorder with no borders under it. |
|
CompoundBorder(Border outer,
Border inner)
Constructs a CompoundBorder with the two borders specified as input. |
Method Summary | |
Border |
getInnerBorder()
Returns the inner border of this CompoundBorder. |
Insets |
getInsets(IFigure figure)
Returns the total insets required to hold both the inner and outer borders of this CompoundBorder. |
Border |
getOuterBorder()
Returns the outer border of this CompoundBorder. |
Dimension |
getPreferredSize(IFigure fig)
Returns the preferred width and height that this border would like to display itself properly. |
boolean |
isOpaque()
Returns true if this border is opaque. |
void |
paint(IFigure figure,
Graphics g,
Insets insets)
Paints the border. |
Methods inherited from class org.eclipse.draw2d.AbstractBorder |
getPaintRectangle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Border inner
protected Border outer
Constructor Detail |
public CompoundBorder()
public CompoundBorder(Border outer, Border inner)
outer
- Border which is drawn on the outsideinner
- Border which is drawn inside the outer borderMethod Detail |
public Border getInnerBorder()
public Insets getInsets(IFigure figure)
figure
- Figure for which this is the border
public Dimension getPreferredSize(IFigure fig)
Border
getPreferredSize
in interface Border
getPreferredSize
in class AbstractBorder
Border.getPreferredSize(IFigure)
public Border getOuterBorder()
public boolean isOpaque()
true
if this border is opaque. Return value is dependent on the
opaque state of both the borders it contains. Both borders have to be opaque for this
border to be opaque. In the absence of any of the borders, this border is not opaque.
isOpaque
in interface Border
isOpaque
in class AbstractBorder
true
if this border is opaqueBorder.isOpaque()
public void paint(IFigure figure, Graphics g, Insets insets)
Border
IFigure.getBounds()
,
inset by the parameter insets. The border generally should not paint inside its
own insets. More specifically, Border b should paint inside the rectangle:
figure.getBounds().getCropped(insets) and outside of the rectangle:
figure.getBounds().getCropped(insets).getCropped(getInsets()) where inside is
defined as Rectangle.contains(int, int)
.
figure
- The figure this border belongs tog
- The graphics object used for paintinginsets
- The insetsBorder.paint(IFigure, Graphics, Insets)
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |