|
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 | +--org.eclipse.draw2d.TitleBarBorder
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.
FrameBorder
Field Summary |
Fields inherited from class org.eclipse.draw2d.AbstractBorder |
tempRect |
Constructor Summary | |
TitleBarBorder()
Constructs a TitleBarBorder with its label set to the name of this class. |
|
TitleBarBorder(String s)
Constructs a TitleBarBorder with its label set to the passed String. |
Method Summary | |
protected Insets |
calculateInsets(IFigure figure)
Calculates and returns the Insets for this border. |
protected Color |
getBackgroundColor()
Returns the background Color of this TitleBarBorder. |
protected Insets |
getPadding()
Returns this TitleBarBorder's padding. |
int |
getTextAlignment()
Returns the alignment of the text in the title bar. |
boolean |
isOpaque()
Returns true if the Border completely fills the region defined in
paint(IFigure, Graphics, Insets) . |
void |
paint(IFigure figure,
Graphics g,
Insets insets)
Paints the border. |
void |
setBackgroundColor(Color color)
Sets the background color of the area within the boundaries of this border. |
void |
setPadding(Insets pad)
Sets the padding space of this TitleBarBorder to the passed value. |
void |
setPadding(int all)
Sets the padding space to be applied on all sides of the border. |
void |
setTextAlignment(int align)
Sets the alignment of the text in the title bar. |
Methods inherited from class org.eclipse.draw2d.AbstractLabeledBorder |
getFont, getInsets, getLabel, getPreferredSize, getTextColor, getTextExtents, invalidate, setFont, setLabel, setTextColor |
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 |
Constructor Detail |
public TitleBarBorder()
public TitleBarBorder(String s)
s
- Text of the label.Method Detail |
protected Insets calculateInsets(IFigure figure)
calculateInsets
in class AbstractLabeledBorder
figure
- Figure on which Insets calculations are
based.
protected Color getBackgroundColor()
protected Insets getPadding()
public int getTextAlignment()
PositionConstants
interface.
PositionConstants
,
setTextAlignment(int)
public boolean isOpaque()
Border
true
if the Border completely fills the region defined in
Border.paint(IFigure, Graphics, Insets)
.
isOpaque
in interface Border
isOpaque
in class AbstractBorder
true
if this border is opaquepublic void paint(IFigure figure, Graphics g, Insets insets)
Border
IFigure.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(int, int)
.
figure
- The figure this border belongs tog
- The graphics object used for paintinginsets
- The insetspublic void setBackgroundColor(Color color)
color
- Color of the backround.isOpaque()
public void setPadding(int all)
all
- Value of the padding on all sides.public void setPadding(Insets pad)
pad
- Specific values of padding set to specific
sides.public void setTextAlignment(int align)
PositionConstants
interface.
align
- Value of the alignment.PositionConstants
,
getTextAlignment()
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |