|
||||||||||
| PREV CLASS Documentation homepage. NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.graphic.IlvScale
ilog.views.graphic.IlvCircularScale
public class IlvCircularScale
IlvCircularScale represents a circular scale.
The default values for an IlvCircularScale instance are
as follows:
IlvRect(0,0,100,100)"0", see java.text.DecimalFormat0100200-220true5252Color.blackjava.awt.Font("Dialog", Font.PLAIN, 12)
The following code example shows how to use an IlvCircularScale
in a simple Java application:
IlvManager manager = new IlvManager();
IlvCircularScale myDefaultScale = new IlvCircularScale();
IlvCircularScale myCustomScale = new IlvCircularScale(
new IlvRect(160,80,40,40), "#", 0, 76, 0, 200, false, 5, 2,5,5);
myCustomScale.setForeground(Color.blue);
myCustomScale.setFont(new Font("SansSerif", Font.BOLD, 14));
manager.addObject(myDefaultScale, true);
manager.addObject(myCustomScale, true);
The following image shows the graphic objects created in the code example:
>
IlvCircularScale is a custom graphic object, that is, a
subclass of IlvGraphic. Graphic objects are controlled using an
IlvManager instance and displayed using one or more
IlvManagerView instances in a Java Swing application.
For information about generic features for graphic objects, see
IlvGraphic.
IlvRect,
IlvPoint,
IlvConstants,
IlvManager,
IlvManagerView,
Serialized Form| Field Summary | |
|---|---|
static int |
BOTH
Both first and the last label are visible. |
static int |
FIRST
The first label must be visible. |
static int |
LAST
The last label must be visible. |
| Constructor Summary | |
|---|---|
IlvCircularScale()
Creates a new IlvCircularScale with default values. |
|
IlvCircularScale(IlvCircularScale source)
Creates a new IlvCircularScale by copying an existing one. |
|
IlvCircularScale(IlvInputStream stream)
Reads the object from an IlvInputStream. |
|
IlvCircularScale(IlvRect rect,
String[] labels,
float start,
float range,
boolean inside,
int numberOfSubSteps,
float stepSize,
float subStepSize)
Creates a new IlvCircularScale by specifying the
labels to be displayed. |
|
IlvCircularScale(IlvRect rect,
String format,
float min,
float max,
float start,
float range,
boolean inside,
int numberOfSteps,
int numberOfSubSteps,
float stepSize,
float subStepSize)
Creates a new IlvCircularScale with numeric
labels by specifying a
minimum and maximum value for the labels. |
|
| Method Summary | |
|---|---|
void |
applyTransform(IlvTransformer t)
Applies a transformation to the shape of the object. |
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object. |
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests if a point lies within the outline of the object. |
IlvGraphic |
copy()
Copies the object. |
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object. |
IlvPoint |
getCenter(IlvTransformer t)
Returns the center point of the graphic object. |
IlvRect |
getDefinitionRect()
Returns the rectangle that contains the ellipse defining the arc. |
IlvTransformer |
getDefinitionTransformer()
This function returns null to indicate that there is no definition
transformation. |
int |
getLabelPolicy()
Returns the label visibility policy, one of the following values: FIRST,
LAST, FIRST|LAST, or 0. |
boolean |
getLabelsInside()
Returns the true if the labels are drawn
inside the scale; false if the labels are
drawn outside the scale. |
float |
getRange()
Returns the angle range of the scale. |
float |
getStart()
Returns the start angle of the scale. |
void |
moveResize(IlvRect rect)
Resizes the object. |
void |
setDefinitionRect(IlvRect drawrect)
Note that, if this circular scale is contained inside an IlvManager,
this method can be called only using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
of the manager. |
void |
setLabelPolicy(int policy)
Sets the label visibility policy. |
void |
setLabelsInside(boolean inside)
Changes the way the labels are drawn. |
void |
setRange(float range)
Sets the angle range of the scale. |
void |
setStart(float start)
Sets the start range of the scale. |
void |
write(IlvOutputStream stream)
Writes the object to an IlvOutputStream. |
boolean |
zoomable()
Returns true if the object is zoomable. |
| Methods inherited from class ilog.views.graphic.IlvScale |
|---|
getFont, getForeground, getFormat, getLabels, getMax, getMin, getNumberOfSteps, getNumberOfSubSteps, getStepSize, getSubStepSize, isAntialiasing, setAntialiasing, setFont, setForeground, setFormat, setLabel, setLabels, setMax, setMin, setNumberOfSteps, setNumberOfSubSteps, setStepSize, setSubStepSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static int FIRST
public static int LAST
public static int BOTH
| Constructor Detail |
|---|
public IlvCircularScale()
IlvCircularScale with default values.
public IlvCircularScale(IlvRect rect,
String format,
float min,
float max,
float start,
float range,
boolean inside,
int numberOfSteps,
int numberOfSubSteps,
float stepSize,
float subStepSize)
IlvCircularScale with numeric
labels by specifying a
minimum and maximum value for the labels.
rect - the location and size of the ellipse that defines
the scale. The scale is defined as a portion of the
ellipse defined by this parameter, by its starting angle
(the start parameter as well as the angle range it uses
(the range parameter).format - a format used to display
the labels of the scale. (See the class
java.text.DecimalFormat
for a description of this parameter).min - the minimum value of the labels of the scale.max - the maximum value of the labels of the scale.start - the start angle in degrees.range - the angle range in degrees.inside - if true then labels are displayed inside the
arc; otherwise they are displayed outside.numberOfSteps - the number of major steps.numberOfSubSteps - the number of minor steps between two major steps.stepSize - the size of the major ticks.subStepSize - the size of the minor ticks.
public IlvCircularScale(IlvRect rect,
String[] labels,
float start,
float range,
boolean inside,
int numberOfSubSteps,
float stepSize,
float subStepSize)
IlvCircularScale by specifying the
labels to be displayed.
rect - the location and size of the ellipse that defines
the scale. The scale is defined as a portion of the
ellipse defined by this parameter, by its starting angle
(the start parameter as well as the angle range it uses
(the range parameter).labels - the labels of the scale.start - the start angle in degrees.range - the angle range in degrees.inside - if true the labels are displayed inside the
arc; otherwise they are displayed outside.numberOfSubSteps - the number of minor steps between two major steps.stepSize - the size of the major ticks.subStepSize - the size of the minor ticks.public IlvCircularScale(IlvCircularScale source)
IlvCircularScale by copying an existing one.
source - the origin object for the copy.
public IlvCircularScale(IlvInputStream stream)
throws IlvReadFileException
IlvInputStream.
stream - the input stream.
IlvReadFileException - if the format is not correct.| Method Detail |
|---|
public IlvGraphic copy()
copy in class IlvGraphicIlvGraphicpublic final IlvRect getDefinitionRect()
getDefinitionRect in interface IlvDefinitionRectInterfacepublic final void setDefinitionRect(IlvRect drawrect)
IlvManager,
this method can be called only using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
of the manager.
setDefinitionRect in interface IlvDefinitionRectInterfacedrawrect - The new definition rectangle.public IlvTransformer getDefinitionTransformer()
null to indicate that there is no definition
transformation.
getDefinitionTransformer in interface IlvDefinitionRectInterfacenull.IlvDefinitionRectInterfacepublic final float getStart()
public final void setStart(float start)
start - the new angle in degrees.public final float getRange()
public final void setRange(float range)
range - the new angle range in degrees.public final boolean getLabelsInside()
true if the labels are drawn
inside the scale; false if the labels are
drawn outside the scale.
public final void setLabelsInside(boolean inside)
inside - if this parameter is set to
true, the labels are drawn inside
the scale; otherwise, they are drawn outside.public void setLabelPolicy(int policy)
range of the scale is 360 degrees.
policy - You can specify one of the following values: FIRST,
LAST, FIRST|LAST, or 0.FIRST,
LAST,
LASTpublic int getLabelPolicy()
FIRST,
LAST, FIRST|LAST, or 0.
FIRST,
LAST,
LASTpublic IlvRect boundingBox(IlvTransformer t)
boundingBox in class IlvScalet - The transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic IlvPoint getCenter(IlvTransformer t)
getCenter in class IlvGraphict - The transformer used to draw the object. The value
null can be used for the identity transformer.
IlvGraphic
public void draw(Graphics dst,
IlvTransformer t)
draw in class IlvGraphicdst - The destination Graphics.t - The transformation used to draw the object.IlvGraphic.boundingBox(ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphic
public boolean contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
contains in class IlvGraphicp - The point to be tested.tp - The point p transformed by the transformer t.t - The transformation that was applied to the object when it
was drawn.
true if the point lies inside this graphic object.IlvGraphicpublic void applyTransform(IlvTransformer t)
applyTransform in class IlvScalet - The transformer to be applied.IlvGraphicpublic void moveResize(IlvRect rect)
IlvRect parameter.
This method calls the applyTransform(ilog.views.IlvTransformer) method.
moveResize in class IlvGraphicrect - The new bounding rectangle of the object.setDefinitionRect(IlvRect)public boolean zoomable()
true if the object is zoomable.
Otherwise it returns false.
zoomable in class IlvGraphicIlvGraphic,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.boundingBox(IlvTransformer),
IlvManager
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 IlvPersistentObjectwrite in class IlvScalestream - The output stream.
IOException - thrown when an exception occurs during
the write operation for this object.
|
||||||||||
| PREV CLASS Documentation homepage. NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||