Package | com.yworks.graph.model |
Class | public class StretchStripeLabelModel |
Inheritance | StretchStripeLabelModel Object |
Implements | ILabelModel, ILabelModelParameterProvider |
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
Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
Creates a default parameter that can be used for this model. | StretchStripeLabelModel | ||
createParameter(position:String):ILabelModelParameter
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 |
Constant | Defined 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 |
east | property |
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
.
public static function get east():ILabelModelParameter
insets | property |
insets:IRectangle
The insets to use within the stripe's layout.
public function get insets():IRectangle
public function set insets(value:IRectangle):void
instance | property |
instance:StretchStripeLabelModel
[read-only] public static function get instance():StretchStripeLabelModel
north | property |
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
.
public static function get north():ILabelModelParameter
south | property |
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
.
public static function get south():ILabelModelParameter
useHeaderInsets | property |
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
.
public function get useHeaderInsets():Boolean
public function set useHeaderInsets(value:Boolean):void
west | property |
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
.
public static function get west():ILabelModelParameter
createDefaultParameter | () | method |
public function createDefaultParameter():ILabelModelParameter
Creates a default parameter that can be used for this model.
ReturnsILabelModelParameter — 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.
|
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.
|
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.
|
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.
|
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
|
Object — an instance that is assignable to type or null
|
POSITION_EAST | Constant |
public static const POSITION_EAST:String = East
Encodes a position at the right side of the stripe.
POSITION_NORTH | Constant |
public static const POSITION_NORTH:String = North
Encodes a position at the top side of the stripe.
POSITION_SOUTH | Constant |
public static const POSITION_SOUTH:String = South
Encodes a position at the bottom side of the stripe.
POSITION_WEST | Constant |
public static const POSITION_WEST:String = West
Encodes a position at the left side of the stripe.