ilog.views.maps.graphic
Class IlvFontMarker

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

public class IlvFontMarker
extends IlvGraphic

An IlvGraphic which can display a specified character with a specified font. An IllegalArgumentException is thrown if the character cannot be displayed by the specified font.

Since:
JViews 5.0
See Also:
Serialized Form

Constructor Summary
IlvFontMarker(IlvFontMarker source)
          Creates an IlvFontMarker by copying an existing one.
IlvFontMarker(IlvInputStream stream)
          Reads an IlvFontMarker from the specified stream.
IlvFontMarker(IlvPoint point, Font font, char car)
          Creates a new IlvFontMarker specifying its position, font and character.
 
Method Summary
 void applyTransform(IlvTransformer t)
          Applies a transformation to the shape of the object.
 IlvRect boundingBox(IlvTransformer t)
          Returns the bounding rectangle of the object.
 IlvGraphic copy()
          Returns a copy of this object.
 void draw(Graphics dst, IlvTransformer t)
          Draws this object.
 char getChar()
          Retrieves the character displayed by this object.
 Paint getFillPaint()
          Retrieves the Paint used to fill the character.
 Font getFont()
          Retrieves the font used by this object.
 IlvPoint getPoint()
          Retrieves the position point.
 double getRotation()
          Retrieves the rotation angle.
 Paint getStrokePaint()
          Retrieves the Paint used to draw the outline of the character.
 boolean isAntialiasing()
          Returns the antialiased status.
 IlvSelection makeSelection()
          Creates a selection object for this graphic object.
 void setAntialiasing(boolean antialiased)
          Specifies if the drawing of the character is antialiased or not.
 void setChar(char car)
          Sets the character to be displayed.
 void setFillPaint(Paint paint)
          Sets the paint used to fill the character.
 void setFont(Font font)
          Sets a new font for this marker.
 void setPoint(IlvPoint point)
          Sets a new position point for this marker.
 void setRotation(double angle)
          Sets the rotation angle.
 void setStrokePaint(Paint paint)
          Sets the paint used to draw the outline of the character.
 void write(IlvOutputStream stream)
          Writes this object in an IlvOutputStream.
 boolean zoomable()
          Returns false because this object is not 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, 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

IlvFontMarker

public IlvFontMarker(IlvPoint point,
                     Font font,
                     char car)
              throws IllegalArgumentException
Creates a new IlvFontMarker specifying its position, font and character. The character will be positioned with the reference point as center.

Parameters:
point - The anchor point.
font - The font.
car - The character to display.
Throws:
IllegalArgumentException - If the character cannot be displayed by the font.

IlvFontMarker

public IlvFontMarker(IlvFontMarker source)
Creates an IlvFontMarker by copying an existing one.

Parameters:
source - The IlvFontMarker to copy.

IlvFontMarker

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

Parameters:
stream - The stream from which the object is read.
Throws:
IlvReadFileException
Method Detail

setPoint

public void setPoint(IlvPoint point)
Sets a new position point for this marker.

Parameters:
point - The new position.

getPoint

public IlvPoint getPoint()
Retrieves the position point.

Returns:
The position of the IlvFontMarker. The returned point should not be modified.

setFont

public void setFont(Font font)
             throws IllegalArgumentException
Sets a new font for this marker.

Parameters:
font - The new font.
Throws:
IllegalArgumentException - If the character cannot be displayed by the font.

getFont

public Font getFont()
Retrieves the font used by this object.

Returns:
The font used by this object.

setChar

public void setChar(char car)
Sets the character to be displayed.

Parameters:
car - The new character.
Throws:
IllegalArgumentException - If the character cannot be displayed by the font.

getChar

public char getChar()
Retrieves the character displayed by this object.

Returns:
The character displayed by this object.

setAntialiasing

public void setAntialiasing(boolean antialiased)
Specifies if the drawing of the character is antialiased or not.

Parameters:
antialiased - The character will be drawn antialiased or not according to the value of the antialiased parameter.

isAntialiasing

public boolean isAntialiasing()
Returns the antialiased status.

Returns:
true if the character is drawn antialiased, false otherwise.

write

public void write(IlvOutputStream stream)
           throws IOException
Writes this object in an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvGraphic
Parameters:
stream - The stream to write in.
Throws:
IOException - If a write problem occurs.

copy

public IlvGraphic copy()
Returns a copy of this object.

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

draw

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

Specified by:
draw in class IlvGraphic
Parameters:
dst - 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 a transformation to the shape of the object. Since the object is not zoomable, only the center point will be transformed.

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

setStrokePaint

public void setStrokePaint(Paint paint)
Sets the paint used to draw the outline of the character.

Parameters:
paint - the Paint.

getStrokePaint

public Paint getStrokePaint()
Retrieves the Paint used to draw the outline of the character.

Returns:
The Paint used to draw the outline of the character.

setFillPaint

public void setFillPaint(Paint paint)
Sets the paint used to fill the character.

Parameters:
paint - The Paint.

getFillPaint

public Paint getFillPaint()
Retrieves the Paint used to fill the character.

Returns:
The Paint used to fill the character.

setRotation

public void setRotation(double angle)
Sets the rotation angle.


getRotation

public double getRotation()
Retrieves the rotation angle.


boundingBox

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

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

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

zoomable

public boolean zoomable()
Returns false because this object is not zoomable.

Overrides:
zoomable in class IlvGraphic
Returns:
false because this object is not zoomable.
See Also:
IlvGraphic, IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer), IlvGraphic.boundingBox(IlvTransformer), IlvManager


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