Draw2D v2.0

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

public abstract class AbstractLabeledBorder
extends AbstractBorder
implements LabeledBorder

Provides support for a border with a label describing the contents of which it is surronding.


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)
           
protected  Font getFont(IFigure f)
           
 Insets getInsets(IFigure fig)
          Returns the Insets for this Border for the given Figure.
 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()
           
 void setFont(Font font)
          Sets the font for the label.
 void setLabel(String s)
          Sets the label.
 void setTextColor(Color color)
          Sets the color for this border's text.
 
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
 
Methods inherited from interface org.eclipse.draw2d.Border
isOpaque, paint
 

Constructor Detail

AbstractLabeledBorder

public AbstractLabeledBorder()
Constructs a default AbstractLabeledBorder with the name of this class set as its label.
Since:
2.0

AbstractLabeledBorder

public AbstractLabeledBorder(String s)
Constructs 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 Detail

calculateInsets

protected abstract Insets calculateInsets(IFigure figure)

getFont

protected Font getFont(IFigure f)

getInsets

public Insets getInsets(IFigure fig)
Description copied from interface: Border
Returns the Insets for this Border for the given Figure.
Specified by:
getInsets in interface Border

getLabel

public String getLabel()
Description copied from interface: LabeledBorder
Returns the label for this border.
Specified by:
getLabel in interface LabeledBorder

getPreferredSize

public Dimension getPreferredSize(IFigure fig)
Description copied from interface: Border
Returns the preferred width and height that this border would like to display itself properly.
Specified by:
getPreferredSize in interface Border
Overrides:
getPreferredSize in class AbstractBorder

getTextColor

public Color getTextColor()
Returns the text Color of this AbstractLabeledBorder's label.
Since:
2.0

getTextExtents

protected Dimension getTextExtents(IFigure f)
Calculates 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

invalidate

protected void invalidate()

setFont

public void setFont(Font font)
Description copied from interface: LabeledBorder
Sets the font for the label.
Specified by:
setFont in interface LabeledBorder

setLabel

public void setLabel(String s)
Description copied from interface: LabeledBorder
Sets the label.
Specified by:
setLabel in interface LabeledBorder

setTextColor

public void setTextColor(Color color)
Sets the color for this border's text.
Parameters:
color - Color to be set for this border's text.
Since:
2.0

Draw2D v2.0