|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.yworks.yfiles.server.graphml.flexio.data.flexmarkup.TLFLabelStyle
A data object for the client side com.yworks.graph.drawing.TLFLabelStyle
.
This style uses the Flex Text Layout Framework to render the label text.
At client side, this style is only available in the Flex 4 version of yFiles FLEX.
Field Summary | |
static java.lang.String |
PLAIN_TEXT_FORMAT
Constant for the textConverter property which lets the text
be rendered as plain text. |
static java.lang.String |
TEXT_FIELD_HTML_FORMAT
Constant for the textConverter property which lets the text
be rendered as HTML text. |
static java.lang.String |
TEXT_LAYOUT_FORMAT
Constant for the textConverter property which lets the text
be rendered using the Flex Text Layout markup. |
Constructor Summary | |
TLFLabelStyle()
Creates a new instance. |
|
TLFLabelStyle(IStroke backgroundStroke,
IFill backgroundFill)
Creates an instance with the given background stroke and fill. |
|
TLFLabelStyle(TextLayoutFormat textFormat,
IStroke backgroundStroke,
IFill backgroundFill)
Creates an instance with the given format, background stroke and fill. |
|
TLFLabelStyle(TextLayoutFormat textFormat,
java.lang.String textConverter,
IStroke backgroundStroke,
IFill backgroundFill)
Creates an instance with the given format, text converter, and background stroke and fill. |
|
TLFLabelStyle(TextLayoutFormat textFormat,
java.lang.String textConverter,
IStroke backgroundStroke,
IFill backgroundFill,
boolean clipText)
Creates an instance with the given format, text converter, and background stroke and fill. |
Method Summary | |
boolean |
canCalculateSize(Label l)
Whether the size of the label can be calculated. |
IFill |
getBackgroundFill()
The background fill of the label. |
IStroke |
getBackgroundStroke()
The border stroke of the label. |
YDimension |
getCalculatedSize(Label l)
Calculates the size of a given label. |
java.util.Collection |
getSharedInstances()
Returns an Collection for objects that shall be shared. |
java.lang.String |
getTextConverter()
A String which defines how the label text will be interpreted.
|
TextLayoutFormat |
getTextFormat()
The text layout format for the label. |
boolean |
isClipText()
Whether to clip the text at the label's bounds. |
void |
setBackgroundFill(IFill backgroundFill)
Sets the background fill of the label. |
void |
setBackgroundStroke(IStroke backgroundStroke)
Sets the border stroke of the label. |
void |
setClipText(boolean clipText)
Whether to clip the text at the label's bounds. |
void |
setTextConverter(java.lang.String textConverter)
Sets a String which defines how the label text will be interpreted.
|
void |
setTextFormat(TextLayoutFormat textFormat)
Sets the text layout format for the label. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String TEXT_FIELD_HTML_FORMAT
textConverter
property which lets the text
be rendered as HTML text.
public static final java.lang.String PLAIN_TEXT_FORMAT
textConverter
property which lets the text
be rendered as plain text.
public static final java.lang.String TEXT_LAYOUT_FORMAT
textConverter
property which lets the text
be rendered using the Flex Text Layout markup.
Constructor Detail |
public TLFLabelStyle()
public TLFLabelStyle(TextLayoutFormat textFormat, java.lang.String textConverter, IStroke backgroundStroke, IFill backgroundFill, boolean clipText)
textFormat
- The TextLayoutFormat to use for the label.textConverter
- Defines how to interpret the label text. One of PLAIN_TEXT_FORMAT
,
TEXT_FIELD_HTML_FORMAT
, or TEXT_LAYOUT_FORMAT
.backgroundStroke
- The border stroke for the label. May be null
to render no border.backgroundFill
- The background fill for the label. May be null
for a transparent background.clipText
- Whether to clip the text at the label's bounds.public TLFLabelStyle(TextLayoutFormat textFormat, java.lang.String textConverter, IStroke backgroundStroke, IFill backgroundFill)
The label text will be clipped at the label bounds.
textFormat
- The TextLayoutFormat to use for the label.textConverter
- Defines how to interpret the label text. One of PLAIN_TEXT_FORMAT
,
TEXT_FIELD_HTML_FORMAT
, or TEXT_LAYOUT_FORMAT
.backgroundStroke
- The border stroke for the label. May be null
to render no border.backgroundFill
- The background fill for the label. May be null
for a transparent background.public TLFLabelStyle(TextLayoutFormat textFormat, IStroke backgroundStroke, IFill backgroundFill)
The label text will be interpreted as plain text and be clipped at the label bounds.
textFormat
- The TextLayoutFormat to use for the label.backgroundStroke
- The border stroke for the label. May be null
to render no border.backgroundFill
- The background fill for the label. May be null
for a transparent background.public TLFLabelStyle(IStroke backgroundStroke, IFill backgroundFill)
The label text will be interpreted as plain text and be clipped at the label bounds.
backgroundStroke
- The border stroke for the label. May be null
to render no border.backgroundFill
- The background fill for the label. May be null
for a transparent background.Method Detail |
public IStroke getBackgroundStroke()
If set to null
no border will be rendered.
Default is null
null
.public void setBackgroundStroke(IStroke backgroundStroke)
If set to null
no border will be rendered.
Default is null
backgroundStroke
- The border stroke. May be null
.public IFill getBackgroundFill()
If set to null
the background will be transparent.
Default is null
null
.public void setBackgroundFill(IFill backgroundFill)
If set to null
the background will be transparent.
Default is null
backgroundFill
- The background fill. May be null
.public boolean isClipText()
Default is true
.
true
if the text should be clipped at the label's bounds.public void setClipText(boolean clipText)
Default is true
.
true
if the text should be clipped at the label's bounds.public TextLayoutFormat getTextFormat()
Default is a plain instance of TextLayoutFormat
.
public void setTextFormat(TextLayoutFormat textFormat)
Default is a plain instance of TextLayoutFormat
.
textFormat
- The text layout format object for the label. May not be null
.
java.lang.IllegalArgumentException
- If null
is set as value.public java.lang.String getTextConverter()
String
which defines how the label text will be interpreted.
Default is PLAIN_TEXT_FORMAT
which means the text will be interpreted as plain string.
String
which defines how the label text will be interpreted.public void setTextConverter(java.lang.String textConverter)
String
which defines how the label text will be interpreted.
Setting this property to any other value than one of PLAIN_TEXT_FORMAT
,
TEXT_FIELD_HTML_FORMAT
, or TEXT_LAYOUT_FORMAT
may break
the rendering at the client.
Default is PLAIN_TEXT_FORMAT
which means the text will be interpreted as plain string.
textConverter
- A String
which defines how the label text will be interpreted.public YDimension getCalculatedSize(Label l) throws java.lang.IllegalArgumentException
Before calling this method, canCalculateSize(Label)
should be
queried if all prerequisites are met to calculate the size.
Note that the size can only be calculated for plain text.
getCalculatedSize
in interface LabelSizeCalculator
l
- The label to calculate the size for.
java.lang.IllegalArgumentException
- If the size of the label cannot be calculated.public boolean canCalculateSize(Label l)
The size can only be calculated if the text converter is set for plain text.
canCalculateSize
in interface LabelSizeCalculator
l
- The label to calculate the size for.
true
if the size of the label can be calculated.public java.util.Collection getSharedInstances()
ISharedInstanceProvider
Collection
for objects that shall be shared.
getSharedInstances
in interface ISharedInstanceProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |