public class IlvMapLabel extends IlvBidiGraphic implements IlvFontInterface, IlvLabelInterface
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 and Description |
|---|
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 .
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyTransform(IlvTransformer t)
Applies the transformation on the label.
|
void |
baseTextDirectionChanged(int oldBaseTextDirection,
int newBaseTextDirection)
Called when the object is base text direction sensitive and the
resolved base text direction has changed.
|
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. |
double |
getInnerMargin()
Returns the margin.
|
double |
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 |
isBaseTextDirectionSensitive()
Returns
true because the bounding box of this object
depends on its text direction. |
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(double margin)
Sets the spacing between the frame of the label
and the text.
|
void |
setInterline(double 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(double dx,
double 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. |
boolean |
usesBidiMarkers()
Returns
true if in-place editing implementation uses markers,
which should be taken into account in hit-to-point and point-to-hit
calculations. |
void |
write(IlvOutputStream stream)
Writes this
IlvMapLabel in an
IlvOutputStream. |
boolean |
zoomable()
IlvMapLabel is only zoomable if no offsets are set. |
calcResolvedBaseTextDirection, getBaseTextDirection, getComponentOrientation, getResolvedBaseTextDirection, getULocale, invalidateBidiCache, setBaseTextDirection, setBaseTextDirection, setBaseTextDirectionDuringConstructionaddActionListener, addNamedPropertyListener, allViewsRemoved, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, contains, getAndAssociateObjectInteractor, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isPersistent, isSelectable, isVisible, localeChanged, makeSelection, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setForeground, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, viewAddedOrRemovedpublic 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
IlvInputStreamIlvReadFileExceptionpublic 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.callDraw(Graphics,IlvTransformer),
IlvGraphic.boundingBox(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),
IlvManagerpublic void setOffset(double dx,
double 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.
This property supports
IlvBlinkingPaint.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.
This property supports
IlvBlinkingPaint.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.
This property supports
IlvBlinkingPaint.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.
This property supports
IlvBlinkingPaint.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 double getInterline()
public void setInterline(double interline)
interline - The interline.public int getAttachment()
public void setAttachment(int attachment)
attachment - The attachment.public double getInnerMargin()
public void setInnerMargin(double 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)public boolean usesBidiMarkers()
true if in-place editing implementation uses markers,
which should be taken into account in hit-to-point and point-to-hit
calculations.usesBidiMarkers in class IlvGraphicpublic boolean isBaseTextDirectionSensitive()
true because the bounding box of this object
depends on its text direction.isBaseTextDirectionSensitive in class IlvGraphicpublic void baseTextDirectionChanged(int oldBaseTextDirection,
int newBaseTextDirection)
baseTextDirectionChanged in class IlvGraphicoldBaseTextDirection - Resolved base text direction of this object before the change.newBaseTextDirection - Resolved base text direction of this object after the change.isBaseTextDirectionSensitive()© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.