|
||||||||||
| 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.IlvRectangle
ilog.views.graphic.IlvShadowRectangle
public class IlvShadowRectangle
IlvShadowRectangle represents a rectangle with a shadow.
The default values for an IlvShadowRectangle instance are as
follows:
Color.blackColor.blackIlvRect(0, 0, 100, 100)4IlvConstants.BOTTOM_RIGHTNote: calls to the following methods result in a
RuntimeException being thrown:
setCorners(int)setFillOn(boolean)setRadius(int)setStrokeOn(boolean)
The following code example shows how to use an IlvShadowRectangle in a
simple Java application:
IlvManager manager = new IlvManager();
IlvShadowRectangle myDefaultRect = new IlvShadowRectangle();
IlvShadowRectangle myCustomRect = new IlvShadowRectangle(
new IlvRect(60,90,80,20),
6, IlvConstants.TOP_LEFT);
myCustomRect.setForeground(Color.blue);
myCustomRect.setBackground(Color.yellow);
manager.addObject( myDefaultRect, true);
manager.addObject( myCustomRect, true);
The following image shows the graphic objects created in the code example:
>
IlvShadowRectangle 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,
IlvManager,
IlvManagerView,
IlvConstants,
Serialized Form| Field Summary |
|---|
| Fields inherited from class ilog.views.graphic.IlvRectangle |
|---|
BOTTOM_LEFT, BOTTOM_RIGHT, drawrect, TOP_LEFT, TOP_RIGHT |
| Constructor Summary | |
|---|---|
IlvShadowRectangle()
Creates a new IlvShadowRectangle with a (0, 0, 100, 100)
definition rectangle, a thickness of 2 and a IlvConstants.BOTTOM_RIGHT
shadow position. |
|
IlvShadowRectangle(IlvInputStream stream)
Reads the object from an IlvInputStream. |
|
IlvShadowRectangle(IlvRect rect)
Creates a new IlvShadowRectangle. |
|
IlvShadowRectangle(IlvRect rect,
float thickness,
int shadowPosition)
Creates a new IlvShadowRectangle. |
|
IlvShadowRectangle(IlvShadowRectangle source)
Creates a new IlvShadowRectangle by copying an existing one. |
|
| Method Summary | |
|---|---|
IlvGraphic |
copy()
Copies the object. |
void |
draw(Graphics dst,
IlvTransformer t)
Draws the object. |
protected void |
drawContent(Graphics dst,
IlvRect rect,
IlvTransformer t)
Draws the content of the object. |
int |
getShadowPosition()
Returns the position of the shadow. |
float |
getThickness()
Returns the thickness of the shadow. |
void |
setCorners(int corners)
On IlvShadowRectangle this method does nothing. |
void |
setFillOn(boolean value)
On IlvShadowRectangle this method does nothing. |
void |
setRadius(int radius)
On IlvShadowRectangle this method does nothing. |
void |
setShadowPosition(int shadowPosition)
Changes the position of the shadow. |
void |
setStrokeOn(boolean value)
On IlvShadowRectangle this method does nothing. |
void |
setThickness(float thickness)
Changes the thickness of the shadow. |
void |
write(IlvOutputStream stream)
Writes the object to an IlvOutputStream. |
| Methods inherited from class ilog.views.graphic.IlvRectangle |
|---|
applyTransform, boundingBox, contains, getBackground, getCorners, getDefinitionRect, getForeground, getIntersectionWithOutline, getRadius, isCornersZoomable, isFillOn, isStrokeOn, moveResize, setBackground, setCornersZoomable, setDefinitionRect, setForeground, translate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlvShadowRectangle()
IlvShadowRectangle with a (0, 0, 100, 100)
definition rectangle, a thickness of 2 and a IlvConstants.BOTTOM_RIGHT
shadow position.
IlvShadowRectangle(IlvRect, float, int)
public IlvShadowRectangle(IlvRect rect,
float thickness,
int shadowPosition)
IlvShadowRectangle.
rect - The definition rectangle of the object.thickness - The thickness of the shadow.shadowPosition - The position of the shadow.
Valid values are IlvConstants.TOP_LEFT,
IlvConstants.BOTTOM_LEFT, IlvConstants.TOP_RIGHT, or
IlvConstants.BOTTOM_RIGHT.public IlvShadowRectangle(IlvRect rect)
IlvShadowRectangle.
The thickness is set to 5 and the shadow position
to IlvConstants.BOTTOM_RIGHT.
rect - The definition rectangle of the object.public IlvShadowRectangle(IlvShadowRectangle source)
IlvShadowRectangle by copying an existing one.
source - The copied object.
public IlvShadowRectangle(IlvInputStream stream)
throws IlvReadFileException
IlvInputStream.
stream - The input stream.
IlvReadFileException - if the format is not correct.
IlvReadFileException| Method Detail |
|---|
public IlvGraphic copy()
copy in class IlvRectangleIlvGraphicpublic int getShadowPosition()
IlvConstants.TOP_LEFT,
IlvConstants.BOTTOM_LEFT, IlvConstants.TOP_RIGHT,
IlvConstants.BOTTOM_RIGHT.
public void setShadowPosition(int shadowPosition)
shadowPosition - The new position of the shadow. Valid values are
IlvConstants.TOP_LEFT, IlvConstants.BOTTOM_LEFT, or
IlvConstants.TOP_RIGHT, IlvConstants.BOTTOM_RIGHT.public float getThickness()
public void setThickness(float thickness)
thickness - The new thickness.
protected void drawContent(Graphics dst,
IlvRect rect,
IlvTransformer t)
draw.
The implementation is empty, but this method can be overridden
to perform additional drawings inside the shadow rectangle.
dst - The Graphics to perform the drawing.rect - The rectangle defining the inner part of the shadow rectangle
(that is, the bounding box with the shadow removed). Note that this
rectangle is already transformed by the transformer used to
draw the object.t - The transformer used to draw the object.public final void setRadius(int radius)
IlvShadowRectangle this method does nothing.
setRadius in class IlvRectangleradius - The new radius.IlvRectangle.getRadius(),
IlvRectangle.getCorners(),
IlvRectangle.setCornersZoomable(boolean)public final void setStrokeOn(boolean value)
IlvShadowRectangle this method does nothing.
setStrokeOn in class IlvRectanglevalue - Set to true to enable the stroke in your
customized graphic object.IlvRectangle.isStrokeOn()public final void setFillOn(boolean value)
IlvShadowRectangle this method does nothing.
setFillOn in class IlvRectanglevalue - Set to true to enable the fill style for this
graphic object.IlvRectangle.isFillOn()public final void setCorners(int corners)
IlvShadowRectangle this method does nothing.
setCorners in class IlvRectanglecorners - A combination of the following values:
IlvRectangle.TOP_LEFT: top left corner.
IlvRectangle.TOP_RIGHT: top right corner.
IlvRectangle.BOTTOM_RIGHT: bottom right corner.
IlvRectangle.BOTTOM_LEFT: bottom left corner.
IlvRectangle.getCorners(),
IlvRectangle.setCornersZoomable(boolean),
IlvRectangle.setRadius(int)
public void draw(Graphics dst,
IlvTransformer t)
draw in class IlvRectangledst - The destination Graphics.t - The transformer used to draw the object.IlvGraphic.boundingBox(ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphic
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 IlvRectanglestream - 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 | |||||||||