ilog.views.maps.graphic
Class IlvShapedPathDecoration

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

public class IlvShapedPathDecoration
extends IlvClippedPathDecoration
implements IlvPersistentObject

A path decoration that is a Shape repeated at specified intervals.
A zoomable IlvShapedPathDecoration has its decoration and decoration repetition interval zooming depending on the zoom level of the view.
A non-zoomable IlvShapedPathDecoration displays its decoration at a fixed size.

Since:
JViews 5.0
See Also:
IlvClippedPathDecoration, IlvDecoratedPath

Constructor Summary
IlvShapedPathDecoration(IlvInputStream stream)
          Reads an IlvShapedPathDecoration from the specified stream.
IlvShapedPathDecoration(Shape decoration, float interval, boolean zoomable)
          Constructs a new IlvShapedPathDecoration, with the specified paint, no stroke, and a default phase and flatness of 0.
IlvShapedPathDecoration(Shape decoration, float interval, float phase, float flatness, boolean zoomable)
          Constructs a new IlvShapedPathDecoration with the specified flattening factor.
 
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 subshape, float phase, IlvTransformer t)
          Draws the decoration for the specified shape, which is a sub shape of the original shape.
 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 to this path decoration, if it is drawn using the specified transformer.
 Shape getDecoration()
          Returns the shape used as decoration of this path decoration.
 float getInterval()
          Returns the interval of the decoration repetition.
 float getPhase()
          Returns the phase before drawing the first decoration.
 boolean isZoomable()
          Returns true if this path decoration is zoomable.
 void write(IlvOutputStream stream)
          Writes this IlvShapedPathDecoration to the specified stream.
 
Methods inherited from class ilog.views.maps.graphic.IlvClippedPathDecoration
getFlatness
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvShapedPathDecoration

public IlvShapedPathDecoration(Shape decoration,
                               float interval,
                               boolean zoomable)
Constructs a new IlvShapedPathDecoration, with the specified paint, no stroke, and a default phase and flatness of 0.

Parameters:
decoration - The decoration to repeat.
interval - The interval at which the decoration is repeated.
zoomable - If true, the decoration is zoomable.

IlvShapedPathDecoration

public IlvShapedPathDecoration(Shape decoration,
                               float interval,
                               float phase,
                               float flatness,
                               boolean zoomable)
Constructs a new IlvShapedPathDecoration with the specified flattening factor.

Parameters:
decoration - The decoration to repeat.
interval - The interval at which the decoration is repeated.
phase - The phase for decoration drawing (like dash phase).
flatness - The flatness used to iterate on the decorated path.
zoomable - If true, the decoration is zoomable.

IlvShapedPathDecoration

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

Throws:
IlvReadFileException
Method Detail

write

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

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvClippedPathDecoration
Parameters:
stream - The output stream.
Throws:
IOException - If an error occurs when writing.

getDecoration

public Shape getDecoration()
Returns the shape used as decoration of this path decoration.


getInterval

public float getInterval()
Returns the interval of the decoration repetition.


getPhase

public float getPhase()
Returns the phase before drawing the first decoration.


draw

public void draw(Graphics2D graphics,
                 Shape subshape,
                 float phase,
                 IlvTransformer t)
Draws the decoration for the specified shape, which is a sub shape of the original shape.

Specified by:
draw in class IlvClippedPathDecoration
Parameters:
graphics - The Graphics2D to draw in.
subshape - The Shape to draw.
phase - The phase to draw this decoration.
t - The viewing transformer.

equivalentWidth

public float equivalentWidth(IlvTransformer t)
Returns an equivalent line width to this path decoration, if it is drawn using the specified transformer.

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

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
Specified by:
boundingBox in class IlvClippedPathDecoration
Parameters:
shape - The shape which 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

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
Overrides:
draw in class IlvClippedPathDecoration
Parameters:
graphics - The Graphics2D to draw in.
shape - The Shape to draw.
t - The viewing transformer.
Since:
JViews 8.1
See Also:
IlvClippedPathDecoration.draw(java.awt.Graphics2D, java.awt.Shape, ilog.views.IlvTransformer)


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