Package org.eclipse.draw2d
Class AbstractLabeledBorder
java.lang.Object
org.eclipse.draw2d.AbstractBorder
org.eclipse.draw2d.AbstractLabeledBorder
- All Implemented Interfaces:
- Border,- LabeledBorder
- Direct Known Subclasses:
- GroupBoxBorder,- TitleBarBorder
Provides support for a border with a label describing the contents of which
 it is surrounding.
- 
Field SummaryFields inherited from class org.eclipse.draw2d.AbstractBordertempRect
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a default AbstractLabeledBorder with the name of this class set as its label.Constructs a border with the label set to the String passed in as input.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract InsetscalculateInsets(IFigure figure) Calculates insets based on the current font and other attributes.protected FontReturns the font that this border will use.Returns the insets, or space associated for this border.getLabel()Returns the label for this Border.getPreferredSize(IFigure fig) Returns the preferred width and height that this border would like to display itself properly.Returns the text Color of this AbstractLabeledBorder's label.protected DimensionCalculates and returns the size required by this border's label.protected voidResets the internal values and state so that they can be recalculated.voidSets the Font of this border to the input value, and invalidates the border forcing an update of internal parameters of insets and text extents.voidSets the text to be displayed as the label for this Border.voidsetTextColor(Color color) Sets the color for this border's text.Methods inherited from class org.eclipse.draw2d.AbstractBordergetPaintRectangle, isOpaque
- 
Constructor Details- 
AbstractLabeledBorderpublic AbstractLabeledBorder()Constructs a default AbstractLabeledBorder with the name of this class set as its label.- Since:
- 2.0
 
- 
AbstractLabeledBorderConstructs a border with the label set to the String passed in as input.- Parameters:
- s- Label to be set on the border
- Since:
- 2.0
 
 
- 
- 
Method Details- 
calculateInsetsCalculates insets based on the current font and other attributes. This value will be cached untilinvalidate()is called.- Parameters:
- figure- The figure to which the border is being applied
- Returns:
- The Insets
 
- 
getFontReturns the font that this border will use. If no Font has been specified, the font associated with the input Figure will be used.- Parameters:
- f- Figure used to get a default font
- Returns:
- The font for this border
 
- 
getInsetsReturns the insets, or space associated for this border. Returns any previously set value if present, else calculates it from the Figure provided in as input.
- 
getLabelDescription copied from interface:LabeledBorderReturns the label for this Border.- Specified by:
- getLabelin interface- LabeledBorder
- Returns:
- The label for this Border
- See Also:
 
- 
getPreferredSizeDescription copied from interface:BorderReturns the preferred width and height that this border would like to display itself properly.- Specified by:
- getPreferredSizein interface- Border
- Overrides:
- getPreferredSizein class- AbstractBorder
- Parameters:
- fig- The figure
- Returns:
- The preferred size
- See Also:
 
- 
getTextColorReturns the text Color of this AbstractLabeledBorder's label.- Returns:
- The text color
- Since:
- 2.0
 
- 
getTextExtentsCalculates and returns the size required by this border's label.- Parameters:
- f- IFigure on which the calculations are to be made
- Returns:
- Dimensions required by the text of this border's label
- Since:
- 2.0
 
- 
invalidateprotected void invalidate()Resets the internal values and state so that they can be recalculated. Called whenever a state change has occurred that effects the insets or text extents of this border.
- 
setFontSets the Font of this border to the input value, and invalidates the border forcing an update of internal parameters of insets and text extents.- Specified by:
- setFontin interface- LabeledBorder
- Parameters:
- font- The font
 
- 
setLabelDescription copied from interface:LabeledBorderSets the text to be displayed as the label for this Border.- Specified by:
- setLabelin interface- LabeledBorder
- Parameters:
- s- The text
- See Also:
 
- 
setTextColorSets the color for this border's text.- Parameters:
- color- Color to be set for this border's text
- Since:
- 2.0
 
 
-