y.layout
Class DefaultNodeLayout

java.lang.Object
  |
  +--y.layout.DefaultNodeLayout
All Implemented Interfaces:
NodeLayout

public class DefaultNodeLayout
extends Object
implements NodeLayout

This class is a default implementation of the NodeLayout interface.


Field Summary
protected  double h
           
protected  double w
           
protected  double x
           
protected  double y
           
 
Constructor Summary
DefaultNodeLayout()
          Creates a new instance of DefaultNodeLayout.
DefaultNodeLayout(double x, double y, double width, double height)
          Creates a new instance of DefaultNodeLayout.
DefaultNodeLayout(NodeLayout layout)
          Creates a new instance of DefaultNodeLayout as copy of another instance of NodeLayout.
DefaultNodeLayout(YPoint location, YDimension size)
          Creates a new instance of DefaultNodeLayout.
 
Method Summary
 double getHeight()
          Returns the width of the node.
 double getWidth()
          Returns the height of the node.
 double getX()
          Returns X-Coordinate of the upper left corner of the node.
 double getY()
          Returns Y-Coordinate of the upper left corner of the node.
 void setCenter(double x, double y)
          Sets the center coordinates of the node.
 void setLocation(double x, double y)
          Sets the coordinates of the upper left corner of the node.
 void setSize(double width, double height)
          Sets the size of the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

protected double x

y

protected double y

w

protected double w

h

protected double h
Constructor Detail

DefaultNodeLayout

public DefaultNodeLayout()
Creates a new instance of DefaultNodeLayout.


DefaultNodeLayout

public DefaultNodeLayout(NodeLayout layout)
Creates a new instance of DefaultNodeLayout as copy of another instance of NodeLayout.

Parameters:
layout - another instance of NodeLayout.

DefaultNodeLayout

public DefaultNodeLayout(double x,
                         double y,
                         double width,
                         double height)
Creates a new instance of DefaultNodeLayout.

Parameters:
x - the x-coordinate of the upper left corner of the node.
y - the y-coordinate of the upper left corner of the node.
width - the width of the node.
height - the height of the node.

DefaultNodeLayout

public DefaultNodeLayout(YPoint location,
                         YDimension size)
Creates a new instance of DefaultNodeLayout.

Parameters:
location - the upper-left cornder coordinate of the node layout.
size - the size of the node layout.
Method Detail

setLocation

public void setLocation(double x,
                        double y)
Description copied from interface: NodeLayout
Sets the coordinates of the upper left corner of the node.

Specified by:
setLocation in interface NodeLayout
Parameters:
x - the x-coordinates of the upper left corner.
y - the y-coordinates of the upper left corner.

setCenter

public void setCenter(double x,
                      double y)
Sets the center coordinates of the node.

Parameters:
x - the x-coordinates of the center.
y - the y-coordinates of the center

setSize

public void setSize(double width,
                    double height)
Description copied from interface: NodeLayout
Sets the size of the node.

Specified by:
setSize in interface NodeLayout
Parameters:
width - the width of the node.
height - the heigth of the node.

getHeight

public double getHeight()
Description copied from interface: NodeLayout
Returns the width of the node.

Specified by:
getHeight in interface NodeLayout

getWidth

public double getWidth()
Description copied from interface: NodeLayout
Returns the height of the node.

Specified by:
getWidth in interface NodeLayout

getX

public double getX()
Description copied from interface: NodeLayout
Returns X-Coordinate of the upper left corner of the node.

Specified by:
getX in interface NodeLayout

getY

public double getY()
Description copied from interface: NodeLayout
Returns Y-Coordinate of the upper left corner of the node.

Specified by:
getY in interface NodeLayout

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

2003