Search this API

y.layout.router.polyline
Class PartitionCell

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

public class PartitionCell
extends java.lang.Object

A PartitionCell represents a rectangular part of a Partition as result of the decomposition process.

Each instance of PartitionCell can hold arbitrary additional information (e.g. what element of the graph is covered by a PartitionCell) which can be provided using method putData(Object, Object). Accessing and removing this information can be done using getData(Object) and removeData(Object), respectively.

See Also:
PartitionCellKeys
 

Nested Class Summary
static class PartitionCell.PartitionCellBorder
          This class is a type-safe enumeration used for defining the border of a PartitionCell.
 
Constructor Summary
PartitionCell(double x, double y, double width, double height, Partition partition)
          Creates a new PartitionCell instance of the given Partition with the given bounds.
PartitionCell(YRectangle bounds, Partition partition)
          Creates a new PartitionCell of the given Partition with the location and the size of the given rectangle.
 
Method Summary
 void clearData()
          Clears all additional data for this PartitionCell.
 OrthogonalInterval createBorderInterval(PartitionCell.PartitionCellBorder border)
          Returns an OrthogonalInterval that defines the location, the size and the orientation of the given PartitionCell.PartitionCellBorder.
 YRectangle getBounds()
          Returns the bounds of this PartitionCell.
 java.lang.Object getData(java.lang.Object key)
          Returns the additional data associated with the given key for this PartitionCell.
 double getHeight()
          Returns the height of this PartitionCell.
 int getId()
          Returns a unique identifier of this PartitionCell.
 double getMaxX()
          Returns the x-coordinate of the right border of this PartitionCell.
 double getMaxY()
          Returns the y-coordinate of the bottom border of this PartitionCell.
 double getMinX()
          Returns the x-coordinate of the left border of this PartitionCell.
 double getMinY()
          Returns the y-coordinate of the upper border of this PartitionCell.
 Partition getPartition()
          Returns the partition to which this PartitionCell belongs.
 double getWidth()
          Returns the width of this PartitionCell.
 java.lang.Object putData(java.lang.Object key, java.lang.Object data)
          Stores the additional data associated with the given key for this PartitionCell.
 java.lang.Object removeData(java.lang.Object key)
          Removes the additional data associated with the given key for this PartitionCell.
 
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 PartitionCell of the given Partition with the location and the size of the given rectangle.

Parameters:
bounds - the bounds describing the size and location 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 PartitionCell instance of the given Partition with the given bounds.

Parameters:
x - the x-coordinate of the upper-left corner of the partition cell
y - the y-coordinate of the 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
See Also:
Partition
Method Detail

putData

public java.lang.Object putData(java.lang.Object key,
                                java.lang.Object data)
Stores the additional data associated with the given key for this PartitionCell.

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

getData

public java.lang.Object getData(java.lang.Object key)
Returns the additional data associated with the given key for this PartitionCell.

Parameters:
key - the key whose associated data will be returned
Returns:
the additional data associated with the given key or null if there is no data associated with the given key
See Also:
putData(Object, Object), removeData(Object), clearData(), PartitionCellKeys

removeData

public java.lang.Object removeData(java.lang.Object key)
Removes the additional data associated with the given key for this PartitionCell.

Parameters:
key - the key for which the associated data will be removed
Returns:
the additional data associated with the given key or null if there is no data associated with the given key
See Also:
getData(Object), putData(Object, Object), clearData(), PartitionCellKeys

clearData

public void clearData()
Clears all additional data for this PartitionCell.

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

getPartition

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

Returns:
the partition to which this partition cell belongs
See Also:
Partition

getId

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

Returns:
a unique identifier of this partition cell

getBounds

public YRectangle getBounds()
Returns the bounds of this PartitionCell.

Returns:
the bounds of this partition cell

getMinX

public double getMinX()
Returns the x-coordinate of the left border of this PartitionCell.

Returns:
the x-coordinate of the left border of this partition cell

getMinY

public double getMinY()
Returns the y-coordinate of the upper border of this PartitionCell.

Returns:
the y-coordinate of the upper border of this partition cell

getMaxX

public double getMaxX()
Returns the x-coordinate of the right border of this PartitionCell.

Returns:
the x-coordinate of the right border of this partition cell

getMaxY

public double getMaxY()
Returns the y-coordinate of the bottom border of this PartitionCell.

Returns:
the y-coordinate of the bottom border of this partition cell

getWidth

public double getWidth()
Returns the width of this PartitionCell.

Returns:
the width of this partition cell

getHeight

public double getHeight()
Returns the height of this PartitionCell.

Returns:
the height of this partition cell

createBorderInterval

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

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

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