public class GroupBoxBorder extends AbstractLabeledBorder
tempRect
Constructor and Description |
---|
GroupBoxBorder()
Constructs a GroupBoxBorder with the name of this class as its label.
|
GroupBoxBorder(java.lang.String s)
Constructs a GroupBoxBorder with label s.
|
Modifier and Type | Method and Description |
---|---|
protected Insets |
calculateInsets(IFigure figure)
Calculates and returns the Insets for this GroupBoxBorder.
|
Dimension |
getPreferredSize(IFigure fig)
Returns the preferred width and height that this border would like to
display itself properly.
|
void |
paint(IFigure figure,
Graphics g,
Insets insets)
Paints the border.
|
getFont, getInsets, getLabel, getTextColor, getTextExtents, invalidate, setFont, setLabel, setTextColor
getPaintRectangle, isOpaque
public GroupBoxBorder()
public GroupBoxBorder(java.lang.String s)
s
- the labelprotected Insets calculateInsets(IFigure figure)
calculateInsets
in class AbstractLabeledBorder
figure
- IFigure on which the calculations should be made. Generally
this is the IFigure of which this GroupBoxBorder is
surrounding.public Dimension getPreferredSize(IFigure fig)
Border
getPreferredSize
in interface Border
getPreferredSize
in class AbstractLabeledBorder
fig
- The figureBorder.getPreferredSize(IFigure)
public 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 insetsBorder.paint(IFigure, Graphics, Insets)
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.