ilog.views.maps.graphic
Class IlvClippedPathDecoration

java.lang.Object
  extended by ilog.views.maps.graphic.IlvClippedPathDecoration
All Implemented Interfaces:
IlvPathDecoration
Direct Known Subclasses:
IlvOutlinedPathDecoration, IlvShapedPathDecoration, IlvStrokedPathDecoration

public abstract class IlvClippedPathDecoration
extends Object
implements IlvPathDecoration

This abstract class implements a clipping behavior on path decorations.
Clipped path decorations have the ability to do the rendering of decorations only on the part of the path that intersects the clip area of the graphics. This abstract class implements the draw() method with such clipping.
Subclasses of clipped path decoration just have to implement the draw() method with a phase.

Since:
JViews 5.0

Constructor Summary
IlvClippedPathDecoration(float flatness)
          Constructs a new IlvClippedPathDecoration with the specified flattening factor.
IlvClippedPathDecoration(IlvInputStream stream)
          Reads an IlvClippedPathDecoration from the specified stream.
 
Method Summary
abstract  IlvRect boundingBox(Shape shape, IlvRect rect, IlvTransformer t)
          Returns the bounding box of the specified shape, if it is decorated using this decoration.
abstract  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 getFlatness()
          Returns the flatness factor.
 void write(IlvOutputStream stream)
          Writes this IlvClippedPathDecoration to the specified stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.views.maps.graphic.IlvPathDecoration
equivalentWidth, isZoomable
 

Constructor Detail

IlvClippedPathDecoration

public IlvClippedPathDecoration(float flatness)
Constructs a new IlvClippedPathDecoration with the specified flattening factor.

Parameters:
flatness - The flatness used when clipping.

IlvClippedPathDecoration

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

Parameters:
stream - The input stream.
Throws:
IlvReadFileException - If an error occurs when reading.
Method Detail

write

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

Parameters:
stream - The output stream.
Throws:
IOException - If an error occurs when writing.

getFlatness

public float getFlatness()
Returns the flatness factor.


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.

draw

public abstract 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.
As the original shape has been clipped, this decoration should be drawn with the specified phase.
When this method is called, a Paint should have been set to the Graphics2D to draw this decoration.

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

boundingBox

public abstract IlvRect boundingBox(Shape shape,
                                    IlvRect rect,
                                    IlvTransformer t)
Returns the bounding box of the specified shape, if it is decorated using this decoration.
If rect 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 which bounding box is to be computed.
rect - The IlvRect that will contain the result.
t - The transformer for this bounding box.


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