ilog.views.graphic
Class IlvReliefRectangle

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.graphic.IlvRectangle
          extended by ilog.views.graphic.IlvReliefRectangle
All Implemented Interfaces:
IlvPersistentObject, Transferable, Serializable
Direct Known Subclasses:
IlvReliefLabel

public class IlvReliefRectangle
extends IlvRectangle

IlvReliefRectangle represents a rectangle in relief with a customizable fill color.

The default values for an IlvReliefRectangle instance are as follows:

Note: calls to the following methods result in a RuntimeException being thrown:

Example

The following code example shows how to use an IlvReliefRectangle in a simple Java application:

   IlvManager manager = new IlvManager();
   IlvReliefRectangle myDefaultRect = new IlvReliefRectangle();
   // Set size, position and the relief thickness.
   IlvReliefRectangle myCustomRect = 
     new IlvReliefRectangle(new IlvRect(120, 100, 80, 20), 6);
   myCustomRect.setBackground(Color.green);
       
   manager.addObject(myDefaultRect, true);
   manager.addObject(myCustomRect, true);
 

The following image shows the graphic objects created in the code example:

About Graphic Objects

IlvReliefRectangle 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.

See Also:
IlvRectangle, IlvManager, IlvManagerView, Serialized Form

Field Summary
 
Fields inherited from class ilog.views.graphic.IlvRectangle
BOTTOM_LEFT, BOTTOM_RIGHT, drawrect, TOP_LEFT, TOP_RIGHT
 
Constructor Summary
IlvReliefRectangle()
          Creates a new IlvReliefRectangle with a (0, 0, 100, 100) definition rectangle.
IlvReliefRectangle(IlvInputStream stream)
          Reads the object from an IlvInputStream.
IlvReliefRectangle(IlvRect rect)
          Creates a new Relief rectangle.
IlvReliefRectangle(IlvRect rect, int thickness)
          Creates a new Relief rectangle.
IlvReliefRectangle(IlvReliefRectangle source)
          Creates a new Relief rectangle 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 getThickness()
          Returns the thickness of the object.
 void setCorners(int corners)
          On IlvReliefRectangle this method does nothing.
 void setFillOn(boolean value)
          On IlvReliefRectangle this method does nothing.
 void setRadius(int radius)
          On IlvReliefRectangle this method does nothing.
 void setStrokeOn(boolean value)
          On IlvReliefRectangle this method does nothing.
 void setThickness(int thickness)
          Changes the thickness of the object.
 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 ilog.views.IlvGraphic
addActionListener, addNamedPropertyListener, boundingBox, getAndAssociateObjectInteractor, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, hasProperty, inside, intersects, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isPersistent, isSelectable, isVisible, makeSelection, move, move, notifyObjectInteractorToManager, processActionEvent, reDraw, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setEditable, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setToolTipText, setVisible, toString, zoomable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvReliefRectangle

public IlvReliefRectangle()
Creates a new IlvReliefRectangle with a (0, 0, 100, 100) definition rectangle.

Since:
JViews 6.0
See Also:
IlvReliefRectangle(IlvRect)

IlvReliefRectangle

public IlvReliefRectangle(IlvRect rect)
Creates a new Relief rectangle.

Parameters:
rect - The definition rect of the rectangle.

IlvReliefRectangle

public IlvReliefRectangle(IlvRect rect,
                          int thickness)
Creates a new Relief rectangle.

Parameters:
rect - The definition rect of the rectangle.
thickness - The thickness of the relief.

IlvReliefRectangle

public IlvReliefRectangle(IlvInputStream stream)
                   throws IlvReadFileException
Reads the object from an IlvInputStream.

Parameters:
stream - The input stream.
Throws:
IlvReadFileException - if the format is not correct.
IlvReadFileException

IlvReliefRectangle

public IlvReliefRectangle(IlvReliefRectangle source)
Creates a new Relief rectangle by copying an existing one.

Parameters:
source - The origin of the copy.
Method Detail

getThickness

public int getThickness()
Returns the thickness of the object.


setThickness

public void setThickness(int thickness)
Changes the thickness of the object.


copy

public IlvGraphic copy()
Copies the object. This method copies the object by calling the copy constructor.

Overrides:
copy in class IlvRectangle
Returns:
A copy of the object.
See Also:
IlvGraphic

draw

public void draw(Graphics dst,
                 IlvTransformer t)
Draws the object.

Overrides:
draw in class IlvRectangle
Parameters:
dst - The destination Graphics.
t - The transformation used to draw the object.
See Also:
IlvGraphic.boundingBox(ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

drawContent

protected void drawContent(Graphics dst,
                           IlvRect rect,
                           IlvTransformer t)
Draws the content of the object. This method is called by the method draw. The implementation is empty, but this method can be overwritten in order to perform additional drawings inside the relief rectangle. Note that this method may not be called by draw if the object is too small and only relief shadows can be drawn.

Parameters:
dst - The Graphics to perform the drawing.
rect - The rectangle defining the inner part of the relief rectangle (that is, the bounding box with the relief 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.

setRadius

public final void setRadius(int radius)
On IlvReliefRectangle this method does nothing.

Overrides:
setRadius in class IlvRectangle
Parameters:
radius - The new radius.
Since:
JViews 5.5
See Also:
IlvRectangle.getRadius(), IlvRectangle.getCorners(), IlvRectangle.setCornersZoomable(boolean)

setStrokeOn

public final void setStrokeOn(boolean value)
On IlvReliefRectangle this method does nothing.

Overrides:
setStrokeOn in class IlvRectangle
Parameters:
value - Set to true to enable the stroke in your customized graphic object.
Since:
JViews 5.5
See Also:
IlvRectangle.isStrokeOn()

setFillOn

public final void setFillOn(boolean value)
On IlvReliefRectangle this method does nothing.

Overrides:
setFillOn in class IlvRectangle
Parameters:
value - Set to true to enable the fill style for this graphic object.
Since:
JViews 5.5
See Also:
IlvRectangle.isFillOn()

setCorners

public final void setCorners(int corners)
On IlvReliefRectangle this method does nothing.

Overrides:
setCorners in class IlvRectangle
Parameters:
corners - 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.
    Since:
    JViews 5.5
    See Also:
    IlvRectangle.getCorners(), IlvRectangle.setCornersZoomable(boolean), IlvRectangle.setRadius(int)

  • write

    public void write(IlvOutputStream stream)
               throws IOException
    Writes the object to an 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.

    Specified by:
    write in interface IlvPersistentObject
    Overrides:
    write in class IlvRectangle
    Parameters:
    stream - The output stream.
    Throws:
    IOException - thrown when an exception occurs during the write operation for this object.


    Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.