y.layout
Class EdgeOppositeNodeLabelModel

java.lang.Object
  extended by y.layout.EdgeOppositeNodeLabelModel
All Implemented Interfaces:
NodeLabelModel

public class EdgeOppositeNodeLabelModel
extends Object
implements NodeLabelModel

A node label model that sets the labels at the opposite side of the outgoing edges of a node.

 

Nested Class Summary
 class EdgeOppositeNodeLabelModel.ModelParameter
           
 
Constructor Summary
EdgeOppositeNodeLabelModel(LayoutGraph g, Node n)
           
 
Method Summary
 Object createModelParameter(YRectangle labelBounds, NodeLayout nodeLayout)
          Creates a model parameter that represents the given node label context best within this model.
 Object getDefaultParameter()
          Returns the default position, this is offset (0,0)
 YList getLabelCandidates(NodeLabelLayout nl, NodeLayout nodeLayout)
          Returns a list of candidate positions for the label.
 YPoint getLabelPlacement(YDimension labelSize, NodeLayout nodeLayout, Object param)
          Returns the positions of the lower upper corner of the label with given parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeOppositeNodeLabelModel

public EdgeOppositeNodeLabelModel(LayoutGraph g,
                                  Node n)
Method Detail

getDefaultParameter

public Object getDefaultParameter()
Returns the default position, this is offset (0,0)

Specified by:
getDefaultParameter in interface NodeLabelModel
Returns:
A model parameter that can be passed to the NodeLabelModel.getLabelPlacement(YDimension, NodeLayout, Object) method.

getLabelPlacement

public YPoint getLabelPlacement(YDimension labelSize,
                                NodeLayout nodeLayout,
                                Object param)
Returns the positions of the lower upper corner of the label with given parameter.

Specified by:
getLabelPlacement in interface NodeLabelModel
Parameters:
labelSize - the size of the label.
nodeLayout - the geometric description of the labeled node.
param - not used by this model
Returns:
The coordinates of the upper-left corner of a label position.

createModelParameter

public Object createModelParameter(YRectangle labelBounds,
                                   NodeLayout nodeLayout)
Description copied from interface: NodeLabelModel
Creates a model parameter that represents the given node label context best within this model. The created model parameter represents the closest parameter representation of the given label location that can be achieved within this model.

Specified by:
createModelParameter in interface NodeLabelModel
Parameters:
labelBounds - The bounds of the label for which a parameter representation is sought.
nodeLayout - The layout of the node to which the label belongs.
Returns:
A model parameter that can be passed to the NodeLabelModel.getLabelPlacement(YDimension, NodeLayout, Object) method.

getLabelCandidates

public YList getLabelCandidates(NodeLabelLayout nl,
                                NodeLayout nodeLayout)
Returns a list of candidate positions for the label. The list consists of exactly one position.

Specified by:
getLabelCandidates in interface NodeLabelModel
Parameters:
nl - The label layout for which candidates should be generated.
nodeLayout - The layout of the node to which the label belongs.
Returns:
A list of NodeLabelCandidate objects.

© Copyright 2000-2008,
yWorks GmbH.
All rights reserved.