Packagecom.yworks.graph.drawing
Classpublic class CSSLabelStyle
InheritanceCSSLabelStyle Inheritance Object
Implements ICSSLabelStyle

The default mutable implementation of the ICSSLabelStyle interface. A basic label style which can be styled via CSS sheets.

The following style properties determine the label's border and background

CSS property ActionScript property Usage and supported values
background-colorbackgroundColorThe color of the label box's background. Only hexadecimal color values are supported. Named colors (such as blue) are not supported. Colors are written in the following format: #FF0000. If this property is omitted, no background is drawn.
background-alphabackgroundAlpha If the background-color property is not specified, this property is ignored.
border-colorborderColorThe color of the label box's border. Only hexadecimal color values are supported. Named colors (such as blue) are not supported. Colors are written in the following format: #FF0000. If this property is omitted, no border is drawn.
The style class which is used for the label has to be specified in the styleName property.

See also

ICSSLabelStyle


Public Properties
 PropertyDefined By
  backgroundFill : IFill
Gets the fill to use for the background box of the label or null
CSSLabelStyle
  backgroundStroke : IStroke
Gets the pen to use for the background box of the label or null
CSSLabelStyle
  clipText : Boolean
Whether text should be clipped.
CSSLabelStyle
  styleName : String
The style class which is used by default.
CSSLabelStyle
  styleRenderer : IStyleRenderer
[read-only] Gets the renderer implementation that has been supplied to this instance upon creation.
CSSLabelStyle
  styleSheet : StyleSheet
The style sheet.
CSSLabelStyle
  styleSheetUrl : String
The URL to load the style sheet from.
CSSLabelStyle
Public Methods
 MethodDefined By
  
CSSLabelStyle(renderer:ILabelStyleRenderer = null, styleSheet:StyleSheet = null)
Creates a new instance with the given renderer and the given style sheet.
CSSLabelStyle
  
clone():Object
Creates a clone of this instance.
CSSLabelStyle
  
install(canvas:CanvasComponent, group:ICanvasObjectGroup, modelItem:IModelItem):Array
Prepares the rendering of an IModelItem in a CanvasComponent by adding ICanvasObject's to the provided canvas.
CSSLabelStyle
Protected Methods
 MethodDefined By
  
Creates a new instance of CSSLabelStyle.
CSSLabelStyle
Property Detail
backgroundFillproperty
backgroundFill:IFill

Gets the fill to use for the background box of the label or null


Implementation
    public function get backgroundFill():IFill
    public function set backgroundFill(value:IFill):void
backgroundStrokeproperty 
backgroundStroke:IStroke

Gets the pen to use for the background box of the label or null


Implementation
    public function get backgroundStroke():IStroke
    public function set backgroundStroke(value:IStroke):void
clipTextproperty 
clipText:Boolean

Whether text should be clipped.


Implementation
    public function get clipText():Boolean
    public function set clipText(value:Boolean):void
loaderproperty 
loader:URLLoader  [read-only]


Implementation
    yworks_internal function get loader():URLLoader
styleNameproperty 
styleName:String

The style class which is used by default.

The styles background-color, background-alpha, border-color and clip-text will be searched in this class.

The style name has to be set as declared, i.e. with a starting period (".") if it is declared as a class selector.


Implementation
    public function get styleName():String
    public function set styleName(value:String):void
styleRendererproperty 
styleRenderer:IStyleRenderer  [read-only]

Gets the renderer implementation that has been supplied to this instance upon creation.


Implementation
    public function get styleRenderer():IStyleRenderer
styleSheetproperty 
styleSheet:StyleSheet

The style sheet.


Implementation
    public function get styleSheet():StyleSheet
    public function set styleSheet(value:StyleSheet):void
styleSheetUrlproperty 
styleSheetUrl:String

The URL to load the style sheet from.


Implementation
    public function get styleSheetUrl():String
    public function set styleSheetUrl(value:String):void
Constructor Detail
CSSLabelStyle()Constructor
public function CSSLabelStyle(renderer:ILabelStyleRenderer = null, styleSheet:StyleSheet = null)

Creates a new instance with the given renderer and the given style sheet.

Parameters
renderer:ILabelStyleRenderer (default = null) — The renderer to use with this label style. If none is provided a new CSSLabelStyleRenderer will be used.
 
styleSheet:StyleSheet (default = null) — The style sheet to use. If none is provided, the styleSheetUrl or the styleSheet properties have to be set explicitly.
Method Detail
clone()method
public function clone():Object

Creates a clone of this instance.

Returns
Object — A clone of this instance.
createClone()method 
protected function createClone():CSSLabelStyle

Creates a new instance of CSSLabelStyle.

Returns
CSSLabelStyle — A new instance of CSSLabelStyle.
install()method 
public function install(canvas:CanvasComponent, group:ICanvasObjectGroup, modelItem:IModelItem):Array

Prepares the rendering of an IModelItem in a CanvasComponent by adding ICanvasObject's to the provided canvas.

Implementations may add zero or more ICanvasObject instances to the given CanvasComponent. The group parameter can be used as a hint for implementations. They can add their newly created canvas objects to the given group. However they are not obliged to do that.

Parameters

canvas:CanvasComponent — The canvas to install the canvas objects in.
 
group:ICanvasObjectGroup — A hint that tells the implementation where to add the canvas objects.
 
modelItem:IModelItem — The item to install a visual representation for.

Returns
Array — An array of zero or more canvas objects that have been installed in the canvas by this method or null if nothing was installed.