ilog.views.maps.graphic
Class IlvMapGraphicPath

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.graphic.IlvGraphicPath
          extended by ilog.views.maps.graphic.IlvMapGraphicPath
All Implemented Interfaces:
IlvPersistentObject, IlvMapGraphic, Transferable, Serializable
Direct Known Subclasses:
IlvMapAnnotationToolBar.MapGraphicPath

public class IlvMapGraphicPath
extends IlvGraphicPath
implements IlvMapGraphic

IlvMapGraphicPath is an IlvGraphicPath that accepts an IlvGraphicPathStyle to define its graphical attributes.

Since:
JViews 7.5
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ilog.views.graphic.IlvGraphicPath
FILL_ONLY, STROKE_AND_FILL, STROKE_ONLY
 
Constructor Summary
IlvMapGraphicPath(IlvInputStream stream)
          Reads the object from an IlvInputStream.
IlvMapGraphicPath(IlvMapGraphicPath source)
          Creates a new IlvMapGraphicPath instance by copying an existing one.
IlvMapGraphicPath(IlvPoint[] points, boolean copy)
          Creates an IlvMapGraphicPath instance containing only one polypoint.
IlvMapGraphicPath(IlvPointArray[] paths, boolean copy)
          Creates an IlvMapGraphicPath object containing several polypoints.
 
Method Summary
 IlvRect boundingBox(IlvTransformer t)
          This overridden method takes the decoration size into account.
 boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the shape of the object.
 IlvGraphic copy()
          Copies the objects.
 IlvGraphic copy(IlvCoordinateTransformation transform)
          Copies the element and applies the specified transformation to its coordinates.
 void draw(Graphics dst, IlvTransformer t)
          Specific drawing method to display decorations.
 boolean equals(Object o)
           Checks whether two graphic paths are the same.
 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 getDrawRule()
          Overrides IlvGraphicPath.getDrawRule to take the style into account.
 Color getForeground()
          Retrieves the foreground 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.
 Paint getPaint()
          Retrieves the Paint instance from the style.
 IlvMapStyle getStyle()
          Retrieves the IlvMapStyle instance attached to this graphic.
 boolean isDecorationOnly()
          Returns true if the decoration of this decorated path is to be drawn.
 IlvMapGeometry makeGeometry()
          Returns an IlvMapPolygon geometry.
 void setBackground(Color color)
          Sets the background in the IlvGraphicPathStyle object.
 void setDecoration(IlvPathDecoration decoration)
          Sets the decoration for this decorated path.
 void setDecorationOnly(boolean set)
          Sets if the decoration of this decorated path is to be drawn.
 void setDecorationPaint(Paint p)
          Sets the Paint object used to draw the decoration.
 void setForeground(Color color)
          Sets the foreground in the IlvGraphicPathStyle object.
 void setLineStyle(float[] style)
          Sets the line style in the IlvGraphicPathStyle object.
 void setLineWidth(float width)
          Sets the line width in the IlvGraphicPathStyle object.
 void setMaximumLineWidth(float width)
          Sets the maximum line width in the IlvGraphicPathStyle object.
 void setPaint(Paint paint)
          Sets the Paint instance in the IlvGraphicPathStyle object.
 void setStyle(IlvMapStyle style)
          Implements the IlvMapGraphic interface.
 void write(IlvOutputStream stream)
          Writes this IlvMapGraphicPath object to the IlvOutputStream passed as a parameter.
 
Methods inherited from class ilog.views.graphic.IlvGraphicPath
applyTransform, getIntersectionWithOutline, getNumPaths, getPaths, setDrawRule, setPaths, setPaths
 
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, intersects, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isPersistent, isSelectable, isVisible, makeSelection, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvMapGraphicPath

public IlvMapGraphicPath(IlvMapGraphicPath source)
Creates a new IlvMapGraphicPath instance by copying an existing one.

Parameters:
source - The object to be copied.

IlvMapGraphicPath

public IlvMapGraphicPath(IlvPointArray[] paths,
                         boolean copy)
Creates an IlvMapGraphicPath object containing several polypoints.

Parameters:
paths - The array of polypoints.
copy - Set to true so the array of points is copied before being used by the class. Set to false so the array is stored internally in the object. If this is the case, you must not use the array anymore.

IlvMapGraphicPath

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

Parameters:
stream - The input stream.
Throws:
IlvReadFileException - if the format is not correct.

IlvMapGraphicPath

public IlvMapGraphicPath(IlvPoint[] points,
                         boolean copy)
Creates an IlvMapGraphicPath instance containing only one polypoint.

Parameters:
points - The array of points of the polypoint.
copy - Set to true so the array of points is copied before being used by the class. Set to false so the array is stored internally in the object. If this is the case, you must not use the array anymore.
Method Detail

write

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

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

draw

public void draw(Graphics dst,
                 IlvTransformer t)
Specific drawing method to display decorations.

Overrides:
draw in class IlvGraphicPath
Parameters:
dst - The destination Graphics object.
t - The transformation used to draw the object.
See Also:
IlvGraphic.boundingBox(ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

boundingBox

public IlvRect boundingBox(IlvTransformer t)
This overridden method takes the decoration size into account.

Overrides:
boundingBox in class IlvGraphicPath
Parameters:
t - The transformer.
See Also:
IlvGraphicPath.boundingBox(ilog.views.IlvTransformer)

contains

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

Overrides:
contains in class IlvGraphicPath
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:
true if the point lies inside this graphic object.
See Also:
IlvGraphicPath.contains(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)

getStyle

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

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

setStyle

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

Specified by:
setStyle in interface IlvMapGraphic
Parameters:
style - The IlvMapStyle to set. Must be a IlvGeneralPathStyle instance.

getDrawRule

public int getDrawRule()
Overrides IlvGraphicPath.getDrawRule to take the style into account.

Overrides:
getDrawRule in class IlvGraphicPath
Returns:
The draw rule as defined in the style if one has been set.
Since:
JViews 8.0
See Also:
IlvGraphicPath.setDrawRule(int)

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 instance 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 if the decoration of this decorated path is to be drawn.

Parameters:
set - Set to true so the decoration is drawn.

setBackground

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

Overrides:
setBackground in class IlvGraphicPath
Parameters:
color - The background to be set in the IlvGraphicPathStyle 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.

Overrides:
getBackground in class IlvGraphicPath
Returns:
The background as set in the IlvGraphicPathStyle object.

setForeground

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

Overrides:
setForeground in class IlvGraphicPath
Parameters:
color - The foreground to be set in the IlvGraphicPathStyle 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 IlvGraphicPath
Returns:
The foreground as set in the IlvGraphicPathStyle object.

setPaint

public void setPaint(Paint paint)
Sets the Paint instance in the IlvGraphicPathStyle object.

Parameters:
paint - The Paint instance to be set in the IlvGraphicPathStyle object.

getPaint

public Paint getPaint()
Retrieves the Paint instance from the style.

Returns:
The Paint instance as set in the IlvGraphicPathStyle object.

setLineWidth

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

Parameters:
width - The line width to be set in the IlvGraphicPathStyle object.

getLineWidth

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

Returns:
The line width as set in the IlvGraphicPathStyle object.

setLineStyle

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

Parameters:
style - The line style to be set in the IlvGraphicPathStyle object.

getLineStyle

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

Returns:
The line style as set in the IlvGraphicPathStyle object.

setMaximumLineWidth

public void setMaximumLineWidth(float width)
Sets the maximum line width in the IlvGraphicPathStyle object.

Parameters:
width - The line width to be set in the IlvGraphicPathStyle object.

getMaximumLineWidth

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

Returns:
The maximum line width set in the IlvGraphicPathStyle object.

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.

copy

public IlvGraphic copy()
Copies the objects.

Overrides:
copy in class IlvGraphicPath
Returns:
A new IlvMapGraphicPath object.
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)

makeGeometry

public IlvMapGeometry makeGeometry()
Returns an IlvMapPolygon geometry.

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

equals

public boolean equals(Object o)
Checks whether two graphic paths are the same.

Overrides:
equals in class Object


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