public class PrintCell extends Object implements PrintCellConstants, PointDrawable
Modifier and Type | Field and Description |
---|---|
static int |
AlwaysRecalculateSizes |
Color |
backGround |
Color |
borderColor |
int |
borderRect |
int |
borderStyle |
double |
borderThickness |
double |
bottomSpace |
int |
constraints |
PointFont |
font |
Color |
foreGround |
double |
height |
double |
leftSpace |
protected double |
maxHeight
Do not set this directly - use setMaximumSize() instead.
|
protected double |
maxWidth
Do not set this directly - use setMaximumSize() instead.
|
protected double |
minHeight
Do not set this directly - use setMinimumSize() instead.
|
protected double |
minWidth
Do not set this directly - use setMinimumSize() instead.
|
int |
modifiers |
String |
name |
PointGraphics |
pointGraphics |
protected double |
preferredHeight
Do not set this directly - use setPrefferedSize() instead.
|
protected double |
preferredWidth
Do not set this directly - use setPrefferedSize() instead.
|
static int |
RECT_INSET_BORDER |
static int |
RECT_SIDE_BOTTOM |
static int |
RECT_SIDE_FULL |
static int |
RECT_SIDE_FULL_AS_INDIVIDUAL_LINES
This must be used with the other RECT_SIDE_XXX values.
|
static int |
RECT_SIDE_LEFT |
static int |
RECT_SIDE_RIGHT |
static int |
RECT_SIDE_TOP |
double |
rightSpace |
double |
topSpace |
double |
width |
double |
x |
double |
y |
BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, LEFT, NORTH, NORTHEAST, NORTHWEST, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BORDER, TAG_FIXEDSIZE, TAG_INSETS, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PREFERREDSIZE, TAG_RECT, TAG_SPAN, TAG_TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
Constructor and Description |
---|
PrintCell() |
Modifier and Type | Method and Description |
---|---|
protected void |
calculateSizes()
Override this to calculate the preferred, minimum and maximum size of your control.
|
boolean |
contains(double x,
double y)
Returns true if the given x and y coordinate in the parent's
coordinate system is contained within this control.
|
boolean |
contains(PrintCell who)
See if this PrintCell contains the specified PrintCell.
|
void |
doBackground(PointGraphics g) |
void |
doBorder(PointGraphics g,
double penSize,
Color c,
int style,
boolean insetInCell,
int rectSides) |
void |
doPaint(PointGraphics g,
PointRect r)
This is the main method to override when doing custom Control painting.
|
void |
doPaintChildren(PointGraphics g,
PointRect where) |
void |
draw(PointGraphics pg,
PointRect area)
Calculate the best size Font so that this cell's text and all its children's text will
fit correctly into its space.
|
Iterator |
getAllDescendants(boolean backwards)
Get all the children for this Control and their children.
|
Iterator |
getAllSubControls()
Get all the sub-controls for this Control and their sub-controls.
|
Color |
getBackground() |
PointRect |
getCachedDim() |
StringList |
getCachedText() |
Iterator |
getChildren()
This returns an Iterator that goes forwards through the components which are physically
added to this Control - i.e. may be displayed within the Control.
|
Iterator |
getChildrenBackwards()
This returns an Iterator that goes backwards through the components which are physically
added to this Control - i.e. may be displayed within the Control.
|
PointRect |
getDim(PointRect pr) |
PointRect |
getExtent(PointRect pr) |
PointFont |
getFont() |
Color |
getForeground() |
PointRect |
getMaximumSize(PointRect dest) |
PointRect |
getMinimumSize(PointRect dest) |
PointRect |
getPreferredSize(PointRect dest) |
PointRect |
getRect(PointRect pr) |
double[] |
getSizes(double[] values)
This gets all of the control sizes.
|
Iterator |
getSubControls()
This returns an Iterator that goes forwards through the components
which are considered a sub-control of this Control, even though they
may not be a "child" of the control -
i.e. it may not have been added into the Control heirarchy.
|
Object |
getTag(int id,
Object defaultValue) |
void |
getText(StringList dest)
Place the text in a StringList.
|
PointRect |
getTextSize(PointFont f,
PointGraphics pm,
PointRect dest) |
boolean |
hasTag(int id) |
boolean |
isChildOf(PrintCell who) |
void |
make(PointGraphics ps) |
void |
modify(int switchOn,
int switchOff) |
protected void |
resizeTo(double w,
double h) |
PrintCell |
setCell(int val) |
PrintCell |
setControl(int val) |
PrintCell |
setFixedSize(double width,
double height) |
PrintCell |
setMaximumSize(double width,
double height) |
PrintCell |
setMinimumSize(double width,
double height) |
PrintCell |
setPreferredSize(double width,
double height) |
void |
setRect(double xx,
double yy,
double w,
double h) |
PrintCell |
setSpacing(double spacing) |
PrintCell |
setSpacing(double top,
double left,
double bottom,
double right) |
PrintCell |
setTag(int id,
Object value) |
PrintCell |
setTextSize(double width,
double height) |
void |
setup(PointGraphics pg,
PageFormat pf) |
public static final int AlwaysRecalculateSizes
public int modifiers
public String name
public int constraints
public double x
public double y
public double width
public double height
public double topSpace
public double bottomSpace
public double leftSpace
public double rightSpace
public PointFont font
public Color foreGround
public Color backGround
protected double preferredWidth
protected double preferredHeight
protected double minWidth
protected double minHeight
protected double maxWidth
protected double maxHeight
public PointGraphics pointGraphics
public static final int RECT_SIDE_TOP
public static final int RECT_SIDE_BOTTOM
public static final int RECT_SIDE_LEFT
public static final int RECT_SIDE_RIGHT
public static final int RECT_SIDE_FULL
public static final int RECT_INSET_BORDER
public static final int RECT_SIDE_FULL_AS_INDIVIDUAL_LINES
public int borderRect
public double borderThickness
public int borderStyle
public Color borderColor
public PrintCell setSpacing(double top, double left, double bottom, double right)
public PrintCell setSpacing(double spacing)
public PointFont getFont()
public Color getBackground()
public Color getForeground()
public void modify(int switchOn, int switchOff)
protected void resizeTo(double w, double h)
public void setRect(double xx, double yy, double w, double h)
public boolean hasTag(int id)
public PrintCell setControl(int val)
public PrintCell setCell(int val)
public PrintCell setFixedSize(double width, double height)
public PrintCell setPreferredSize(double width, double height)
public PrintCell setTextSize(double width, double height)
public PrintCell setMinimumSize(double width, double height)
public PrintCell setMaximumSize(double width, double height)
public double[] getSizes(double[] values)
protected void calculateSizes()
public void getText(StringList dest)
dest
- the destination StringList which must not be null.public StringList getCachedText()
public PointRect getTextSize(PointFont f, PointGraphics pm, PointRect dest)
public boolean contains(double x, double y)
public boolean contains(PrintCell who)
who
- the possible child or anscestor control.public final boolean isChildOf(PrintCell who)
public Iterator getChildren()
Note that a sub-control may not be a "child" of the control - i.e. it may not have been added into the Control heirarchy.
public Iterator getChildrenBackwards()
Note that a sub-control may not be a "child" of the control - i.e. it may not have been added into the Control heirarchy.
public Iterator getAllDescendants(boolean backwards)
public Iterator getAllSubControls()
public Iterator getSubControls()
public void make(PointGraphics ps)
public void doPaint(PointGraphics g, PointRect r)
g
- the graphics to paint to.r
- the area within the Control to paint. This can be ignored and the entire
area can be painted if so desired.public PointRect getCachedDim()
public void doBackground(PointGraphics g)
public void doBorder(PointGraphics g, double penSize, Color c, int style, boolean insetInCell, int rectSides)
public void doPaintChildren(PointGraphics g, PointRect where)
public void draw(PointGraphics pg, PointRect area)
draw
in interface PointDrawable
fontName
- the name of the Font to use.fontStyle
- the style of the Font to use.pm
- the PontMetrics to use for calculating.public void setup(PointGraphics pg, PageFormat pf)