org.eclipse.draw2d
Class MarginBorder
java.lang.Object
|
+--org.eclipse.draw2d.AbstractBorder
|
+--org.eclipse.draw2d.MarginBorder
- All Implemented Interfaces:
- Border
- public class MarginBorder
- extends AbstractBorder
A border that provides blank padding.
|
Constructor Summary |
MarginBorder(Insets insets)
Constructs a MarginBorder with dimensions specified
by insets. |
MarginBorder(int allsides)
Constructs a MarginBorder with equal padding on all sides. |
MarginBorder(int t,
int l,
int b,
int r)
Constructs a MarginBorder with padding specified
by the passed values. |
|
Method Summary |
Insets |
getInsets(IFigure figure)
Returns the Insets for this Border for the given Figure. |
boolean |
isOpaque()
Returns true if the Border completely fills the region defined
above in paint. |
void |
paint(IFigure figure,
Graphics graphics,
Insets insets)
paint the Border. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
insets
protected Insets insets
MarginBorder
public MarginBorder(Insets insets)
- Constructs a MarginBorder with dimensions specified
by insets.
- Parameters:
insets - Insets for the border.- Since:
- 2.0
MarginBorder
public MarginBorder(int t,
int l,
int b,
int r)
- Constructs a MarginBorder with padding specified
by the passed values.
- Parameters:
t - Top paddingl - Left paddingb - Bottom paddingt - Top padding- Since:
- 2.0
MarginBorder
public MarginBorder(int allsides)
- Constructs a MarginBorder with equal padding on all sides.
- Parameters:
allsides - Padding size for all sides of the border.- Since:
- 2.0
getInsets
public Insets getInsets(IFigure figure)
- Description copied from interface:
Border
- Returns the Insets for this Border for the given Figure.
isOpaque
public boolean isOpaque()
- Description copied from interface:
Border
- Returns true if the Border completely fills the region defined
above in paint.
paint
public void paint(IFigure figure,
Graphics graphics,
Insets insets)
- Description copied from interface:
Border
- paint the Border. The border should paint inside figure's
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(x,y);