org.jgraph.graph.AttributeMap Class Reference

List of all members.

Public Member Functions

 AttributeMap ()
 AttributeMap (int initialCapacity)
 AttributeMap (int initialCapacity, float loadCapacity)
 AttributeMap (Map map)
Point2D createPoint ()
Point2D createPoint (Point2D p)
Point2D createPoint (double x, double y)
Rectangle2D createRect ()
Rectangle2D createRect (double x, double y, double w, double h)
Rectangle2D createRect (Point2D pt)
Rectangle2D createRect (Point2D pt, double size)
Rectangle2D createRect (Rectangle2D rect)
Rectangle2D createRect (double x, double y, double w, double h, double grow1, double grow2)
Rectangle2D createRect (Rectangle2D rect, double grow1, double grow2)
AttributeMap applyMap (Map change)
Object applyValue (Object key, Object value)
Point2D[] clonePoints (Point2D[] points)
List clonePoints (List points)
List clonePoints (Object[] points, boolean convertPortViews)
void translate (double dx, double dy)
void scale (double sx, double sy, Point2D origin)
Map diff (Map newState)
Object clone ()
AttributeMap cloneEntries (AttributeMap newMap)

Static Public Member Functions

static void translate (Collection c, double dx, double dy)

Static Public Attributes

static transient AttributeMap emptyAttributeMap

Classes

class  SerializablePoint2D
class  SerializableRectangle2D

Detailed Description

A map specifically for the storage of attributes of graph cells. The main advantage of the AttributeMap is that it allows to override cell view behaviour for scaling, translation, diffing, and cloning on a per instance basis without having to change the GraphConstants class


Constructor & Destructor Documentation

org.jgraph.graph.AttributeMap.AttributeMap  ) 
 

Creates a new attribute map with an initial capacity of 8.

org.jgraph.graph.AttributeMap.AttributeMap int  initialCapacity  ) 
 

Creates a new attribute map with the specified initial capacity

Parameters:
initialCapacity the initial capacity of the new map

org.jgraph.graph.AttributeMap.AttributeMap int  initialCapacity,
float  loadCapacity
 

Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.

Parameters:
initialCapacity the initial capacity of the hashtable.
loadCapacity the load factor of the hashtable.

org.jgraph.graph.AttributeMap.AttributeMap Map  map  ) 
 

Constructs a new AttributeMap with the same mappings as the given Map.

Parameters:
map the input map to copy


Member Function Documentation

AttributeMap org.jgraph.graph.AttributeMap.applyMap Map  change  ) 
 

Apply the change to this views attributes. change must be a Map previously obtained from this object.

Parameters:
change the change to apply
Returns:
a map that may be used to undo the change to target.

Object org.jgraph.graph.AttributeMap.applyValue Object  key,
Object  value
 

Apply the key to value

Parameters:
key the map key whose value is to be altered
value the new value to be applied to the specified key
Returns:
the old value.

Object org.jgraph.graph.AttributeMap.clone  ) 
 

Returns a clone of map, from keys to values. If the map contains bounds or points, these are cloned as well. References to PortViews are replaces by points.
Note: Extend this method to clone custom user objects.

AttributeMap org.jgraph.graph.AttributeMap.cloneEntries AttributeMap  newMap  ) 
 

Clones special object entried in the given map.

List org.jgraph.graph.AttributeMap.clonePoints Object[]  points,
boolean  convertPortViews
 

Returns a list where all instances of PortView are replaced by their correspnding Point instance.

List org.jgraph.graph.AttributeMap.clonePoints List  points  ) 
 

Returns a list where all instances of PortView are replaced by their correspnding Point instance.

Parameters:
points the points to be cloned
Returns:
the cloned points

Point2D [] org.jgraph.graph.AttributeMap.clonePoints Point2D[]  points  ) 
 

Returns a list where all instances of PortView are replaced by their correspnding Point instance.

Parameters:
points the points to be cloned
Returns:
the cloned points

Point2D org.jgraph.graph.AttributeMap.createPoint double  x,
double  y
 

Creates a point of suitable type for this attribute map with the same values as those passed in

Parameters:
x the x-coordinate position of the new point
y the y-coordinate position of the new point
Returns:
a new point at the coordinates passed in

Point2D org.jgraph.graph.AttributeMap.createPoint Point2D  p  ) 
 

Creates a point of suitable type for this attribute map with the same values as the point passed in

Parameters:
p the point whose values the new point are to be based on
Returns:
a new copy of the point passed in

Point2D org.jgraph.graph.AttributeMap.createPoint  ) 
 

Creates a point of suitable type for this attribute map

Returns:
a new point

Rectangle2D org.jgraph.graph.AttributeMap.createRect Rectangle2D  rect,
double  grow1,
double  grow2
 

Creates a clone of the rectangle passed in and manipulates it by grow1 and grow2

Parameters:
grow1 the amount both dimensions are to be increased by and the position coorindates of the rectangle are to be decreased by
grow2 the additional amount by which both dimensions are to be increased by
Returns:
a new rectangle at the coordinates and of the dimensions passed in

Rectangle2D org.jgraph.graph.AttributeMap.createRect double  x,
double  y,
double  w,
double  h,
double  grow1,
double  grow2
 

Creates a rectangle of suitable type for this attribute map

Parameters:
x the x-coordinate position of the new rectangle
y the y-coordinate position of the new rectangle
w the width of the new rectangle
h the height of the new rectangle
grow1 the amount both dimensions are to be increased by and the position coorindates of the rectangle are to be decreased by
grow2 the additional amount by which both dimensions are to be increased by
Returns:
a new rectangle at the coordinates and of the dimensions passed in

Rectangle2D org.jgraph.graph.AttributeMap.createRect Rectangle2D  rect  ) 
 

Clones the rectangle passed in

Parameters:
rect the rectangle to clone
Returns:
a copy of the rectangle passed in

Rectangle2D org.jgraph.graph.AttributeMap.createRect Point2D  pt,
double  size
 

Creates a rectangle of suitable type for this attribute map at the position of the point passed in with lengths size

Parameters:
pt the position of the new rectangle
size the length of both sides of the rectangle
Returns:
a new rectangle the specified position and dimensions

Rectangle2D org.jgraph.graph.AttributeMap.createRect Point2D  pt  ) 
 

Creates a rectangle of suitable type for this attribute map at the position of the point passed in

Parameters:
pt the position of the new rectangle
Returns:
a new rectangle the specified coordinates of zero size

Rectangle2D org.jgraph.graph.AttributeMap.createRect double  x,
double  y,
double  w,
double  h
 

Creates a rectangle of suitable type for this attribute map with the same values as those passed in

Parameters:
x the x-coordinate position of the new rectangle
y the y-coordinate position of the new rectangle
w the width of the new rectangle
h the height of the new rectangle
Returns:
a new rectangle at the coordinates and of the dimensions passed in

Rectangle2D org.jgraph.graph.AttributeMap.createRect  ) 
 

Creates a rectangle of suitable type for this attribute map

Returns:
a new rectangle

Map org.jgraph.graph.AttributeMap.diff Map  newState  ) 
 

Returns a new map that contains all (key, value)-pairs of newState where either key is not used or value is different for key in oldState. In other words, this method removes the common entries from oldState and newState, and returns the "difference" between the two.

This method never returns null.

void org.jgraph.graph.AttributeMap.scale double  sx,
double  sy,
Point2D  origin
 

Scales map by the given amount.

void org.jgraph.graph.AttributeMap.translate double  dx,
double  dy
 

Translates map by the given amount.

static void org.jgraph.graph.AttributeMap.translate Collection  c,
double  dx,
double  dy
[static]
 

Translates the maps in c using translate(Map, int, int).


Member Data Documentation

transient AttributeMap org.jgraph.graph.AttributeMap.emptyAttributeMap [static]
 

Initial value:

 new AttributeMap(0) {
                public Object clone() {
                        return this;
                }
        }
Shared empty attribute map to return instead of null in applyMap.


The documentation for this class was generated from the following file:
Generated on Sun May 28 19:13:13 2006 for Digimod by  doxygen 1.4.6-NO