ilog.views.maps.graphic
Class IlvOutlinedPathDecoration

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

public class IlvOutlinedPathDecoration
extends IlvClippedPathDecoration
implements IlvPersistentObject

A path decoration that uses a BasicStroke as base stroke. The stroke is defined using the same parameters as java.awt.BasicStroke. This stroke can be either filled, stroked, or both. A zoomable IlvStrokedPathDecoration behaves like a java.awt.BasicStroke that is clipped to the visible part of the shape it strokes.
A non-zoomable IlvOutlinedPathDecoration has its width and dash always at a specified pixel size.

Since:
JViews 5.0
See Also:
IlvClippedPathDecoration, IlvPathDecoration

Constructor Summary
IlvOutlinedPathDecoration(float width, float flatness, boolean zoomable)
          Constructs a new IlvStrokedPathDecoration with the specified flattening factor, the default BasicStroke.CAP_SQUARE cap style, the default BasicStroke.JOIN_MITER join style, the default miter limit of 10.0, no dash, and a basic stroke of size 1.
IlvOutlinedPathDecoration(float width, int cap, int join, float miterlimit, float[] dash, float dash_offset, float outlineWidth, float flatness, boolean zoomable)
          Constructs a new IlvOutlinedPathDecoration with the specified flattening factor.
IlvOutlinedPathDecoration(IlvInputStream stream)
          Reads an IlvOutlinedPathDecoration from the specified input stream.
 
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 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.
 int getCap()
          Returns the line cap of this stroke.
 float[] getDash()
          Returns the dash of this stroke, or null if this stroke is not dashed.
 float getDashOffset()
          Returns the dash offset of dashes used by this stroke.
 int getJoin()
          Returns the line join of this stroke.
 float getMiterLimit()
          Returns the miter limit of this stroke, if join style is BasicStroke.JOIN_MITER.
 float getWidth()
          Returns the width of this stroke.
 boolean isZoomable()
          Returns true if this path decoration is zoomable.
 void write(IlvOutputStream stream)
          Writes this stroked path decoration to the specified stream.
 
Methods inherited from class ilog.views.maps.graphic.IlvClippedPathDecoration
draw, getFlatness
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvOutlinedPathDecoration

public IlvOutlinedPathDecoration(float width,
                                 float flatness,
                                 boolean zoomable)
Constructs a new IlvStrokedPathDecoration with the specified flattening factor, the default BasicStroke.CAP_SQUARE cap style, the default BasicStroke.JOIN_MITER join style, the default miter limit of 10.0, no dash, and a basic stroke of size 1.

Parameters:
width - The width of this stroke.
flatness - The flatness used when drawing the stroke.
zoomable - If true, this stroke is zoomable.

IlvOutlinedPathDecoration

public IlvOutlinedPathDecoration(float width,
                                 int cap,
                                 int join,
                                 float miterlimit,
                                 float[] dash,
                                 float dash_offset,
                                 float outlineWidth,
                                 float flatness,
                                 boolean zoomable)
Constructs a new IlvOutlinedPathDecoration with the specified flattening factor.

Parameters:
width - The width of this stroke.
cap - The decoration of the ends of this stroke. Valid values are java.awt.BasicStroke.CAP_BUTT, java.awt.BasicStroke.CAP_ROUND and java.awt.BasicStroke.CAP_SQUARE.
join - The decoration applied where path segments meet. Valid values are java.awt.BasicStroke.JOIN_BEVEL , java.awt.BasicStroke.JOIN_MITER and java.awt.BasicStroke.JOIN_ROUND.
miterlimit - The limit to trim the miter join.
dash - The array representing the dashing pattern.
dash_offset - The offset to start the dashing pattern.
flatness - The flatness used when drawing the stroke
zoomable - If true, this stroke is zoomable.

IlvOutlinedPathDecoration

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

Parameters:
stream - The IlvInputStream to read from.
Throws:
IlvReadFileException - If an error occurs while reading a stroked path from the specified stream.
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes this stroked path decoration to the specified stream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvClippedPathDecoration
Parameters:
stream - The IlvInputStream to write to.
Throws:
IOException - If an error occurs while writing this path decoration to the stream.

draw

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

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

getWidth

public float getWidth()
Returns the width of this stroke.


getCap

public int getCap()
Returns the line cap of this stroke.


getJoin

public int getJoin()
Returns the line join of this stroke.


getMiterLimit

public float getMiterLimit()
Returns the miter limit of this stroke, if join style is BasicStroke.JOIN_MITER.


getDash

public float[] getDash()
Returns the dash of this stroke, or null if this stroke is not dashed.


getDashOffset

public float getDashOffset()
Returns the dash offset of dashes used by this stroke.



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