ilog.views.maps.graphic
Class IlvMapPolyline

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.graphic.IlvPolyPoints
          extended by ilog.views.graphic.IlvPolyline
              extended by ilog.views.maps.graphic.IlvMapPolyline
All Implemented Interfaces:
IlvPolyPointsInterface, IlvPersistentObject, IlvMapGraphic, Transferable, Serializable
Direct Known Subclasses:
IlvMapAnnotationToolBar.MapPolyline

public class IlvMapPolyline
extends IlvPolyline
implements IlvMapGraphic

IlvMapPolyline is an IlvPolyline that reads its attribute from an IlvPolylineStyle instance. This polyline object support decorations.

Since:
JViews 7.5
See Also:
IlvPathDecoration, Serialized Form

Field Summary
protected  IlvPolylineStyle style
          The map style in use.
 
Constructor Summary
IlvMapPolyline(IlvInputStream stream)
          Reads an IlvMapPolyline object from an IlvInputStream.
IlvMapPolyline(IlvMapPolyline source)
          Creates an IlvMapPolyline instance by copying an existing one.
IlvMapPolyline(IlvPoint[] points)
          Creates a new IlvMapPolyline instance.
IlvMapPolyline(IlvPoint[] points, boolean copy)
          Creates a new IlvMapPolyline insance.
 
Method Summary
 IlvRect boundingBox(IlvTransformer t)
          Returns the bounding rectangle of this object.
 boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the outline of this object.
 IlvGraphic copy()
          Copies the object.
 IlvGraphic copy(IlvCoordinateTransformation transform)
          Copies the element and applies the specified transformation to its coordinates.
 void draw(Graphics graphics, IlvTransformer t)
          Draws this IlvMapPolyline object with the specified graphics and transformer.
protected  void drawDecoration(Graphics2D g, IlvTransformer t)
          Draws the decoration if there is one.
 Color getBackground()
          Retrieves the background from the style.
 IlvPathDecoration getDecoration()
          Returns the decoration for this decorated path.
 Paint getDecorationPaint()
          Returns the Paint object used to draw the decoration.
 int getEndCap()
          Retrieves the end cap from the style.
 Color getForeground()
          Retrieves the foreground from the style.
 int getLineJoin()
          Retrieves the line join from the style.
 float[] getLineStyle()
          Retrieves the line style from the style.
 float getLineWidth()
          Retrieves the line width from the style.
 float getMaximumLineWidth()
          Retrieves the maximum line width from the style.
 IlvMapStyle getStyle()
          Retrieves the IlvMapStyle attached to this graphic.
 boolean isDecorationOnly()
          Returns true if the decoration of this decorated path is to be drawn.
static boolean isPreciseContains()
          Tests if the contains method is performing a precise and costly check.
 IlvMapGeometry makeGeometry()
          Returns an IlvMapLineString geometry.
 void setBackground(Color color)
          Sets the background in the IlvPolylineStyle object.
 void setDecoration(IlvPathDecoration decoration)
          Sets the decoration for this decorated path.
 void setDecorationOnly(boolean set)
          Sets whether the decoration of this decorated path is to be drawn.
 void setDecorationPaint(Paint p)
          Sets the Paint object used to draw the decoration.
 void setEndCap(int end)
          Sets the end cap in the IlvPolylineStyle object.
 void setForeground(Color color)
          Sets the foreground in the IlvPolylineStyle object.
 void setLineJoin(int join)
          Sets the line join in the IlvPolylineStyle object.
 void setLineStyle(float[] s)
          Sets the line style in the IlvPolylineStyle object.
 void setLineWidth(float width)
          Sets the line width in the IlvPolylineStyle object.
static void setPreciseContains(boolean pc)
          Set to true if the contains method should perform a precise and costly check.
 void setStyle(IlvMapStyle stl)
          Implements the IlvMapGraphic interface.
 void write(IlvOutputStream stream)
          Writes this IlvMapGraphicPath object to the IlvOutputStream passed as parameter
 
Methods inherited from class ilog.views.graphic.IlvPolyline
computeBBox, finalize, getIntersectionWithOutline, getLineWidth, pointsInBBox, setMaximumLineWidth
 
Methods inherited from class ilog.views.graphic.IlvPolyPoints
allowsPointInsertion, allowsPointMove, allowsPointRemoval, applyTransform, getPointAt, getPoints, getPointsCardinal, inBBox, insertPoint, intersects, makeSelection, movePoint, recomputeBBox, removePoint
 
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, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isPersistent, isSelectable, isVisible, move, move, moveResize, notifyObjectInteractorToManager, processActionEvent, reDraw, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setEditable, setFillOn, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipText, setVisible, toString, translate, zoomable
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

style

protected IlvPolylineStyle style
The map style in use.

Constructor Detail

IlvMapPolyline

public IlvMapPolyline(IlvMapPolyline source)
Creates an IlvMapPolyline instance by copying an existing one.

Parameters:
source - The source IlvMapPolyline object.

IlvMapPolyline

public IlvMapPolyline(IlvPoint[] points)
Creates a new IlvMapPolyline instance.

Parameters:
points - The array of points defining the polyline.

IlvMapPolyline

public IlvMapPolyline(IlvPoint[] points,
                      boolean copy)
Creates a new IlvMapPolyline insance.

Parameters:
points - The array of points defining the polyline.
copy - Specifies if the array of points is to be copied or not.

IlvMapPolyline

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

Parameters:
stream - The stream to read from.
Throws:
IlvReadFileException - if there is a problem reading from stream.
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes this IlvMapGraphicPath object to the IlvOutputStream passed as parameter

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvPolyline
Parameters:
stream - The stream to write to.
Throws:
IOException - if there is a problem writing to stream.

setDecoration

public void setDecoration(IlvPathDecoration decoration)
Sets the decoration for this decorated path.

Parameters:
decoration - The decoration.

getDecoration

public IlvPathDecoration getDecoration()
Returns the decoration for this decorated path.

Returns:
The IlvPathDecoration object used by this polyline.

isDecorationOnly

public boolean isDecorationOnly()
Returns true if the decoration of this decorated path is to be drawn.

Returns:
If the decoration of this decorated path is to be drawn, true is returned.

setDecorationOnly

public void setDecorationOnly(boolean set)
Sets whether the decoration of this decorated path is to be drawn.

Parameters:
set - Set to true for the decoration to be drawn.

getDecorationPaint

public Paint getDecorationPaint()
Returns the Paint object used to draw the decoration.

Returns:
The Paint object used to draw the decoration.

setDecorationPaint

public void setDecorationPaint(Paint p)
Sets the Paint object used to draw the decoration.

Parameters:
p - The Paint object used to draw the decoration.

setEndCap

public void setEndCap(int end)
Sets the end cap in the IlvPolylineStyle object.

Overrides:
setEndCap in class IlvPolyline
Parameters:
end - The end cap to be set in the IlvPolylineStyle object.
See Also:
IlvStroke

getEndCap

public int getEndCap()
Retrieves the end cap from the style.

Overrides:
getEndCap in class IlvPolyline
Returns:
The end cap as set in the IlvPolylineStyle object.
See Also:
IlvStroke

setForeground

public void setForeground(Color color)
Sets the foreground in the IlvPolylineStyle object.

Overrides:
setForeground in class IlvPolyline
Parameters:
color - The foreground to be set in the IlvPolylineStyle object.
See Also:
IlvGraphic.draw(Graphics, IlvTransformer), IlvGraphic.setBackground(Color), IlvGraphic.setFillOn(boolean), IlvGraphic.setStrokeOn(boolean), IlvGraphic

getForeground

public Color getForeground()
Retrieves the foreground from the style.

Overrides:
getForeground in class IlvPolyline
Returns:
The foreground as set in the IlvPolylineStyle object.

setLineJoin

public void setLineJoin(int join)
Sets the line join in the IlvPolylineStyle object.

Overrides:
setLineJoin in class IlvPolyline
Parameters:
join - The line join to be set in the IlvPolylineStyle object.
See Also:
IlvStroke

getLineJoin

public int getLineJoin()
Retrieves the line join from the style.

Overrides:
getLineJoin in class IlvPolyline
Returns:
The line join as set in the IlvPolylineStyle object.
See Also:
IlvStroke

setLineStyle

public void setLineStyle(float[] s)
Sets the line style in the IlvPolylineStyle object.

Overrides:
setLineStyle in class IlvPolyline
Parameters:
s - The line style to be set in the IlvPolylineStyle object.

getLineStyle

public float[] getLineStyle()
Retrieves the line style from the style.

Overrides:
getLineStyle in class IlvPolyline
Returns:
The line style as set in the IlvPolylineStyle object.

setLineWidth

public void setLineWidth(float width)
Sets the line width in the IlvPolylineStyle object.

Overrides:
setLineWidth in class IlvPolyline
Parameters:
width - The line width to be set in the IlvPolylineStyle object.

getLineWidth

public float getLineWidth()
Retrieves the line width from the style.

Overrides:
getLineWidth in class IlvPolyline
Returns:
The line width as set in the IlvPolylineStyle object.

getMaximumLineWidth

public float getMaximumLineWidth()
Retrieves the maximum line width from the style.

Overrides:
getMaximumLineWidth in class IlvPolyline
Returns:
The line width as set in the IlvPolylineStyle object.

setBackground

public void setBackground(Color color)
Sets the background in the IlvPolylineStyle object.

Overrides:
setBackground in class IlvGraphic
Parameters:
color - The maximum line style to be set in the IlvPolylineStyle object.
See Also:
IlvGraphic.draw(Graphics, IlvTransformer), IlvGraphic.setForeground(Color), IlvGraphic.setFillOn(boolean), IlvGraphic.setStrokeOn(boolean), IlvGraphic

getBackground

public Color getBackground()
Retrieves the background from the style.

Returns:
The background as set in the IlvPolylineStyle object.

getStyle

public IlvMapStyle getStyle()
Retrieves the IlvMapStyle attached to this graphic.

Specified by:
getStyle in interface IlvMapGraphic
Returns:
The IlvMapStyle attached to this graphic.

setStyle

public void setStyle(IlvMapStyle stl)
Implements the IlvMapGraphic interface.

Specified by:
setStyle in interface IlvMapGraphic
Parameters:
stl - The IlvMapStyle object to set. Must be an IlvPolylineStyle instance.

draw

public void draw(Graphics graphics,
                 IlvTransformer t)
Draws this IlvMapPolyline object with the specified graphics and transformer.

Overrides:
draw in class IlvPolyline
Parameters:
graphics - The graphics to draw to.
t - The view transformer.
See Also:
IlvGraphic.boundingBox(ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

drawDecoration

protected void drawDecoration(Graphics2D g,
                              IlvTransformer t)
Draws the decoration if there is one.

Parameters:
g - The current Graphics2D instance.
t - The current IlvTransformer instance.
Since:
JViews 7.5

boundingBox

public IlvRect boundingBox(IlvTransformer t)
Returns the bounding rectangle of this object.

Specified by:
boundingBox in interface IlvPolyPointsInterface
Overrides:
boundingBox in class IlvPolyline
Parameters:
t - The transformer used to draw the object.
Returns:
The bounding rectangle of the object in transformed coordinates.
See Also:
IlvPolyline.boundingBox(ilog.views.IlvTransformer)

contains

public boolean contains(IlvPoint p,
                        IlvPoint tp,
                        IlvTransformer t)
Tests if a point lies within the outline of this object.

Overrides:
contains in class IlvPolyline
Parameters:
p - The point to be tested.
tp - The point p transformed by the transformer t.
t - The transformation that was applied to the object when it was drawn.
Returns:
If the object contains the point, true is returned.
See Also:
IlvGraphic

copy

public IlvGraphic copy()
Copies the object.

Overrides:
copy in class IlvPolyline
Returns:
A new IlvMapPolyline instance.
See Also:
IlvGraphic

copy

public IlvGraphic copy(IlvCoordinateTransformation transform)
                throws IlvCoordinateTransformationException
Copies the element and applies the specified transformation to its coordinates.

Specified by:
copy in interface IlvMapGraphic
Parameters:
transform - Transformation to apply.
Returns:
A new copied object.
Throws:
IlvCoordinateTransformationException
See Also:
IlvMapGraphic.copy(ilog.views.maps.srs.coordtrans.IlvCoordinateTransformation)

isPreciseContains

public static boolean isPreciseContains()
Tests if the contains method is performing a precise and costly check.

Returns:
If the contains method performs precise check, true is returned.
Since:
JViews 7.5

setPreciseContains

public static void setPreciseContains(boolean pc)
Set to true if the contains method should perform a precise and costly check.

Parameters:
pc - Set to true to perform a precise check.
Since:
JViews 7.5

makeGeometry

public IlvMapGeometry makeGeometry()
Returns an IlvMapLineString geometry.

Specified by:
makeGeometry in interface IlvMapGraphic
Returns:
An IlvMapLineString geometry.
Since:
JViews 8.0
See Also:
IlvMapGraphic.makeGeometry()


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