| Package | com.yworks.graph.model |
| Class | public class StripeLabelModel |
| Inheritance | StripeLabelModel Object |
| Implements | ILabelModel, ILabelModelParameterProvider |
This label model supports four positions inside of the stripe bounds.
The east and west positions are rotated automatically. The ILabel.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. | StripeLabelModel | ||
| instance : StripeLabelModel [static] [read-only] | StripeLabelModel | ||
| north : ILabelModelParameter [static] [read-only]
A convenience parameter instance that can be shared between label instances. | StripeLabelModel | ||
| ratio : Number
The ratio how far the label should be positioned from the border in the header area. | StripeLabelModel | ||
| south : ILabelModelParameter [static] [read-only]
A convenience parameter instance that can be shared between label instances. | StripeLabelModel | ||
| 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. | StripeLabelModel | ||
| west : ILabelModelParameter [static] [read-only]
A convenience parameter instance that can be shared between label instances. | StripeLabelModel | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a new instance of this model with empty insets. | StripeLabelModel | ||
Creates a default parameter that can be used for this model. | StripeLabelModel | ||
createParameter(position:String):ILabelModelParameter
Creates the parameter for the given position. | StripeLabelModel | ||
Provides a lookup context for the given combination of label and parameter. | StripeLabelModel | ||
Calculates the geometry in form of an IOrientedRectangle
for a given label using the given model parameter. | StripeLabelModel | ||
Returns an iterator over a set of possible ILabelModelParameter
instances that can be used for the given label and model. | StripeLabelModel | ||
lookup(type:Class):Object
Returns an instance that implements the given type or null. | StripeLabelModel | ||
| Constant | Defined By | ||
|---|---|---|---|
| POSITION_EAST : String = East [static] Encodes a position at the right side of the stripe. | StripeLabelModel | ||
| POSITION_NORTH : String = North [static] Encodes a position at the top side of the stripe. | StripeLabelModel | ||
| POSITION_SOUTH : String = South [static] Encodes a position at the bottom side of the stripe. | StripeLabelModel | ||
| POSITION_WEST : String = West [static] Encodes a position at the left side of the stripe. | StripeLabelModel | ||
| 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 StripeLabelModel, trying to change that instances'
insets will raise an IllegalOperationError.
public static function get east():ILabelModelParameter| instance | property |
instance:StripeLabelModel [read-only] public static function get instance():StripeLabelModel| 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 StripeLabelModel, trying to change that instances'
insets will raise an IllegalOperationError.
public static function get north():ILabelModelParameter| ratio | property |
ratio:NumberThe ratio how far the label should be positioned from the border in the header area.
0 means the label is positioned on the outer border, 1 means it is positioned at the inner border of the header or inset area.
The default value is 0.5.
public function get ratio():Number public function set ratio(value:Number):void| 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 StripeLabelModel, 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):voidSee also
| 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 StripeLabelModel, trying to change that instances'
insets will raise an IllegalOperationError.
public static function get west():ILabelModelParameter| StripeLabelModel | () | Constructor |
public function StripeLabelModel()Creates a new instance of this model with empty insets.
| createDefaultParameter | () | method |
public function createDefaultParameter():ILabelModelParameterCreates a default parameter that can be used for this model.
ReturnsILabelModelParameter — A parameter for this model instance.
|
| createParameter | () | method |
public function createParameter(position:String):ILabelModelParameterCreates 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):ILookupProvides 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 = EastEncodes a position at the right side of the stripe.
| POSITION_NORTH | Constant |
public static const POSITION_NORTH:String = NorthEncodes a position at the top side of the stripe.
| POSITION_SOUTH | Constant |
public static const POSITION_SOUTH:String = SouthEncodes a position at the bottom side of the stripe.
| POSITION_WEST | Constant |
public static const POSITION_WEST:String = WestEncodes a position at the left side of the stripe.