Packagecom.yworks.graph.model
Classpublic class StretchStripeLabelModel
InheritanceStretchStripeLabelModel Inheritance Object
Implements ILabelModel, ILabelModelParameterProvider

A label model for labels that is especially tailored to be used as a model for the four default positions where the label of a stripe may lie.

This label model supports four positions inside of the stripe bounds. The east and west positions are rotated automatically. The label's owner is expected to be an IStripe instance, i.e. the parameter supports only IStripe instances.

See also

ILabelModel
IStripe


Public Properties
 PropertyDefined By
  east : ILabelModelParameter
[static] [read-only] A convenience parameter instance that can be shared between label instances.
StretchStripeLabelModel
  insets : IRectangle
The insets to use within the stripe's layout.
StretchStripeLabelModel
  instance : StretchStripeLabelModel
[static] [read-only]
StretchStripeLabelModel
  north : ILabelModelParameter
[static] [read-only] A convenience parameter instance that can be shared between label instances.
StretchStripeLabelModel
  south : ILabelModelParameter
[static] [read-only] A convenience parameter instance that can be shared between label instances.
StretchStripeLabelModel
  useHeaderInsets : Boolean
Whether to use the IStripe.headerInsets or the normal IStripe.Insets of a stripe for centering the label inside the stripe header area.
StretchStripeLabelModel
  west : ILabelModelParameter
[static] [read-only] A convenience parameter instance that can be shared between label instances.
StretchStripeLabelModel
Public Methods
 MethodDefined By
  
Creates a default parameter that can be used for this model.
StretchStripeLabelModel
  
Creates the parameter for the given position.
StretchStripeLabelModel
  
Provides a lookup context for the given combination of label and parameter.
StretchStripeLabelModel
  
Calculates the geometry in form of an IOrientedRectangle for a given label using the given model parameter.
StretchStripeLabelModel
  
Returns an iterator over a set of possible ILabelModelParameter instances that can be used for the given label and model.
StretchStripeLabelModel
  
lookup(type:Class):Object
Returns an instance that implements the given type or null.
StretchStripeLabelModel
Public Constants
 ConstantDefined By
  POSITION_EAST : String = East
[static] Encodes a position at the right side of the stripe.
StretchStripeLabelModel
  POSITION_NORTH : String = North
[static] Encodes a position at the top side of the stripe.
StretchStripeLabelModel
  POSITION_SOUTH : String = South
[static] Encodes a position at the bottom side of the stripe.
StretchStripeLabelModel
  POSITION_WEST : String = West
[static] Encodes a position at the left side of the stripe.
StretchStripeLabelModel
Property Detail
eastproperty
east:ILabelModelParameter  [read-only]

A convenience parameter instance that can be shared between label instances.

Although the ILabelModelParameter.model can be cast to a StretchStripeLabelModel, trying to change that instances' insets will raise an IllegalOperationError.


Implementation
    public static function get east():ILabelModelParameter
insetsproperty 
insets:IRectangle

The insets to use within the stripe's layout.


Implementation
    public function get insets():IRectangle
    public function set insets(value:IRectangle):void
instanceproperty 
instance:StretchStripeLabelModel  [read-only]


Implementation
    public static function get instance():StretchStripeLabelModel
northproperty 
north:ILabelModelParameter  [read-only]

A convenience parameter instance that can be shared between label instances.

Although the ILabelModelParameter.model can be cast to a StretchStripeLabelModel, trying to change that instances' insets will raise an IllegalOperationError.


Implementation
    public static function get north():ILabelModelParameter
southproperty 
south:ILabelModelParameter  [read-only]

A convenience parameter instance that can be shared between label instances.

Although the ILabelModelParameter.model can be cast to a StretchStripeLabelModel, trying to change that instances' insets will raise an IllegalOperationError.


Implementation
    public static function get south():ILabelModelParameter
useHeaderInsetsproperty 
useHeaderInsets:Boolean

Whether to use the IStripe.headerInsets or the normal IStripe.Insets of a stripe for centering the label inside the stripe header area.

If true the header insets are used.

The default value is false.


Implementation
    public function get useHeaderInsets():Boolean
    public function set useHeaderInsets(value:Boolean):void
westproperty 
west:ILabelModelParameter  [read-only]

A convenience parameter instance that can be shared between label instances.

Although the ILabelModelParameter.model can be cast to a StretchStripeLabelModel, trying to change that instances' insets will raise an IllegalOperationError.


Implementation
    public static function get west():ILabelModelParameter
Method Detail
createDefaultParameter()method
public function createDefaultParameter():ILabelModelParameter

Creates a default parameter that can be used for this model.

Returns
ILabelModelParameter — A parameter for this model instance.
createParameter()method 
public function createParameter(position:String):ILabelModelParameter

Creates the parameter for the given position.

Parameters

position:String — The position.

Returns
ILabelModelParameter — The parameter for the given position.
getContext()method 
public function getContext(label:ILabel, parameter:ILabelModelParameter):ILookup

Provides a lookup context for the given combination of label and parameter.

Parameters

label:ILabel — The label to use in the context.
 
parameter:ILabelModelParameter — The parameter to use for the label in the context.

Returns
ILookup — An implementation of the ILookup interface that can be used to query additional aspects of the label/parameter combination.
getGeometry()method 
public function getGeometry(modelParameter:ILabelModelParameter, label:ILabel):IOrientedRectangle

Calculates the geometry in form of an IOrientedRectangle for a given label using the given model parameter.

The geometry is calculated in table coordinates, i.e. relative to ITable.relativeLocation.

Parameters

modelParameter:ILabelModelParameter — A parameter that has been created by this model. This is typically the parameter that yielded this instance through its ILabelModelParameter.Model property.
 
label:ILabel — The label to calculate the geometry for.

Returns
IOrientedRectangle — An instance that describes the geometry. This is typically an instance designed as a flyweight, so clients should not cache the instance but store the values if they need a snapshot for later use.
getParameters()method 
public function getParameters(label:ILabel, model:ILabelModel):Iterator

Returns an iterator over a set of possible ILabelModelParameter instances that can be used for the given label and model.

Parameters

label:ILabel — The label instance to use.
 
model:ILabelModel — The model to provide parameters for.

Returns
Iterator — A possibly empty iterator over a set of label model parameters.
lookup()method 
public function lookup(type:Class):Object

Returns an instance that implements the given type or null.

Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile time constraints. An instance implementing this method is not required to return non-null implementations for the types, nor does it have to return the same instance any time. Also it depends on the type and context whether the instance returned stays up to date or needs to be reobtained for subsequent use.

Parameters

type:Class — the type for which an instance shall be returned

Returns
Object — an instance that is assignable to type or null
Constant Detail
POSITION_EASTConstant
public static const POSITION_EAST:String = East

Encodes a position at the right side of the stripe.

POSITION_NORTHConstant 
public static const POSITION_NORTH:String = North

Encodes a position at the top side of the stripe.

POSITION_SOUTHConstant 
public static const POSITION_SOUTH:String = South

Encodes a position at the bottom side of the stripe.

POSITION_WESTConstant 
public static const POSITION_WEST:String = West

Encodes a position at the left side of the stripe.