ilog.views.maps.graphic
Class IlvMapGraphicText

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.maps.graphic.IlvMapLabel
          extended by ilog.views.maps.graphic.IlvMapGraphicText
All Implemented Interfaces:
IlvFontInterface, IlvLabelInterface, IlvPersistentObject, IlvMapGraphic, Transferable, Serializable

public class IlvMapGraphicText
extends IlvMapLabel
implements IlvMapGraphic

IlvMapGraphicText is an extention of the IlvMapLabel graphic object that reads the properties it will have from an IlvMapStyle instance.

Since:
JViews 7.5
See Also:
Serialized Form

Constructor Summary
IlvMapGraphicText(IlvInputStream stream)
          Reads an IlvMapGraphicText from an IlvInputStream.
IlvMapGraphicText(IlvMapGraphicText source)
          Creates a copy of an existing IlvMapGraphicText object.
IlvMapGraphicText(IlvPoint anchor, String labels)
          Creates an instance of the label specifying the point that is the anchor of the label and the multiline (newline separated) text to be displayed.
IlvMapGraphicText(IlvRect anchor, String labels)
          Creates an instance of the label specifying a rectangle as the anchor of the label.
 
Method Summary
 IlvGraphic copy()
          Returns a copy of this IlvMapGraphicText instance.
 IlvGraphic copy(IlvCoordinateTransformation transform)
          Copies the element and applies the specified transformation to its coordinates.
 void draw(Graphics g, IlvTransformer t)
          Draws this object.
 int getAlignment()
          Returns the alignment of the label from the style.
 int getAttachment()
          Returns the attachment of the label from the style.
 Paint getBackgroundPaint()
          Returns the Paint object used to fill the frame of the label.
 Paint getFillPaint()
          Returns the Paint object used to fill the characters in the text.
 Font getFont()
          Returns the font used to draw the label.
 Paint getFramePaint()
          Returns the Paint object used to draw the frame of the label.
 float getInnerMargin()
          Returns the margin.
 float getInterline()
          Returns the interline value.
 int getMaximumHeight()
          Returns the maximum height of the label.
 int getMinimunHeight()
          Returns the minimum height of the label.
 Paint getStrokePaint()
          Returns the Paint object used to draw the outline of the characters in the text.
 IlvMapStyle getStyle()
          Retrieves the IlvMapStyle.
 boolean isAntialiasing()
          Returns true if the anti-aliasing mode of the label is on.
 boolean isFitToRect()
          Indicates whether the label will be scaled to fit the rectangular anchor or not
 IlvMapGeometry makeGeometry()
          Returns an IlvMapText geometry.
 void setAlignment(int alignment)
          Sets the alignment of the label.
 void setAntialiasing(boolean antialiasing)
          Changes the anti-aliasing mode of the label.
 void setAttachment(int attachment)
          Sets the label attachment.
 void setBackgroundPaint(Paint c)
          Sets the Paint object used to fill the frame of the label.
 void setFillPaint(Paint c)
          Sets the Paint object used to fill the characters in the text.
 void setFitToRect(boolean fit)
          Determines whether the label should be scaled to fit the rectangular anchor or not
 void setFont(Font font)
          Sets the font used to draw the label.
 void setFramePaint(Paint c)
          Sets the Paint object used to draw the frame of the label.
 void setInnerMargin(float margin)
          Sets the spacing between the frame of the label and the text.
 void setInterline(float interline)
          Sets the spacing between two lines.
 void setMaximumHeight(int max)
          Sets the maximum height of the label.
 void setMinimumHeight(int min)
          Sets the minimum height of the text.
 void setStrokePaint(Paint c)
          Sets the Paint object used to draw the outline of the characters in the text.
 void setStyle(IlvMapStyle stl)
          Implements the IlvMapGraphic interface.
 void write(IlvOutputStream stream)
          Writes this IlvMapGraphicText object to an IlvOutputStream.
 
Methods inherited from class ilog.views.maps.graphic.IlvMapLabel
applyTransform, boundingBox, getAnchor, getLabel, getLabelBBox, getMaximumLineHeight, getMinimumHeight, getOffset, getRectAnchor, getTransformer, invalidate, isUsingFractionalMetrics, isVisible, setAnchor, setLabel, setMaximumLineHeight, setOffset, setOffset, setRectAnchor, setTransformer, setUsingFractionalMetrics, supportMultiline, zoomable
 
Methods inherited from class ilog.views.IlvGraphic
addActionListener, addNamedPropertyListener, boundingBox, contains, 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, makeSelection, 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

IlvMapGraphicText

public IlvMapGraphicText(IlvPoint anchor,
                         String labels)
Creates an instance of the label specifying the point that is the anchor of the label and the multiline (newline separated) text to be displayed.

Parameters:
anchor - The anchor point.
labels - The text to be displayed.

IlvMapGraphicText

public IlvMapGraphicText(IlvRect anchor,
                         String labels)
Creates an instance of the label specifying a rectangle as the anchor of the label. The rectangle defines the position and height of the label.

Parameters:
anchor - The rectangular anchor.
labels - The text to be displayed.

IlvMapGraphicText

public IlvMapGraphicText(IlvMapGraphicText source)
Creates a copy of an existing IlvMapGraphicText object.

Parameters:
source - The IlvMapGraphicText object to be copied.

IlvMapGraphicText

public IlvMapGraphicText(IlvInputStream stream)
                  throws IlvReadFileException
Reads an IlvMapGraphicText 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 IlvMapGraphicText object to an IlvOutputStream.

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

copy

public IlvGraphic copy()
Returns a copy of this IlvMapGraphicText instance.

Overrides:
copy in class IlvMapLabel
Returns:
A copy of this IlvMapGraphicText 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)

getStyle

public IlvMapStyle getStyle()
Retrieves the IlvMapStyle.

Specified by:
getStyle in interface IlvMapGraphic
Returns:
The IlvMapStyle.
See Also:
IlvMapGraphic.getStyle()

setStyle

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

Specified by:
setStyle in interface IlvMapGraphic
Parameters:
stl - The IlvMapStyle object to set. This parameter must be an IlvMapTextStyle instance.

getAlignment

public int getAlignment()
Returns the alignment of the label from the style.

Overrides:
getAlignment in class IlvMapLabel
Returns:
The alignment of the label.

getAttachment

public int getAttachment()
Returns the attachment of the label from the style.

Overrides:
getAttachment in class IlvMapLabel
Returns:
The attachment of the label.

getBackgroundPaint

public Paint getBackgroundPaint()
Returns the Paint object used to fill the frame of the label.

Overrides:
getBackgroundPaint in class IlvMapLabel
Returns:
The background paint.

getFillPaint

public Paint getFillPaint()
Returns the Paint object used to fill the characters in the text.

Overrides:
getFillPaint in class IlvMapLabel
Returns:
The fill paint.

getFont

public Font getFont()
Returns the font used to draw the label.

Specified by:
getFont in interface IlvFontInterface
Overrides:
getFont in class IlvMapLabel
Returns:
The font used to draw the label.

getFramePaint

public Paint getFramePaint()
Returns the Paint object used to draw the frame of the label.

Overrides:
getFramePaint in class IlvMapLabel
Returns:
The frame paint.

getInnerMargin

public float getInnerMargin()
Returns the margin.

Overrides:
getInnerMargin in class IlvMapLabel
Returns:
The margin value.

getInterline

public float getInterline()
Returns the interline value.

Overrides:
getInterline in class IlvMapLabel
Returns:
The interline.

getMaximumHeight

public int getMaximumHeight()
Returns the maximum height of the label.

Overrides:
getMaximumHeight in class IlvMapLabel
Returns:
The maximum height of the label.

getMinimunHeight

public int getMinimunHeight()
Returns the minimum height of the label.

Overrides:
getMinimunHeight in class IlvMapLabel
Returns:
The minimum height of the label.

getStrokePaint

public Paint getStrokePaint()
Returns the Paint object used to draw the outline of the characters in the text.

Overrides:
getStrokePaint in class IlvMapLabel
Returns:
The stroke paint.

isAntialiasing

public boolean isAntialiasing()
Returns true if the anti-aliasing mode of the label is on.

Overrides:
isAntialiasing in class IlvMapLabel
Returns:
If the anti-aliasing mode of the label is on, true is returned.

setAlignment

public void setAlignment(int alignment)
Sets the alignment of the label. The alignment is only taken into account when the anchor is a rectangular anchor.
Valid values are :

Overrides:
setAlignment in class IlvMapLabel
Parameters:
alignment - The alignment.

setAntialiasing

public void setAntialiasing(boolean antialiasing)
Changes the anti-aliasing mode of the label. Changing this mode may change the bounding box of the object.

Overrides:
setAntialiasing in class IlvMapLabel
Parameters:
antialiasing - The new anti-aliasing value.

setAttachment

public void setAttachment(int attachment)
Sets the label attachment. Valid values for attachment are:

Overrides:
setAttachment in class IlvMapLabel
Parameters:
attachment - The attachment.

setBackgroundPaint

public void setBackgroundPaint(Paint c)
Sets the Paint object used to fill the frame of the label.

Overrides:
setBackgroundPaint in class IlvMapLabel
Parameters:
c - The Paint used to fill the frame of the label.

setFillPaint

public void setFillPaint(Paint c)
Sets the Paint object used to fill the characters in the text.

Overrides:
setFillPaint in class IlvMapLabel
Parameters:
c - The fill paint.

setFont

public void setFont(Font font)
Sets the font used to draw the label.

Specified by:
setFont in interface IlvFontInterface
Overrides:
setFont in class IlvMapLabel
Parameters:
font - The font.

setFramePaint

public void setFramePaint(Paint c)
Sets the Paint object used to draw the frame of the label.

Overrides:
setFramePaint in class IlvMapLabel
Parameters:
c - The frame paint object.

setInnerMargin

public void setInnerMargin(float margin)
Sets the spacing between the frame of the label and the text.

Overrides:
setInnerMargin in class IlvMapLabel
Parameters:
margin - The new margin.

setInterline

public void setInterline(float interline)
Sets the spacing between two lines.

Overrides:
setInterline in class IlvMapLabel
Parameters:
interline - The interline spacing.

setMaximumHeight

public void setMaximumHeight(int max)
Sets the maximum height of the label.

Overrides:
setMaximumHeight in class IlvMapLabel
Parameters:
max - The maximum height of the label.

setMinimumHeight

public void setMinimumHeight(int min)
Sets the minimum height of the text. Below this limit, the label will not be visible.

Overrides:
setMinimumHeight in class IlvMapLabel
Parameters:
min - The minimum height of the label.

setStrokePaint

public void setStrokePaint(Paint c)
Sets the Paint object used to draw the outline of the characters in the text.

Overrides:
setStrokePaint in class IlvMapLabel
Parameters:
c - The stroke paint.

setFitToRect

public void setFitToRect(boolean fit)
Determines whether the label should be scaled to fit the rectangular anchor or not

Overrides:
setFitToRect in class IlvMapLabel
Parameters:
fit - The fit to rect value.
See Also:
IlvMapLabel.setFitToRect(boolean)

isFitToRect

public boolean isFitToRect()
Indicates whether the label will be scaled to fit the rectangular anchor or not

Overrides:
isFitToRect in class IlvMapLabel
Returns:
true if this label will fit to rect anchor and false otherwise.
See Also:
IlvMapLabel.isFitToRect()

draw

public void draw(Graphics g,
                 IlvTransformer t)
Draws this object.

Overrides:
draw in class IlvMapLabel
Parameters:
g - The destination Graphics.
t - The transformation used to draw the object.
See Also:
IlvMapLabel.draw(java.awt.Graphics, ilog.views.IlvTransformer)

makeGeometry

public IlvMapGeometry makeGeometry()
Returns an IlvMapText geometry.

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


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