Package org.eclipse.draw2d
Class TitleBarBorder
java.lang.Object
org.eclipse.draw2d.AbstractBorder
org.eclipse.draw2d.AbstractLabeledBorder
org.eclipse.draw2d.TitleBarBorder
- All Implemented Interfaces:
- Border,- LabeledBorder
Border provides a title bar on the Figure for which this is the border of.
 Generally used in conjunction with other borders to create window-like
 effects. Also provides for alignment of the text in the bar.
- See Also:
- 
Field SummaryFields inherited from class org.eclipse.draw2d.AbstractBordertempRect
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a TitleBarBorder with its label set to the name of this class.Constructs a TitleBarBorder with its label set to the passed String.
- 
Method SummaryModifier and TypeMethodDescriptionprotected InsetscalculateInsets(IFigure figure) Calculates and returns the Insets for this border.protected ColorReturns the background Color of this TitleBarBorder.protected InsetsReturns this TitleBarBorder's padding.getPreferredSize(IFigure fig) Overwritten to handle padding appropriately.intReturns the alignment of the text in the title bar.booleanisOpaque()Returnstruethereby filling up all the contents within its boundaries, eleminating the need by the figure to clip the boundaries and do the same.voidPaints the border.voidsetBackgroundColor(Color color) Sets the background color of the area within the boundaries of this border.voidsetPadding(int all) Sets the padding space to be applied on all sides of the border.voidsetPadding(Insets pad) Sets the padding space of this TitleBarBorder to the passed value.voidsetTextAlignment(int align) Sets the alignment of the text in the title bar.Methods inherited from class org.eclipse.draw2d.AbstractLabeledBordergetFont, getInsets, getLabel, getTextColor, getTextExtents, invalidate, setFont, setLabel, setTextColorMethods inherited from class org.eclipse.draw2d.AbstractBordergetPaintRectangle
- 
Constructor Details- 
TitleBarBorderpublic TitleBarBorder()Constructs a TitleBarBorder with its label set to the name of this class.- Since:
- 2.0
 
- 
TitleBarBorderConstructs a TitleBarBorder with its label set to the passed String.- Parameters:
- s- text of the label
- Since:
- 2.0
 
 
- 
- 
Method Details- 
calculateInsetsCalculates and returns the Insets for this border.- Specified by:
- calculateInsetsin class- AbstractLabeledBorder
- Parameters:
- figure- the figure on which Insets calculations are based
- Returns:
- the calculated Insets
- Since:
- 2.0
 
- 
getBackgroundColorReturns the background Color of this TitleBarBorder.- Returns:
- the background color
- Since:
- 2.0
 
- 
getPaddingReturns this TitleBarBorder's padding. Padding provides spacing along the sides of the TitleBarBorder. The default value is no padding along all sides.- Returns:
- the Insets representing the space along the sides of the TitleBarBorder
- Since:
- 2.0
 
- 
getPreferredSizeOverwritten to handle padding appropriately.- Specified by:
- getPreferredSizein interface- Border
- Overrides:
- getPreferredSizein class- AbstractLabeledBorder
- Parameters:
- fig- The figure
- Returns:
- The preferred size
- See Also:
 
- 
getTextAlignmentpublic int getTextAlignment()Returns the alignment of the text in the title bar. Possible values arePositionConstants.LEFT,PositionConstants.CENTERandPositionConstants.RIGHT.- Returns:
- the text alignment
- Since:
- 2.0
 
- 
isOpaquepublic boolean isOpaque()Returnstruethereby filling up all the contents within its boundaries, eleminating the need by the figure to clip the boundaries and do the same.- Specified by:
- isOpaquein interface- Border
- Overrides:
- isOpaquein class- AbstractBorder
- Returns:
- trueif this border is opaque
- See Also:
 
- 
paintDescription copied from interface:BorderPaints the border. The border should paint inside figure'sIFigure.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 asRectangle.contains(int, int).- Parameters:
- figure- The figure this border belongs to
- g- The graphics object used for painting
- insets- The insets
- See Also:
 
- 
setBackgroundColorSets the background color of the area within the boundaries of this border. This is required as this border takes responsibility for filling up the region, as TitleBarBorders are always opaque.- Parameters:
- color- the background color
- Since:
- 2.0
 
- 
setPaddingpublic void setPadding(int all) Sets the padding space to be applied on all sides of the border. The default value is no padding on all sides.- Parameters:
- all- the value of the padding on all sides
- Since:
- 2.0
 
- 
setPaddingSets the padding space of this TitleBarBorder to the passed value. The default value is no padding on all sides.- Parameters:
- pad- the padding
- Since:
- 2.0
 
- 
setTextAlignmentpublic void setTextAlignment(int align) Sets the alignment of the text in the title bar. Possible values arePositionConstants.LEFT,PositionConstants.CENTERandPositionConstants.RIGHT.- Parameters:
- align- the new text alignment
- Since:
- 2.0
 
 
-