|
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.AbstractLabeledBorder
Provides support for a border with a label describing the contents of which it is surrounding.
Field Summary |
Fields inherited from class org.eclipse.draw2d.AbstractBorder |
tempRect |
Constructor Summary | |
AbstractLabeledBorder()
Constructs a default AbstractLabeledBorder with the name of this class set as its label. |
|
AbstractLabeledBorder(String s)
Constructs a border with the label set to the String passed in as input. |
Method Summary | |
protected abstract Insets |
calculateInsets(IFigure figure)
Calculates insets based on the current font and other attributes. |
protected Font |
getFont(IFigure f)
Returns the font that this border will use. |
Insets |
getInsets(IFigure fig)
Returns the insets, or space associated for this border. |
String |
getLabel()
Returns the label for this Border. |
Dimension |
getPreferredSize(IFigure fig)
Returns the preferred width and height that this border would like to display itself properly. |
Color |
getTextColor()
Returns the text Color of this AbstractLabeledBorder's label. |
protected Dimension |
getTextExtents(IFigure f)
Calculates and returns the size required by this border's label. |
protected void |
invalidate()
Resets the internal values and state so that they can be recalculated. |
void |
setFont(Font font)
Sets the Font of this border to the input value, and invalidates the border forcing an update of internal parameters of insets and text extents. |
void |
setLabel(String s)
Sets the text to be displayed as the label for this Border. |
void |
setTextColor(Color color)
Sets the color for this border's text. |
Methods inherited from class org.eclipse.draw2d.AbstractBorder |
getPaintRectangle, isOpaque |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.draw2d.Border |
isOpaque, paint |
Constructor Detail |
public AbstractLabeledBorder()
public AbstractLabeledBorder(String s)
s
- Label to be set on the borderMethod Detail |
protected abstract Insets calculateInsets(IFigure figure)
invalidate()
is called.
figure
- The figure to which the border is being applied
protected Font getFont(IFigure f)
f
- Figure used to get a default font
public Insets getInsets(IFigure fig)
getInsets
in interface Border
fig
- Figure used to calculate insets
public String getLabel()
LabeledBorder
getLabel
in interface LabeledBorder
LabeledBorder.getLabel()
public Dimension getPreferredSize(IFigure fig)
Border
getPreferredSize
in interface Border
getPreferredSize
in class AbstractBorder
fig
- The figure
Border.getPreferredSize(IFigure)
public Color getTextColor()
protected Dimension getTextExtents(IFigure f)
f
- IFigure on which the calculations are to be made
protected void invalidate()
public void setFont(Font font)
setFont
in interface LabeledBorder
font
- The fontpublic void setLabel(String s)
LabeledBorder
setLabel
in interface LabeledBorder
s
- The textLabeledBorder.setLabel(String)
public void setTextColor(Color color)
color
- Color to be set for this border's text
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |