Search this API

y.layout.router.polyline
Class PartitionCell

java.lang.Object
  extended by y.layout.router.polyline.PartitionCell

public class PartitionCell
extends Object

Represents a rectangular part of the Partition as result of the decomposition process. Each instance of PartitionCell provides a data store (putData(Object, Object), getData(Object) and removeData(Object)) that could be used to bind additional information to it, e.g. what element of the graph is covered by this PartitionCell.

See Also:
PartitionCellKeys

Nested Class Summary
static class PartitionCell.PartitionCellBorder
          Type-safe enumeration that is used to define the border of a partition cell.
 
Constructor Summary
PartitionCell(double x, double y, double width, double height, Partition partition)
          Creates a new partition cell of the given partition with the given bounds.
PartitionCell(YRectangle bounds, Partition partition)
          Creates a new partition cell of the given partition with location and size of the given rectangle.
 
Method Summary
 void clearData()
          Clears all additional data.
 OrthogonalInterval createBorderInterval(PartitionCell.PartitionCellBorder border)
          Returns an OrthogonalInterval that defines location, size and orientation of the given border.
 YRectangle getBounds()
          Returns the bounds the partition cell.
 Object getData(Object key)
          Returns additional data to which the given key is mapped for this partition cell.
 double getHeight()
          Returns the height of this partition cell.
 int getId()
          Returns a unique identifier of this partition cell.
 double getMaxX()
          Returns the x value of the right border of this partition cell.
 double getMaxY()
          Returns the y value of the lower border of this partition cell.
 double getMinX()
          Returns the x value of the left border of this partition cell.
 double getMinY()
          Returns the y value of the upper border of this partition cell.
 Partition getPartition()
          Returns the partition to which this partition cell belongs.
 double getWidth()
          Returns the width of this partition cell.
 Object putData(Object key, Object data)
          Stores additional data to which the given key is mapped for this partition cell.
 Object removeData(Object key)
          Removes additional data to which the given key is mapped for this partition cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartitionCell

public PartitionCell(YRectangle bounds,
                     Partition partition)
Creates a new partition cell of the given partition with location and size of the given rectangle.

Parameters:
bounds - The bounds of the partition cell.
partition - The partition to which the partition cell belongs.
See Also:
Partition

PartitionCell

public PartitionCell(double x,
                     double y,
                     double width,
                     double height,
                     Partition partition)
Creates a new partition cell of the given partition with the given bounds.

Parameters:
x - The x-coordinate of upper left corner of the partition cell.
y - The y-coordinate of upper left corner of the partition cell.
width - The width of the partition cell.
height - The height of the partition cell.
partition - The partition to which the partition cell belongs.
Method Detail

putData

public Object putData(Object key,
                      Object data)
Stores additional data to which the given key is mapped for this partition cell.

Parameters:
key - The key with which the given data is to be associated.
data - The additional data.
Returns:
The previous data associated with key, or null if there was no mapping for key.
See Also:
getData(Object), removeData(Object), clearData(), PartitionCellKeys

getData

public Object getData(Object key)
Returns additional data to which the given key is mapped for this partition cell.

Parameters:
key - The Key with which the given data is to be associated.
Returns:
The additional data to which the given key is mapped, or null if there was no mapping for key.
See Also:
putData(Object, Object), removeData(Object), clearData(), PartitionCellKeys

removeData

public Object removeData(Object key)
Removes additional data to which the given key is mapped for this partition cell.

Parameters:
key - The Key with which the given data is to be associated.
Returns:
The additional data to which the given key is mapped, or null if there was no mapping for key.
See Also:
getData(Object), putData(Object, Object), clearData(), PartitionCellKeys

clearData

public void clearData()
Clears all additional data.

See Also:
getData(Object), putData(Object, Object), removeData(Object)

getPartition

public Partition getPartition()
Returns the partition to which this partition cell belongs.

Returns:
The partition to which this partition cell belongs.
See Also:
Partition

getId

public int getId()
Returns a unique identifier of this partition cell.

Returns:
A unique identifier of this partition cell.

getBounds

public YRectangle getBounds()
Returns the bounds the partition cell.

Returns:
The bounds the partition cell.

getMinX

public double getMinX()
Returns the x value of the left border of this partition cell.

Returns:
The x value of the left border of this partition cell.

getMinY

public double getMinY()
Returns the y value of the upper border of this partition cell.

Returns:
The y value of the upper border of this partition cell.

getMaxX

public double getMaxX()
Returns the x value of the right border of this partition cell.

Returns:
The x value of the right border of this partition cell.

getMaxY

public double getMaxY()
Returns the y value of the lower border of this partition cell.

Returns:
The y value of the lower border of this partition cell.

getWidth

public double getWidth()
Returns the width of this partition cell.

Returns:
The width of this partition cell.

getHeight

public double getHeight()
Returns the height of this partition cell.

Returns:
The height of this partition cell.

createBorderInterval

public OrthogonalInterval createBorderInterval(PartitionCell.PartitionCellBorder border)
Returns an OrthogonalInterval that defines location, size and orientation of the given border. The values defining the border are

Parameters:
border - A border of this partition cell.
Returns:
An OrthogonalInterval that defines location, size and orientation of the given border.
See Also:
PartitionCell.PartitionCellBorder

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