ilog.views.maps.graphic
Class IlvShapeEndedPathDecoration

java.lang.Object
  extended by ilog.views.maps.graphic.IlvShapeEndedPathDecoration
All Implemented Interfaces:
IlvPersistentObject, IlvPathDecoration

public class IlvShapeEndedPathDecoration
extends Object
implements IlvPathDecoration, IlvPersistentObject

A path decoration that draws the decorations with a shape at each end of the path. This class is typically used to draw arrows.

Since:
JViews 5.0

Constructor Summary
IlvShapeEndedPathDecoration(IlvInputStream stream)
          Reads an IlvShapeEndedPathDecoration from the specified stream.
IlvShapeEndedPathDecoration(Shape start, Shape end, float flatness, boolean zoomable)
          Constructs a new IlvShapeEndedPathDecoration with the specified shapes at each ends.
 
Method Summary
 IlvRect boundingBox(Shape shape, IlvRect r, IlvTransformer t)
          Returns the bounding box of the specified shape, if it is decorated using this decoration.
 void draw(Graphics2D graphics, Shape shape, IlvTransformer t)
          Draws the decoration for the specified shape in the specified graphics.
 float equivalentWidth(IlvTransformer t)
          Returns an equivalent line width for the specified transformer.
 Shape getEnd()
          Returns the end shape for this decoration.
 float getFlatness()
          Returns the flatness used when drawing this decoration.
 Shape getStart()
          Returns the start shape for this decoration.
 boolean isZoomable()
          Returns true if this path decoration is zoomable.
 void write(IlvOutputStream stream)
          Writes this IlvShapeEndedPathDecoration to the specified stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvShapeEndedPathDecoration

public IlvShapeEndedPathDecoration(Shape start,
                                   Shape end,
                                   float flatness,
                                   boolean zoomable)
Constructs a new IlvShapeEndedPathDecoration with the specified shapes at each ends.

Parameters:
start - The Shape used to decorate the path start.
end - The Shape used to decorate the path end.
flatness - The flatness used to iterate on the decorated path.
zoomable - If true, the decoration is made zoomable.

IlvShapeEndedPathDecoration

public IlvShapeEndedPathDecoration(IlvInputStream stream)
                            throws IlvReadFileException
Reads an IlvShapeEndedPathDecoration from the specified stream.

Throws:
IlvReadFileException
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes this IlvShapeEndedPathDecoration to the specified stream.

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

getFlatness

public float getFlatness()
Returns the flatness used when drawing this decoration.


getStart

public Shape getStart()
Returns the start shape for this decoration.


getEnd

public Shape getEnd()
Returns the end shape for this decoration.


draw

public void draw(Graphics2D graphics,
                 Shape shape,
                 IlvTransformer t)
Draws the decoration for the specified shape in the specified graphics.

Specified by:
draw in interface IlvPathDecoration
Parameters:
graphics - The Graphics2D to draw in.
shape - The Shape to draw.
t - The viewing transformer.

boundingBox

public IlvRect boundingBox(Shape shape,
                           IlvRect r,
                           IlvTransformer t)
Returns the bounding box of the specified shape, if it is decorated using this decoration. If r is non null, the result is put in r and returned, otherwise the result is returned in a newly allocated IlvRect.

Specified by:
boundingBox in interface IlvPathDecoration
Parameters:
shape - The shape whose bounding box is to be computed.
r - The IlvRect that will contain the result.
t - The transformer for this bounding box.

isZoomable

public boolean isZoomable()
Returns true if this path decoration is zoomable.

Specified by:
isZoomable in interface IlvPathDecoration

equivalentWidth

public float equivalentWidth(IlvTransformer t)
Returns an equivalent line width for the specified transformer.

Specified by:
equivalentWidth in interface IlvPathDecoration
Parameters:
t - The transformer to compute the equivalent width.
Returns:
The equivalent width.


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