ilog.views.maps.graphic
Class IlvAnchoredLabel

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.maps.graphic.IlvAnchoredLabel
All Implemented Interfaces:
IlvPersistentObject, Transferable, Serializable

public class IlvAnchoredLabel
extends IlvGraphic

A subclass of IlvGraphic containing a label and an IlvGraphic. A line can be drawn to join the label and the center of the reference IlvGraphic.

Since:
JViews 5.0
See Also:
Serialized Form

Constructor Summary
IlvAnchoredLabel(IlvAnchoredLabel source)
          Constructs an IlvAnchoredLabel by copying an existing one.
IlvAnchoredLabel(IlvGraphic reference, IlvMapLabel label)
          Constructs an IlvAnchoredLabel by specifying a reference IlvGraphic and an IlvMapLabel.
IlvAnchoredLabel(IlvInputStream stream)
          Reads an IlvAnchoredLabel from an IlvInputStream.
 
Method Summary
 void applyTransform(IlvTransformer t)
          Applies the transformation t to the IlvAnchoredLabel.
 IlvRect boundingBox(IlvTransformer t)
          Computes the bounding box of the IlvAnchoredLabel at transformer t.
 boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Overrides the default method to only return true when the point is in the label, the reference, or the line.
 IlvGraphic copy()
          Returns a copy of the IlvAnchoredLabel.
 void draw(Graphics g, IlvTransformer t)
          Draws the IlvAnchoredLabel at transformer t.
protected  void drawLine(Graphics g, IlvTransformer t)
          Draws the line between the reference point and the IlvMapLabel.
static IlvAnchoredLabel GetAnchoredLabel(IlvMapLabel label)
          Retrieves the IlvAnchoredLabel from an IlvMapLabel.
 IlvMapLabel getLabel()
          Retrieves the IlvMapLabel.
 Color getLineColor()
          Retrieves the color used to draw the line.
 IlvGraphic getReference()
          Retrieves the reference IlvGraphic.
 IlvPoint getReferencePoint()
          Retrieves the reference point.
 boolean isLineVisible()
          Tells if the IlvAnchoredLabel is displaying the line.
 IlvSelection makeSelection()
          Creates a selection object for this graphic object.
 void moveLabel(IlvPoint p)
          Moves the IlvMapLabel contained in this IlvAnchoredLabel.
 void setLabelOffset(float dx, float dy)
          Sets the label offset of this IlvAnchoredLabel if the label exists.
 void setLineColor(Color color)
          Sets the color used to draw the line.
 void setLineVisible(boolean visible)
          Tells the IlvAnchoredLabel if it should display the line.
 void setReference(IlvGraphic g)
          Sets the reference IlvGraphic.
 void setReferencePoint(IlvPoint reference)
          Sets the reference point.
 void write(IlvOutputStream stream)
          Writes this IlvAnchoredLabel into an IlvOutputStream.
 boolean zoomable()
          Returns always false.
 
Methods inherited from class ilog.views.IlvGraphic
addActionListener, addNamedPropertyListener, boundingBox, getAndAssociateObjectInteractor, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, hasProperty, inside, intersects, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isPersistent, isSelectable, isVisible, move, move, moveResize, notifyObjectInteractorToManager, processActionEvent, reDraw, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setEditable, setFillOn, setForeground, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipText, setVisible, toString, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvAnchoredLabel

public IlvAnchoredLabel(IlvGraphic reference,
                        IlvMapLabel label)
Constructs an IlvAnchoredLabel by specifying a reference IlvGraphic and an IlvMapLabel. The reference is not allowed to be null.


IlvAnchoredLabel

public IlvAnchoredLabel(IlvInputStream stream)
                 throws IlvReadFileException
Reads an IlvAnchoredLabel from an IlvInputStream.

Throws:
IlvReadFileException

IlvAnchoredLabel

public IlvAnchoredLabel(IlvAnchoredLabel source)
Constructs an IlvAnchoredLabel by copying an existing one.

Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes this IlvAnchoredLabel into an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvGraphic
Parameters:
stream - The output stream to write this graphic object to.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

GetAnchoredLabel

public static IlvAnchoredLabel GetAnchoredLabel(IlvMapLabel label)
Retrieves the IlvAnchoredLabel from an IlvMapLabel.


getReferencePoint

public IlvPoint getReferencePoint()
Retrieves the reference point. If no reference point has been set, a reference point is computed as the center of the reference object bounding box.


setReferencePoint

public void setReferencePoint(IlvPoint reference)
Sets the reference point.


getReference

public IlvGraphic getReference()
Retrieves the reference IlvGraphic.


setReference

public void setReference(IlvGraphic g)
Sets the reference IlvGraphic.

Since:
JViews 5.5

getLabel

public IlvMapLabel getLabel()
Retrieves the IlvMapLabel.


boundingBox

public IlvRect boundingBox(IlvTransformer t)
Computes the bounding box of the IlvAnchoredLabel at transformer t.

Specified by:
boundingBox in class IlvGraphic
Parameters:
t - The transformer used to draw the object. If the transformer is null, the bounding box for the identity transformer is returned.
See Also:
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

draw

public void draw(Graphics g,
                 IlvTransformer t)
Draws the IlvAnchoredLabel at transformer t.

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

applyTransform

public void applyTransform(IlvTransformer t)
Applies the transformation t to the IlvAnchoredLabel.

Specified by:
applyTransform in class IlvGraphic
Parameters:
t - The transformation to be applied.
See Also:
IlvGraphic

contains

public boolean contains(IlvPoint p,
                        IlvPoint tp,
                        IlvTransformer t)
Overrides the default method to only return true when the point is in the label, the reference, or the line.

Overrides:
contains in class IlvGraphic
Parameters:
p - The point.
tp - The transformed point.
t - The transformer.
Returns:
When the point is in the label, the reference, or the line, true is returned.
Since:
JViews 8.1
See Also:
IlvGraphic.contains(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)

zoomable

public boolean zoomable()
Returns always false. This object is not zoomable because it contains a fixed size point.

Overrides:
zoomable in class IlvGraphic
See Also:
IlvGraphic, IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer), IlvGraphic.boundingBox(IlvTransformer), IlvManager

copy

public IlvGraphic copy()
Returns a copy of the IlvAnchoredLabel.

Specified by:
copy in class IlvGraphic
Returns:
A copy of this IlvGraphic instance.
See Also:
IlvGraphic

moveLabel

public void moveLabel(IlvPoint p)
Moves the IlvMapLabel contained in this IlvAnchoredLabel. Since this operation can change the bounding box of the object, this method calls the graphic bag applyToObject method on the IlvMapLabel.


setLabelOffset

public void setLabelOffset(float dx,
                           float dy)
Sets the label offset of this IlvAnchoredLabel if the label exists.


drawLine

protected void drawLine(Graphics g,
                        IlvTransformer t)
Draws the line between the reference point and the IlvMapLabel. If the point is inside the label, no line is drawn.


makeSelection

public IlvSelection makeSelection()
Creates a selection object for this graphic object. Because this object cannot be resized using the interactor, the implementation of this method creates an instance of the class IlvUnresizeableDrawSelection.

Overrides:
makeSelection in class IlvGraphic
See Also:
IlvDrawSelection

setLineColor

public void setLineColor(Color color)
Sets the color used to draw the line.


getLineColor

public Color getLineColor()
Retrieves the color used to draw the line.


setLineVisible

public void setLineVisible(boolean visible)
Tells the IlvAnchoredLabel if it should display the line.


isLineVisible

public boolean isLineVisible()
Tells if the IlvAnchoredLabel is displaying the line.



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