com.yworks.yfiles.server.graphml.flexio.data
Class SimpleLabelStyle

java.lang.Object
  extended bycom.yworks.yfiles.server.graphml.flexio.data.SimpleLabelStyle
All Implemented Interfaces:
ILabelStyle, ISharedInstanceProvider, LabelSizeCalculator

public class SimpleLabelStyle
extends java.lang.Object
implements ILabelStyle, LabelSizeCalculator, ISharedInstanceProvider

The default label style data object, which allows to specify the visual properties of a label.


Constructor Summary
SimpleLabelStyle()
           
 
Method Summary
 boolean canCalculateSize(Label l)
          Whether the size of the given label can be calculated.
 java.lang.String getAlign()
          Returns the horizontal alignment or null if the default alignment is used.
 IFill getBackgroundFill()
          The fill to use for the background box of the label or null
 IStroke getBackgroundStroke()
          The stroke to use for the background box of the label or null
 YDimension getCalculatedSize(Label l)
          Calculates the size of a given label.
 Font getFont()
          The font for the label's text.
 IFill getFontFill()
          The font color for the label's text.
 java.util.Collection getSharedInstances()
          Returns an Collection for objects that shall be shared.
 boolean isAutoFlip()
          Whether the label text should be automatically flipped if it would be upside-down
 boolean isClipText()
          Whether text should be clipped.
 void setAlign(java.lang.String align)
          Sets the horizontal alignment.
 void setAutoFlip(boolean autoFlip)
          Whether the label text should be automatically flipped if it would be upside-down
 void setBackgroundFill(IFill backgroundFill)
          The fill to use for the background box of the label or null
 void setBackgroundStroke(IStroke backgroundStroke)
          The stroke to use for the background box of the label or null
 void setClipText(boolean clipText)
          Whether text should be clipped.
 void setFont(Font font)
          The font for the label's text.
 void setFontFill(IFill fontFill)
          The font color for the label's text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLabelStyle

public SimpleLabelStyle()
Method Detail

getFont

public Font getFont()
The font for the label's text.


setFont

public void setFont(Font font)
The font for the label's text.


isClipText

public boolean isClipText()
Whether text should be clipped.


setClipText

public void setClipText(boolean clipText)
Whether text should be clipped.


isAutoFlip

public boolean isAutoFlip()
Whether the label text should be automatically flipped if it would be upside-down


setAutoFlip

public void setAutoFlip(boolean autoFlip)
Whether the label text should be automatically flipped if it would be upside-down


getAlign

public java.lang.String getAlign()
Returns the horizontal alignment or null if the default alignment is used.


setAlign

public void setAlign(java.lang.String align)
Sets the horizontal alignment. One of


getFontFill

public IFill getFontFill()
The font color for the label's text.


setFontFill

public void setFontFill(IFill fontFill)
The font color for the label's text.


getBackgroundFill

public IFill getBackgroundFill()
The fill to use for the background box of the label or null


setBackgroundFill

public void setBackgroundFill(IFill backgroundFill)
The fill to use for the background box of the label or null


getBackgroundStroke

public IStroke getBackgroundStroke()
The stroke to use for the background box of the label or null


setBackgroundStroke

public void setBackgroundStroke(IStroke backgroundStroke)
The stroke to use for the background box of the label or null


getCalculatedSize

public YDimension getCalculatedSize(Label l)
                             throws java.lang.IllegalArgumentException
Calculates the size of a given label.

Before calling this method, canCalculateSize(Label) should be queried if all prerequisites are met to calculate the size.

Note that extensive use of HTML tags in the label's text can make the measurements inexact.

Specified by:
getCalculatedSize in interface LabelSizeCalculator
Parameters:
l - The label to calculate the size for.
Returns:
The calculated size of the label.
Throws:
java.lang.IllegalArgumentException - If the size of the label cannot be calculated.

canCalculateSize

public boolean canCalculateSize(Label l)
Whether the size of the given label can be calculated.

This method verifies that the given label is not null and a font is set to this style instance.

Specified by:
canCalculateSize in interface LabelSizeCalculator
Parameters:
l - The label to calculate the size for.
Returns:
true if the size can be calculated.

getSharedInstances

public java.util.Collection getSharedInstances()
Description copied from interface: ISharedInstanceProvider
Returns an Collection for objects that shall be shared.

Specified by:
getSharedInstances in interface ISharedInstanceProvider
Returns:


Copyright © 2000-2013 yWorks GmbH. All rights reserved