Packagecom.yworks.yfiles.layout
Classpublic class LabelCandidate
InheritanceLabelCandidate Inheritance YObject Inheritance Object
Implements PlaneObject
Subclasses EdgeLabelCandidate, NodeLabelCandidate

Base class for candidate positions for labels.



Public Properties
 PropertyDefined By
  boundingBox : YRectangle
[read-only] Returns the bounding box of this label candidate.
LabelCandidate
  box : YOrientedRectangle
[read-only] Returns the real bounds of this label candidate.
LabelCandidate
  customProfit : Number
Specifies the custom profit for this label candidate.
LabelCandidate
  edgeOverlapPenalty : Number
Specifies the penalty value for a candidate position that overlaps the path of an edge.
LabelCandidate
  height : Number
[read-only] Returns the height of the label candidate bounds.
LabelCandidate
  internal2 : Boolean
[read-only] Returns whether this candidate is an internal node label, i.e.
LabelCandidate
  location : YPoint
[read-only] Returns the upper left corner of the label candidate bounds.
LabelCandidate
  modelParameter : Object
[read-only] Returns the model parameter that was used by the underlying model to generate this label candidate.
LabelCandidate
  nodeOverlapPenalty : Number
Specifies the penalty for a candidate position that overlaps the bounds of a node.
LabelCandidate
  overlapPenalty : Number
[read-only] Returns the sum of node overlap penalty and edge overlap penalty.
LabelCandidate
  owner : LabelLayout
[read-only] Returns the LabelLayout to which this candidate box belongs.
LabelCandidate
  parameter : Object
[read-only] Returns the model parameter that was used by the underlying model to generate this label candidate.
LabelCandidate
  propagated : Boolean
[read-only] Returns if this box had been chosen by the labeling algorithm.
LabelCandidate
  size : YDimension
[read-only] Returns the width and height of the label candidate bounds.
LabelCandidate
  width : Number
[read-only] Returns the width of the label candidate bounds.
LabelCandidate
  x : Number
[read-only] Returns the minimal x-coordinate of the label candidate bounds.
LabelCandidate
  y : Number
[read-only] Returns the minimal y-coordinate of the label candidate bounds.
LabelCandidate
Public Methods
 MethodDefined By
  
LabelCandidate(labelBox:YOrientedRectangle, param:Object, owner:LabelLayout, init:Boolean = true)
Returns a new instance of LabelCandidate.
LabelCandidate
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
LabelCandidate
 Inherited
hashCode():int
YObject
  
[static] Returns a new instance of LabelCandidate.
LabelCandidate
  
newLabelCandidate2(labelBox:YOrientedRectangle, param:Object, owner:LabelLayout, _internal:Boolean):LabelCandidate
[static] Returns a new instance of LabelCandidate.
LabelCandidate
  
[static] Returns a new instance of LabelCandidate.
LabelCandidate
  
newLabelCandidate4(pos:YPoint, size:YDimension, param:Object, owner:LabelLayout, _internal:Boolean):LabelCandidate
[static] Returns a new instance of LabelCandidate.
LabelCandidate
  
propagate():void
Sets the model parameters of the owner of this label candidate to the model parameters of this candidate box.
LabelCandidate
  
toString():String
LabelCandidate
Protected Methods
 MethodDefined By
  
initLabelCandidate1(labelBox:YOrientedRectangle, param:Object, owner:LabelLayout):void
Initializes this object.
LabelCandidate
  
initLabelCandidate2(labelBox:YOrientedRectangle, param:Object, owner:LabelLayout, _internal:Boolean):void
Initializes this object.
LabelCandidate
  
initLabelCandidate3(pos:YPoint, size:YDimension, param:Object, owner:LabelLayout):void
Initializes this object.
LabelCandidate
  
initLabelCandidate4(pos:YPoint, size:YDimension, param:Object, owner:LabelLayout, _internal:Boolean):void
Initializes this object.
LabelCandidate
Property Detail
boundingBoxproperty
boundingBox:YRectangle  [read-only]

Returns the bounding box of this label candidate.


Implementation
    public function get boundingBox():YRectangle
boxproperty 
box:YOrientedRectangle  [read-only]

Returns the real bounds of this label candidate.


Implementation
    public function get box():YOrientedRectangle
customProfitproperty 
customProfit:Number

Specifies the custom profit for this label candidate. The value is restricted to the interval [0,1] where 1 specifies the highest possible profit (default is 0). Note: the value is only considered if the labeling algorithm uses an optimization strategy (see com.yworks.yfiles.layout.labeling.MISLabelingAlgorithm.optimizationStrategy).


Implementation
    public function get customProfit():Number
    public function set customProfit(value:Number):void

Throws
IllegalArgumentException — if the value lies not in the interval [0,1].

See also

edgeOverlapPenaltyproperty 
edgeOverlapPenalty:Number

Specifies the penalty value for a candidate position that overlaps the path of an edge.

The penalty should be a factor between 0 and 1, where 0 means that an overlap is considered unimportant and 1 means that an overlap is considered severe.

By default edge overlap penalty is set to 1.


Implementation
    public function get edgeOverlapPenalty():Number
    public function set edgeOverlapPenalty(value:Number):void
heightproperty 
height:Number  [read-only]

Returns the height of the label candidate bounds.


Implementation
    public function get height():Number
internal2property 
internal2:Boolean  [read-only]

Returns whether this candidate is an internal node label, i.e. an label which resides inside the boundaries of a node.


Implementation
    public function get internal2():Boolean
locationproperty 
location:YPoint  [read-only]

Returns the upper left corner of the label candidate bounds.


Implementation
    public function get location():YPoint
modelParameterproperty 
modelParameter:Object  [read-only]

Returns the model parameter that was used by the underlying model to generate this label candidate.


Implementation
    public function get modelParameter():Object
nodeOverlapPenaltyproperty 
nodeOverlapPenalty:Number

Specifies the penalty for a candidate position that overlaps the bounds of a node.

The penalty should be a factor between 0 and 1, where 0 means that an overlap is considered unimportant and 1 means that an overlap is considered severe.

By default node overlap penalty is set to 1.


Implementation
    public function get nodeOverlapPenalty():Number
    public function set nodeOverlapPenalty(value:Number):void
overlapPenaltyproperty 
overlapPenalty:Number  [read-only]

Returns the sum of node overlap penalty and edge overlap penalty.


Implementation
    public function get overlapPenalty():Number

See also

ownerproperty 
owner:LabelLayout  [read-only]

Returns the LabelLayout to which this candidate box belongs.


Implementation
    public function get owner():LabelLayout
parameterproperty 
parameter:Object  [read-only]

Returns the model parameter that was used by the underlying model to generate this label candidate.


Implementation
    public function get parameter():Object
propagatedproperty 
propagated:Boolean  [read-only]

Returns if this box had been chosen by the labeling algorithm.


Implementation
    public function get propagated():Boolean
sizeproperty 
size:YDimension  [read-only]

Returns the width and height of the label candidate bounds.


Implementation
    public function get size():YDimension
widthproperty 
width:Number  [read-only]

Returns the width of the label candidate bounds.


Implementation
    public function get width():Number
xproperty 
x:Number  [read-only]

Returns the minimal x-coordinate of the label candidate bounds.


Implementation
    public function get x():Number
yproperty 
y:Number  [read-only]

Returns the minimal y-coordinate of the label candidate bounds.


Implementation
    public function get y():Number
Constructor Detail
LabelCandidate()Constructor
public function LabelCandidate(labelBox:YOrientedRectangle, param:Object, owner:LabelLayout, init:Boolean = true)

Returns a new instance of LabelCandidate.

Parameters
labelBox:YOrientedRectangle — the box that specifies the candidate's size and position.
 
param:Object — the parameters of the labeling model with this candidate.
 
owner:LabelLayout — the label associated to the candidate.
 
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
getClass()method
override public function getClass():Class

Returns
Class
initLabelCandidate1()method 
protected final function initLabelCandidate1(labelBox:YOrientedRectangle, param:Object, owner:LabelLayout):void

Initializes this object. See the documentation of the corresponding factory method newLabelCandidate1() for details.

Parameters

labelBox:YOrientedRectangle
 
param:Object
 
owner:LabelLayout

See also

initLabelCandidate2()method 
protected final function initLabelCandidate2(labelBox:YOrientedRectangle, param:Object, owner:LabelLayout, _internal:Boolean):void

Initializes this object. See the documentation of the corresponding factory method newLabelCandidate2() for details.

Parameters

labelBox:YOrientedRectangle
 
param:Object
 
owner:LabelLayout
 
_internal:Boolean

See also

initLabelCandidate3()method 
protected final function initLabelCandidate3(pos:YPoint, size:YDimension, param:Object, owner:LabelLayout):void

Initializes this object. See the documentation of the corresponding factory method newLabelCandidate3() for details.

Parameters

pos:YPoint
 
size:YDimension
 
param:Object
 
owner:LabelLayout

See also

initLabelCandidate4()method 
protected final function initLabelCandidate4(pos:YPoint, size:YDimension, param:Object, owner:LabelLayout, _internal:Boolean):void

Initializes this object. See the documentation of the corresponding factory method newLabelCandidate4() for details.

Parameters

pos:YPoint
 
size:YDimension
 
param:Object
 
owner:LabelLayout
 
_internal:Boolean

See also

newLabelCandidate1()method 
public static function newLabelCandidate1(labelBox:YOrientedRectangle, param:Object, owner:LabelLayout):LabelCandidate

Returns a new instance of LabelCandidate.

Parameters

labelBox:YOrientedRectangle — the box that specifies the candidate's size and position.
 
param:Object — the parameters of the labeling model with this candidate.
 
owner:LabelLayout — the label associated to the candidate.

Returns
LabelCandidate
newLabelCandidate2()method 
public static function newLabelCandidate2(labelBox:YOrientedRectangle, param:Object, owner:LabelLayout, _internal:Boolean):LabelCandidate

Returns a new instance of LabelCandidate.

Parameters

labelBox:YOrientedRectangle — the box that specifies the candidate's size and position.
 
param:Object — the parameters of the labeling model with this candidate.
 
owner:LabelLayout — the label associated to the candidate.
 
_internal:Boolean — flag whether the candidate is allowed to overlap its own feature.

Returns
LabelCandidate
newLabelCandidate3()method 
public static function newLabelCandidate3(pos:YPoint, size:YDimension, param:Object, owner:LabelLayout):LabelCandidate

Returns a new instance of LabelCandidate.

Parameters

pos:YPoint — the location of the upper left corner of the candidate.
 
size:YDimension — the size of the candidate.
 
param:Object — the parameters of the labeling model associated with this candidate.
 
owner:LabelLayout — the label associated to the candidate.

Returns
LabelCandidate
newLabelCandidate4()method 
public static function newLabelCandidate4(pos:YPoint, size:YDimension, param:Object, owner:LabelLayout, _internal:Boolean):LabelCandidate

Returns a new instance of LabelCandidate.

Parameters

pos:YPoint — the location of the upper left corner of the candidate.
 
size:YDimension — the size of the candidate.
 
param:Object — the parameters of the labeling model with this candidate.
 
owner:LabelLayout — the label associated to the candidate.
 
_internal:Boolean — flag whether the candidate is allowed to overlap its own feature.

Returns
LabelCandidate
propagate()method 
public function propagate():void

Sets the model parameters of the owner of this label candidate to the model parameters of this candidate box.

toString()method 
public function toString():String

Returns
String