y.layout
Class FreeNodeLabelModel

java.lang.Object
  |
  +--y.layout.FreeNodeLabelModel
All Implemented Interfaces:
NodeLabelModel

public class FreeNodeLabelModel
extends Object
implements NodeLabelModel

A node label model that allows placement of labels at a fixed offset from the upper left corner of the node.


Nested Class Summary
static class FreeNodeLabelModel.ModelParameter
          The model parameters for the FreeNodeLabelModel.
 
Constructor Summary
FreeNodeLabelModel()
           
 
Method Summary
 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.
 void setLocation(double x, double y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreeNodeLabelModel

public FreeNodeLabelModel()
Method Detail

getDefaultParameter

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

Specified by:
getDefaultParameter in interface NodeLabelModel

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 - an instance of Integer containing a vaild position.

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

setLocation

public void setLocation(double x,
                        double y)

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

2003