|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.maps.graphic.IlvMapLabel
public class IlvMapLabel
A zoomable multiline label.
This IlvGraphic can display a label containing
more than one line of text. The lines can be separated by an
interline and aligned inside the label.
The anchor of the label can be either a point or a
rectangle. If the anchor is a point, an attachment can be
provided to specify the position of the label. If the anchor
is a rectangle, an alignment can be provided to align the lines
inside the rectangle.
The label string can contain newline characters which are recognized as
line separations.
| Constructor Summary | |
|---|---|
IlvMapLabel(IlvInputStream stream)
Reads an IlvMapLabel from an
IlvInputStream |
|
IlvMapLabel(IlvMapLabel source)
Creates an instance, copy of the source label. |
|
IlvMapLabel(IlvPoint anchor,
String labels)
Creates an instance of the label specifying the anchor of the label as a point and the multiline (newline separated) text. |
|
IlvMapLabel(IlvRect anchor,
String labels)
Creates an instance of the label specifying the anchor of the label as a rectangle, the multiline text . |
|
| Method Summary | |
|---|---|
void |
applyTransform(IlvTransformer t)
Applies the transformation on the label. |
IlvRect |
boundingBox(IlvTransformer transformer)
Retrieves the bounding box of the label. |
IlvGraphic |
copy()
Returns a copy of this label. |
void |
draw(Graphics g,
IlvTransformer t)
Draws this object. |
int |
getAlignment()
Retrieves the alignment of the label. |
IlvPoint |
getAnchor()
Retrieves the anchor point of the label. |
int |
getAttachment()
Retrieves the attachment of the label. |
Paint |
getBackgroundPaint()
Retrieves the Paint used to fill the frame
of the label. |
Paint |
getFillPaint()
Retrieves the Paint used to fill
the characters of the text. |
Font |
getFont()
Retrieves the font used to draw the label. |
Paint |
getFramePaint()
Retrieves the Paint used to draw the frame
of the label. |
float |
getInnerMargin()
Returns the margin. |
float |
getInterline()
Retrieves the interline value. |
String |
getLabel()
Returns the label as a string. |
IlvRect |
getLabelBBox(IlvTransformer transformer)
Returns the bounding area where the label is displayed. |
int |
getMaximumHeight()
Retrieves the maximum height of the label. |
int |
getMaximumLineHeight()
Retrieves the maximum line height of the label. |
int |
getMinimumHeight()
Retrieves the minimum height of the label. |
int |
getMinimunHeight()
Retrieves the minimum height of the label. |
IlvPoint |
getOffset()
Retrieves the offset (in pixels) relatively to the anchor position. |
IlvRect |
getRectAnchor()
Retrieves the anchor as a IlvRect if the label has been constructed
with the IlvMapLabel(IlvRect, String) |
Paint |
getStrokePaint()
Retrieves the Paint used to draw the outline
of the characters of the text. |
IlvTransformer |
getTransformer()
Retrieves a copy of the transformer applied on this label. |
protected void |
invalidate()
Indicates that this label needs to be updated. |
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 |
boolean |
isUsingFractionalMetrics()
Returns true if the fractional metrics mode
of the label is on. |
boolean |
isVisible(IlvTransformer transformer)
Checks the visibility of the label at transformer transformer. |
void |
setAlignment(int alignment)
Sets the alignment of the label. |
void |
setAnchor(IlvPoint point)
Sets the anchor point 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 used to fill the frame
of the label. |
void |
setFillPaint(Paint c)
Sets the Paint used to fill
the characters of 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 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 |
setLabel(String text)
Changes the label. |
void |
setMaximumHeight(int max)
Sets the maximum height of the label. |
void |
setMaximumLineHeight(int max)
Sets the maximum height of a line of the label. |
void |
setMinimumHeight(int min)
Sets the minimum height of the text. |
void |
setOffset(float dx,
float dy)
Sets the offset (in pixels) relatively to the anchor position. |
void |
setOffset(IlvPoint offset)
Sets the offset (in pixels) relatively to the anchor position. |
void |
setRectAnchor(IlvRect rect)
Sets the anchor of the label as an IlvRect. |
void |
setStrokePaint(Paint c)
Sets the Paint used to draw the outline
of the characters of the text. |
void |
setTransformer(IlvTransformer t)
Sets the transformer. |
void |
setUsingFractionalMetrics(boolean fractionalMetrics)
Changes the fraction metrics mode of the label. |
boolean |
supportMultiline()
Returns true since this
object supports multiline text. |
void |
write(IlvOutputStream stream)
Writes this IlvMapLabel in an
IlvOutputStream. |
boolean |
zoomable()
IlvMapLabel is only zoomable if no offsets are set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlvMapLabel(IlvPoint anchor,
String labels)
anchor - The anchor point.labels - The text to be displayed.
public IlvMapLabel(IlvRect anchor,
String labels)
anchor - The rectangular anchor.labels - The text to be displayed.public IlvMapLabel(IlvMapLabel source)
source - The IlvMapLabel to be
copied.
public IlvMapLabel(IlvInputStream stream)
throws IlvReadFileException
IlvMapLabel from an
IlvInputStream
IlvReadFileException| Method Detail |
|---|
public void write(IlvOutputStream stream)
throws IOException
IlvMapLabel in an
IlvOutputStream.
write in interface IlvPersistentObjectwrite in class IlvGraphicstream - The output stream to write this graphic object to.
IOException - thrown when an exception occurs during
the write operation for this object.public IlvRect boundingBox(IlvTransformer transformer)
boundingBox in class IlvGraphictransformer - The transformer for which the bounding
box is computed.
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic boolean isVisible(IlvTransformer transformer)
transformer.
The setMinimumHeight(height) method allows
to hide the label if its height becomes less
than the minimum height value.
public void draw(Graphics g,
IlvTransformer t)
draw in class IlvGraphicg - The destination Graphics.t - The transformation used to draw the object.IlvGraphic.boundingBox(ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic void applyTransform(IlvTransformer t)
applyTransform in class IlvGraphict - The transformation to be applied.IlvGraphicpublic IlvGraphic copy()
copy in class IlvGraphicIlvGraphic instance.IlvGraphicpublic IlvTransformer getTransformer()
public void setTransformer(IlvTransformer t)
public boolean zoomable()
IlvMapLabel is only zoomable if no offsets are set.
Returns true if the label is zoomable.
zoomable in class IlvGraphicIlvGraphic,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.boundingBox(IlvTransformer),
IlvManager
public void setOffset(float dx,
float dy)
applyToObject
method.
public void setOffset(IlvPoint offset)
applyToObject
method.
public IlvPoint getOffset()
public void setBackgroundPaint(Paint c)
Paint used to fill the frame
of the label.
public Paint getBackgroundPaint()
Paint used to fill the frame
of the label.
public void setFillPaint(Paint c)
Paint used to fill
the characters of the text.
public Paint getFillPaint()
Paint used to fill
the characters of the text.
public void setStrokePaint(Paint c)
Paint used to draw the outline
of the characters of the text.
public Paint getStrokePaint()
Paint used to draw the outline
of the characters of the text.
public void setFramePaint(Paint c)
Paint used to draw the frame
of the label.
public Paint getFramePaint()
Paint used to draw the frame
of the label.
public int getAlignment()
public void setAlignment(int alignment)
public Font getFont()
getFont in interface IlvFontInterfacepublic void setFont(Font font)
setFont in interface IlvFontInterfacefont - The new font.public float getInterline()
public void setInterline(float interline)
interline - The interline.public int getAttachment()
public void setAttachment(int attachment)
attachment - The attachment.public float getInnerMargin()
public void setInnerMargin(float margin)
margin - The new margin.public void setLabel(String text)
setLabel in interface IlvLabelInterfacetext - The new string.public String getLabel()
getLabel in interface IlvLabelInterfacepublic boolean supportMultiline()
true since this
object supports multiline text.
supportMultiline in interface IlvLabelInterfacetruepublic IlvRect getLabelBBox(IlvTransformer transformer)
getLabelBBox in interface IlvLabelInterfacetransformer - The transformer used to draw the object.public void setAntialiasing(boolean antialiasing)
antialiasing - The new antialiasing value.public boolean isAntialiasing()
true if the anti-aliasing mode
of the label is on.
true if the anti-aliasing mode
of the label is on, false otherwise.public void setUsingFractionalMetrics(boolean fractionalMetrics)
fractionalMetrics - The new fractionalMetrics value.public boolean isUsingFractionalMetrics()
true if the fractional metrics mode
of the label is on.
true is the label uses fractional metrics,
false otherwise.public void setMinimumHeight(int min)
min - The minimum height of the label.public int getMinimunHeight()
public int getMinimumHeight()
public void setMaximumHeight(int max)
max - The maximum height of the label.public int getMaximumHeight()
public void setMaximumLineHeight(int max)
max - The maximum height of a line.public int getMaximumLineHeight()
public void setAnchor(IlvPoint point)
point - The new anchor point.public IlvPoint getAnchor()
public void setRectAnchor(IlvRect rect)
IlvRect. To be effective
the label must have been constructed with the IlvMapLabel(IlvRect, String)
constructor.
rect - The rectangular anchor.IlvMapLabel(IlvRect,String)public IlvRect getRectAnchor()
IlvRect if the label has been constructed
with the IlvMapLabel(IlvRect, String)
IlvPoint anchor.protected void invalidate()
public boolean isFitToRect()
true if this label will fit to rect anchor and false otherwise.setFitToRect(boolean)public void setFitToRect(boolean fit)
fit - The fit to rect value.IlvMapLabel(IlvRect, String)
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||