public class IlvProportionalChildSize extends Object implements IlvChildSize
IlvProportionalChildSize
is a constraint applied
to a graphic object based on the size of the anchor object.Modifier and Type | Field and Description |
---|---|
static int |
ANCHOR_HEIGHT
To base the computation on the height of the anchor object.
|
static int |
ANCHOR_WIDTH
To base the computation on the width of the anchor object.
|
Constructor and Description |
---|
IlvProportionalChildSize()
Creates a new
IlvProportionalChildSize constraint. |
IlvProportionalChildSize(IlvInputStream stream)
Reads the object from an IlvInputStream.
|
Modifier and Type | Method and Description |
---|---|
int |
getHeightConstraint()
Returns the dimension of the activity that will be used to constrain the
height of the child.
|
double |
getHeightFactor()
Returns the factor that will be used to resize the height of the child.
|
IlvPoint |
getSize(IlvRect bboxAnchor,
IlvRect bboxChild)
Returns the size of the supplied child
|
int |
getWidthConstraint()
Returns the dimension of the anchor that will be used to constrain the
width of the child.
|
double |
getWidthFactor()
Returns the factor that will be used to constrain the width of the child.
|
void |
setHeightConstraint(int constraint)
Sets the dimension of the anchor that will be used to constrain the
height of the child.
|
void |
setHeightFactor(double factor)
Sets the factor that used to resize the height of the child.
|
void |
setWidthConstraint(int constraint)
Sets the dimension of the anchor that will be used to constrain the
width of the child.
|
void |
setWidthFactor(double factor)
Sets the factor that used to constrain the width of the child.
|
void |
write(IlvOutputStream stream)
Writes the attributes of a persistent object.
|
public static final int ANCHOR_HEIGHT
public static final int ANCHOR_WIDTH
public IlvProportionalChildSize()
IlvProportionalChildSize
constraint.
The default is to base the height constraint on the height of the
anchor, and the width constraint on the width of the anchor.public IlvProportionalChildSize(IlvInputStream stream) throws IlvReadFileException
stream
- the input stream.IlvReadFileException
- if the format is not correct.public int getHeightConstraint()
ANCHOR_HEIGHT
if the height of the anchor is used as
a base, ANCHOR_WIDTH
if the width of the anchor is used as
a base.public void setHeightConstraint(int constraint)
constraint
- the dimension of the anchor: either
ANCHOR_HEIGHT
if the height of the anchor is used as
a base, either ANCHOR_WIDTH
if the width of the anchor is
used as a base.public double getHeightFactor()
-1
, meaning that no resize is done
in that dimension.public void setHeightFactor(double factor)
factor
- the factor used to resize the height of the child.
A value of -1
means that no resize is done in that
dimension.public int getWidthConstraint()
ANCHOR_HEIGHT
if the height of the anchor is used as
a base, ANCHOR_WIDTH
if the width of the anchor is used as
a base.public void setWidthConstraint(int constraint)
constraint
- the dimension of the anchor: either
ANCHOR_HEIGHT
if the height of the anchor is used as
a base, either ANCHOR_WIDTH
if the width of the anchor is
used as a base.public double getWidthFactor()
-1
, meaning that no resize is done
in that dimension.public void setWidthFactor(double factor)
factor
- the factor used to constrain the width of the child.
A value of -1
means that no resize is done in that
dimension.public IlvPoint getSize(IlvRect bboxAnchor, IlvRect bboxChild)
getSize
in interface IlvChildSize
bboxAnchor
- The bounding box of the child used to attach the
other elements of the composite graphicbboxChild
- The bounding box of the child the
IlvAttachmentLayout
wants to resizeIlvAttachmentLayout
,
IlvAttachmentLayout.getAnchor()
public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
stream
- the output streamIOException
- thrown when an exception occurs during
the write operation for this object.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.