public abstract class IlvScale extends IlvBidiGraphic implements IlvFontInterface
IlvScale
is an abstract class from which
all instances of scale object classes are derived. This class
manages the basic information concerning scales.Constructor and Description |
---|
IlvScale(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
IlvScale(IlvRect rect,
int numberOfSteps,
int numberOfSubSteps,
float stepSize,
float subStepSize,
float min,
float max,
String format)
Creates a new scale by specifying a minimum and maximum value for the labels.
|
IlvScale(IlvRect rect,
String[] labels,
int numberOfSubSteps,
float stepSize,
float subStepSize)
Creates a new scale by specifying the labels.
|
IlvScale(IlvScale source)
Creates a new
IlvScale by copying an existing one. |
Modifier and Type | Method and Description |
---|---|
void |
applyTransform(IlvTransformer t)
Applies a transformation to the shape of the object.
|
void |
baseTextDirectionChanged(int oldBaseTextDirection,
int newBaseTextDirection)
Called when the object is base text direction sensitive and the
resolved base text direction has changed.
|
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object.
|
void |
componentOrientationChanged(ComponentOrientation oldOri,
ComponentOrientation newOri)
Called when the object is component orientation sensitive and the
component orientation has changed.
|
Font |
getFont()
Returns the font of the object.
|
Color |
getForeground()
Returns the color of the
IlvScale . |
String |
getFormat()
Returns the format used to display numeric labels.
|
String[] |
getLabels()
Returns the labels of the scale.
|
float |
getMax()
Returns the maximum value displayed as a label
of the scale.
|
float |
getMin()
Returns the minimum value displayed as a label
of the scale.
|
int |
getNumberOfSteps()
Returns the number of major steps for this scale.
|
int |
getNumberOfSubSteps()
Returns the number of minor steps for this scale.
|
float |
getStepSize()
Returns the size of a major tick mark.
|
float |
getSubStepSize()
Returns the size of a minor tick mark.
|
boolean |
isAntialiasing()
Returns
true if the anti-aliasing mode
of the labels is on. |
boolean |
isBaseTextDirectionSensitive()
Returns
true because the bounding box of this object
depends on its text direction. |
boolean |
isLocaleSensitive()
Returns
true if the bounding box of this object depends
on the locale of this object. |
void |
localeChanged(ULocale oldLocale,
ULocale newLocale)
Called when the object is locale sensitive and the locale has changed.
|
void |
setAntialiasing(boolean set)
Changes the anti-aliasing mode of the labels.
|
void |
setFont(Font font)
Changes the font of the object.
|
void |
setForeground(Color color)
Changes the color of the
IlvScale . |
void |
setFormat(String format)
Changes the format used to display numeric labels.
|
void |
setLabel(int index,
String label)
Changes the specified label of the scale.
|
void |
setLabels(String[] labels)
Changes all labels of the scale.
|
void |
setMax(float max)
Changes the maximum value displayed as a label
of the scale.
|
void |
setMin(float min)
Changes the minimum value displayed as a label
of the scale.
|
void |
setNumberOfSteps(int steps)
Changes the number of major steps for this scale.
|
void |
setNumberOfSubSteps(int substeps)
Changes the number of minor steps for this scale.
|
void |
setStepSize(float stepSize)
Changes the size of a major tick mark.
|
void |
setSubStepSize(float subStepSize)
Changes the size of a minor tick mark.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
calcResolvedBaseTextDirection, getBaseTextDirection, getComponentOrientation, getResolvedBaseTextDirection, getULocale, invalidateBidiCache, setBaseTextDirection, setBaseTextDirection, setBaseTextDirectionDuringConstruction
addActionListener, addNamedPropertyListener, allViewsRemoved, blinkingStateOn, boundingBox, callDraw, contains, copy, draw, getAndAssociateObjectInteractor, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isPersistent, isSelectable, isVisible, makeSelection, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved, zoomable
public IlvScale(IlvRect rect, int numberOfSteps, int numberOfSubSteps, float stepSize, float subStepSize, float min, float max, String format)
rect
- the location and size of the scale.numberOfSteps
- the number of major steps.numberOfSubSteps
- the number of minor steps displayed between major steps.stepSize
- the size of the major tick mark.subStepSize
- the size of the minor tick mark.min
- the minimum value of the labels of the scale.max
- the maximum value of the labels of the scale.format
- a format used to display
the labels of the scale. (See the class
java.text.DecimalFormat
for a description of this parameter.)public IlvScale(IlvRect rect, String[] labels, int numberOfSubSteps, float stepSize, float subStepSize)
rect
- the location and size of the scale.labels
- the labels of the scale.numberOfSubSteps
- the number of minor steps displayed between major steps.stepSize
- the size of the major tick mark.subStepSize
- the size of the minor tick mark.public IlvScale(IlvScale source)
IlvScale
by copying an existing one.source
- the origin object for the copy.public IlvScale(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- the input stream.IlvReadFileException
- if the format is not correct.public final int getNumberOfSteps()
public final void setNumberOfSteps(int steps)
public final int getNumberOfSubSteps()
public final void setNumberOfSubSteps(int substeps)
public final float getStepSize()
public final void setStepSize(float stepSize)
public final float getSubStepSize()
public final void setSubStepSize(float subStepSize)
public final float getMin()
setLabels
method.getMax()
public final void setMin(float min)
setMax(float)
public final float getMax()
setLabels
method.getMin()
public final void setMax(float max)
setMin(float)
public final String getFormat()
min
and
max
),
the labels are computed using this format. The format
is a decimal format as described in the class
java.text.DecimalFormat
.public final void setFormat(String format)
min
and max
),
the labels are computed using this format. The format
is a decimal format as described in the class
java.text.DecimalFormat
. Changing the format
may change the bounding box of the object.public void setFont(Font font)
setFont
in interface IlvFontInterface
font
- the new font.public Font getFont()
getFont
in interface IlvFontInterface
public final boolean isAntialiasing()
true
if the anti-aliasing mode
of the labels is on.
Note that Anti-aliasing works only with Java 1.2.public final void setAntialiasing(boolean set)
public final String[] getLabels()
public void setLabels(String[] labels)
labels
- the new labels.public void setLabel(int index, String label)
index
- the index of the label to change.label
- the new label.public boolean isLocaleSensitive()
true
if the bounding box of this object depends
on the locale of this object. This is the case when the labels of
the scale are numeric labels.
A graphic object is locale sensitive if its bounding box calculation
yields different results when IlvBidiGraphic.getULocale()
or IlvGraphic.getLocale()
calls return different locales.
isLocaleSensitive
in class IlvGraphic
public IlvRect boundingBox(IlvTransformer t)
boundingBox
in class IlvGraphic
t
- The transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public void applyTransform(IlvTransformer t)
applyTransform
in class IlvGraphic
t
- The transformer to be applied.IlvGraphic
public void setForeground(Color color)
IlvScale
.
This property supports
IlvBlinkingColor
.setForeground
in class IlvGraphic
color
- the new color.IlvGraphic.draw(Graphics, IlvTransformer)
,
IlvGraphic.setBackground(Color)
,
IlvGraphic.setFillOn(boolean)
,
IlvGraphic.setStrokeOn(boolean)
,
IlvGraphic
public Color getForeground()
IlvScale
.public boolean isBaseTextDirectionSensitive()
true
because the bounding box of this object
depends on its text direction.isBaseTextDirectionSensitive
in class IlvGraphic
public void baseTextDirectionChanged(int oldBaseTextDirection, int newBaseTextDirection)
baseTextDirectionChanged
in class IlvGraphic
oldBaseTextDirection
- Resolved base text direction of this object before the change.newBaseTextDirection
- Resolved base text direction of this object after the change.isBaseTextDirectionSensitive()
public void componentOrientationChanged(ComponentOrientation oldOri, ComponentOrientation newOri)
componentOrientationChanged
in class IlvGraphic
oldOri
- Orientation of this object before the orientation change.newOri
- Orientation of this object after the orientation change.IlvGraphic.isComponentOrientationSensitive()
public void localeChanged(ULocale oldLocale, ULocale newLocale)
localeChanged
in class IlvGraphic
oldLocale
- Locale of this object before the locale change.newLocale
- Locale of this object after the locale change.isLocaleSensitive()
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.
Note that even if this is a public method, you should not
call it directly, you should use the write
methods of the manager.write
in interface IlvPersistentObject
write
in class IlvGraphic
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.