ilog.views.maps.rendering
Class IlvMapTextRenderingStyle

java.lang.Object
  extended by ilog.views.maps.rendering.IlvMapRenderingStyle
      extended by ilog.views.maps.rendering.IlvMapTextRenderingStyle
All Implemented Interfaces:
IlvPersistentObject

public class IlvMapTextRenderingStyle
extends IlvMapRenderingStyle

This rendering style stores style parameters to render the texts. This class is meant to be used by a IlvDefaultTextRenderer. The parameters stored in this class include paint style, alignment, font and scale.

Since:
JViews 5.0

Constructor Summary
IlvMapTextRenderingStyle()
          Constructs an IlvMapRenderingStyle with default values.
IlvMapTextRenderingStyle(IlvInputStream stream)
          Constructs an IlvMapRenderingStyle for an IlvInputStream.
 
Method Summary
 int getAlignment()
          Retrieves the alignment of the label.
 double getAngle()
          Retrieves the angle of rotation of the label.
 int getAttachment()
          Retrieves the attachment of the label.
 Paint getBackgroundPaint()
          Retrieves the background paint.
 Paint getFillPaint()
          Retrieves the fill paint.
 Font getFont()
          Retrieves the font used to display the label.
 Paint getFramePaint()
          Retrieves the frame stroke paint.
 int getInnerMargin()
          Retrieves the inner margin of the label.
 float getInterline()
          Retrieves interline of the label.
 int getMaximumHeight()
          Retrieves the maximum height of the label.
 int getMinimumHeight()
          Retrieves the minimum height of the label.
 float getScale()
          Retrieves the scale at which text is displayed with the nominal height of its font.
 double getScaleFactor(IlvCoordinateSystem cs)
          Returns the scale factor of a transformer that would show a map at the specified scale.
 Paint getStrokePaint()
          Retrieves the stroke paint.
 boolean isAntialiasing()
          Retrieves the antialiasing mode.
 void setAlignment(int alignment)
          Sets the alignment of the label.
 void setAngle(double angle)
          Sets the angle corresponding to the rotation of the label.
 void setAntialiasing(boolean antialiasing)
          Sets the antialiasing mode.
 void setAttachment(int attachment)
          Sets the attachment of the label.
 void setBackgroundPaint(Paint c)
          Sets the background paint.
 void setFillPaint(Paint c)
          Sets the fill paint.
 void setFont(Font font)
          Sets the font used to display the label.
 void setFramePaint(Paint paint)
          Sets the frame stroke paint.
 void setInnerMargin(int margin)
          Sets the inner margin of the label in pixels.
 void setInterline(float interline)
          Sets the interline of the label.
 void setMaximumHeight(int height)
          Sets the maximum height of the label in pixels.
 void setMinimumHeight(int height)
          Sets the minimum height of the label.
 void setScale(float scale)
          Sets the scale at which the label is displayed at font size .
 void setStrokePaint(Paint c)
          Sets the stroke paint of the label.
 void write(IlvOutputStream stream)
          Writes a IlvMapTextRenderingStyle into an IlvOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMapTextRenderingStyle

public IlvMapTextRenderingStyle()
Constructs an IlvMapRenderingStyle with default values. Default values are:


IlvMapTextRenderingStyle

public IlvMapTextRenderingStyle(IlvInputStream stream)
                         throws IlvReadFileException
Constructs an IlvMapRenderingStyle for an IlvInputStream.

Parameters:
stream - The IlvInputStream.
Throws:
IlvReadFileException
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes a IlvMapTextRenderingStyle into an IlvOutputStream.

Parameters:
stream - The IlvOutputStream.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

setBackgroundPaint

public void setBackgroundPaint(Paint c)
Sets the background paint. The background paint is used to fill the background of the label.

Parameters:
c - The background Paint.

getBackgroundPaint

public Paint getBackgroundPaint()
Retrieves the background paint. The background paint is used to fill the background of the label.

Returns:
The background paint.

setFillPaint

public void setFillPaint(Paint c)
Sets the fill paint. The fill paint is used to fill the characters of the label.

Parameters:
c - The fill Paint.

getFillPaint

public Paint getFillPaint()
Retrieves the fill paint. The fill paint is used to fill the characters of the label.

Returns:
The fill paint.

setStrokePaint

public void setStrokePaint(Paint c)
Sets the stroke paint of the label. The stroke paint is used to draw the outline of the characters of the label.

Parameters:
c - The stroke Paint.

getStrokePaint

public Paint getStrokePaint()
Retrieves the stroke paint. The stroke paint is used to draw the outline of the characters of the label.

Returns:
The stroke paint.

setFramePaint

public void setFramePaint(Paint paint)
Sets the frame stroke paint. The frame stroke paint is used to draw the frame of the label.

Parameters:
paint - The frame Paint.

getFramePaint

public Paint getFramePaint()
Retrieves the frame stroke paint.

Returns:
The frame paint.

setAlignment

public void setAlignment(int alignment)
Sets the alignment of the label. The alignment is used to align the text of the label with respect to a rectangle anchor. It is then only taken in account when the label is build using a rectangular anchor. Valid values are :

Parameters:
alignment - The alignment of the label.

getAlignment

public int getAlignment()
Retrieves the alignment of the label. The alignment is used to align the text of the label with respect to a rectangle anchor. It is then only taken in account when the label is build using a rectangular anchor.

Returns:
The alignment of the label.

setFont

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


getFont

public Font getFont()
Retrieves the font used to display the label.


setInterline

public void setInterline(float interline)
Sets the interline of the label. The interline is the spacing left between two consecutive lines of text. The interline is only taken in account when the text is a multiline text.


getInterline

public float getInterline()
Retrieves interline of the label. The interline is the spacing left between two consecutive lines of text. The interline is only taken in account when the text is a multiline text.


setAttachment

public void setAttachment(int attachment)
Sets the attachment of the label. The attachment specifies which side of the label lies on the anchor point.
Possible attachment values are:


getAttachment

public int getAttachment()
Retrieves the attachment of the label.

See Also:
setAttachment(int)

setMaximumHeight

public void setMaximumHeight(int height)
Sets the maximum height of the label in pixels. This value is only taken in account when the associated renderer produces an IlvMapLabel.


getMaximumHeight

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


setMinimumHeight

public void setMinimumHeight(int height)
Sets the minimum height of the label. Below this value, the label become invisible. This value is only taken in account when the associated renderer produces an IlvMapLabel.


getMinimumHeight

public int getMinimumHeight()
Retrieves the minimum height of the label.


setScale

public void setScale(float scale)
Sets the scale at which the label is displayed at font size . For other scales, the font size is enlarged or reduced in proportion to the zoom scale.

Parameters:
scale - Scale at which text is displayed with the nominal height of its font.

getScale

public float getScale()
Retrieves the scale at which text is displayed with the nominal height of its font.


getScaleFactor

public double getScaleFactor(IlvCoordinateSystem cs)
Returns the scale factor of a transformer that would show a map at the specified scale.

Parameters:
cs - The coordinate system.

setAntialiasing

public void setAntialiasing(boolean antialiasing)
Sets the antialiasing mode.


isAntialiasing

public boolean isAntialiasing()
Retrieves the antialiasing mode.


getInnerMargin

public int getInnerMargin()
Retrieves the inner margin of the label.


setInnerMargin

public void setInnerMargin(int margin)
Sets the inner margin of the label in pixels. This value is only taken into account when the associated renderer produces an IlvMapLabel.

Parameters:
margin - The margin.

setAngle

public void setAngle(double angle)
Sets the angle corresponding to the rotation of the label.

Parameters:
angle - The angle of rotation in degrees.
Since:
JViews 6.5

getAngle

public double getAngle()
Retrieves the angle of rotation of the label.

Returns:
The angle of rotation of the label in degrees.
Since:
JViews 6.5


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