public class IlvHTMLText extends IlvGraphic
IlvHTMLText
represents a piece of text specified as a HTML
string.
setForeground
method has
no effect in this class. In order to set the text color, you can use
color
style attribute of the
<body>
element.
Example: <body style="color: #FF5010;">
text
attribute of the <body>
tag.
Example: <body text="#FF5010">
. (Deprecated.)setBackground
method has
no effect in this class. In order to set the background color, you can use
background-color
style attribute of the
<body>
element.
Example: <body style="background-color: #663333;">
bgcolor
attribute of the <body>
tag.
Example: <body bgcolor="#663333">
. (Deprecated.)text-decoration: blink
is unsupported.dir="rtl"
or dir="ltr"
is unsupported. Instead, you have to use the Unicode control
characters LRE (‪
),
RLE (‫
), and
PDF (‬
).Constructor and Description |
---|
IlvHTMLText()
Creates an initially empty HTML text.
|
IlvHTMLText(IlvInputStream stream)
Creates an
IlvHTMLText instance from the contents of an
IlvInputStream . |
IlvHTMLText(String htmlText)
Creates a HTML text that displays a given HTML string.
|
Modifier and Type | Method and Description |
---|---|
void |
addHTMLInteractionListener(HTMLInteractionListener listener)
Adds an interaction listener to this object.
|
void |
applyTransform(IlvTransformer t)
Applies an additional transformation to the rendering of the
IlvHTMLText . |
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of this
IlvHTMLText . |
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests if a point lies within the outline of the object.
|
IlvGraphic |
copy()
Returns a copy of this
IlvHTMLText instance. |
void |
draw(Graphics g,
IlvTransformer t)
Draws this
IlvHTMLText object. |
double |
getBottomMargin()
Returns the bottom margin of the box around the text.
|
Font |
getDefaultFont()
Returns the default font used for rendering text.
|
String |
getHTMLText()
Returns the HTML string that is displayed by this
IlvHTMLText
object. |
double |
getLeftMargin()
Returns the left margin of the box around the text.
|
double |
getPageWidth()
Returns the page width.
|
double |
getRightMargin()
Returns the right margin of the box around the text.
|
double |
getTopMargin()
Returns the top margin of the box around the text.
|
boolean |
isAntiAliasing()
Returns
true if the anti-aliasing mode
of the text is on. |
boolean |
isFractionalMetrics()
Returns
true if the fractional metrics mode
of the text is on. |
void |
processMouseClicked(MouseEvent event,
IlvTransformer transformToView)
This method is invoked when a mouse click on this object happened.
|
void |
removeHTMLInteractionListener(HTMLInteractionListener listener)
Removes an interaction listener from this object.
|
void |
setAntiAliasing(boolean set)
Changes the anti-aliasing mode of the text.
|
void |
setBottomMargin(double margin)
Sets the bottom margin of the box around the text.
|
void |
setDefaultFont(Font font)
Changes the default font used for rendering text.
|
void |
setFractionalMetrics(boolean set)
Changes the fractional metrics mode of the text.
|
void |
setHTMLText(String text)
Sets the HTML string that is displayed by this
IlvHTMLText
object. |
void |
setLeftMargin(double margin)
Sets the left margin of the box around the text.
|
void |
setPageWidth(double pageWidth)
Sets the page width.
|
void |
setRightMargin(double margin)
Sets the right margin of the box around the text.
|
void |
setTopMargin(double margin)
Sets the top margin of the box around the text.
|
void |
write(IlvOutputStream stream)
Writes the contents of this
IlvHTMLText to an IVL file. |
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, 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, setBaseTextDirection, setBaseTextDirectionDuringConstruction, 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, usesBidiMarkers, viewAddedOrRemoved, zoomable
public IlvHTMLText()
public IlvHTMLText(String htmlText)
htmlText
- A string in HTML syntax. The <html>
and <body>
tags are optional.public IlvHTMLText(IlvInputStream stream) throws IlvReadFileException
IlvHTMLText
instance from the contents of an
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if the format is not correct.public String getHTMLText()
IlvHTMLText
object.public void setHTMLText(String text)
IlvHTMLText
object.text
- A string in HTML syntax. The <html>
and <body>
tags are optional.public final boolean isFractionalMetrics()
true
if the fractional metrics mode
of the text is on. The default value is true
. Setting
it to false
will speed up the IlvHTMLText
but may
lead to less precise text positioning.public void setFractionalMetrics(boolean set)
true
. Setting it to false
will speed up the
IlvHTMLText
but may lead to less precise text positioning.
applyToObject
method of the
manager.public final boolean isAntiAliasing()
true
if the anti-aliasing mode
of the text is on. The default value is false
.public void setAntiAliasing(boolean set)
false
.
applyToObject
method of the
manager.public Font getDefaultFont()
public void setDefaultFont(Font font)
applyToObject
method of the
manager.public double getPageWidth()
public void setPageWidth(double pageWidth)
applyToObject
method of the
manager.public final double getLeftMargin()
0
.setLeftMargin(double)
public void setLeftMargin(double margin)
0
.
margin-left
and background-color
style
attributes of the <body>
element. Example:
<body style="background-color: #663333; margin-left:10px;">
applyToObject
method of the manager.public final double getRightMargin()
0
.setRightMargin(double)
public void setRightMargin(double margin)
0
.
margin-right
and background-color
style
attributes of the <body>
element. Example:
<body style="background-color: #663333; margin-right:10px;">
applyToObject
method of the manager.public final double getTopMargin()
0
.setTopMargin(double)
public void setTopMargin(double margin)
0
.
margin-top
and background-color
style
attributes of the <body>
element. Example:
<body style="background-color: #663333; margin-top:10px;">
applyToObject
method of the manager.public final double getBottomMargin()
0
.setTopMargin(double)
public void setBottomMargin(double margin)
0
.
margin-bottom
and background-color
style
attributes of the <body>
element. Example:
<body style="background-color: #663333; margin-bottom:10px;">
applyToObject
method of the manager.public IlvGraphic copy()
IlvHTMLText
instance.copy
in class IlvGraphic
IlvGraphic
instance.IlvGraphic
public void draw(Graphics g, IlvTransformer t)
IlvHTMLText
object.draw
in class IlvGraphic
g
- The destination Graphics.t
- The view transformation used to draw the object.IlvGraphic.callDraw(Graphics,IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public IlvRect boundingBox(IlvTransformer t)
IlvHTMLText
.boundingBox
in class IlvGraphic
t
- The view transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
contains
in class IlvGraphic
p
- The point to be tested.tp
- The point p
transformed by the transformer
t
.t
- The transformation used to draw the object.true
if the point lies inside this graphic object.IlvGraphic
public void applyTransform(IlvTransformer t)
IlvHTMLText
.
This can be used to rotate or scale the text.applyTransform
in class IlvGraphic
t
- The transformer to be applied.IlvGraphic
public void processMouseClicked(MouseEvent event, IlvTransformer transformToView)
public void addHTMLInteractionListener(HTMLInteractionListener listener)
public void removeHTMLInteractionListener(HTMLInteractionListener listener)
public void write(IlvOutputStream stream) throws IOException
IlvHTMLText
to an IVL file.write
in interface IlvPersistentObject
write
in class IlvGraphic
stream
- The output stream to write this graphic object to.IOException
- thrown when an exception occurs during
the write operation for this object.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.