org.jgraph.graph
Class AttributeMap
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--org.jgraph.graph.AttributeMap
- All Implemented Interfaces:
- Cloneable, Map, Serializable
- public class AttributeMap
- extends Hashtable
- See Also:
- Serialized Form
|
Method Summary |
AttributeMap |
applyMap(Map change)
Apply the change to the target. |
Object |
clone()
Returns a clone of map, from keys to values. |
List |
clonePoints(List points)
Returns a list where all instances of PortView are replaced by their
correspnding Point instance. |
Point2D |
createPoint()
|
Point2D |
createPoint(double x,
double y)
|
Point2D |
createPoint(Point2D p)
|
Rectangle2D |
createRect()
|
Rectangle2D |
createRect(double x,
double y,
double w,
double h)
|
Rectangle2D |
createRect(double x,
double y,
double w,
double h,
double grow1,
double grow2)
|
Rectangle2D |
createRect(Point2D pt)
|
Rectangle2D |
createRect(Point2D pt,
double size)
|
Rectangle2D |
createRect(Rectangle2D rect)
|
Rectangle2D |
createRect(Rectangle2D rect,
double grow1,
double grow2)
|
AttributeMap |
diff(AttributeMap 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. |
void |
scale(double sx,
double sy,
Point2D origin)
Scales map by the given amount. |
static void |
translate(Collection c,
double dx,
double dy)
Translates the maps in c using
translate(Map, int, int). |
void |
translate(double dx,
double dy)
Translates map by the given amount. |
| Methods inherited from class java.util.Hashtable |
clear, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
AttributeMap
public AttributeMap()
AttributeMap
public AttributeMap(Map map)
createPoint
public Point2D createPoint()
- Returns:
-
createPoint
public Point2D createPoint(Point2D p)
- Returns:
-
createPoint
public Point2D createPoint(double x,
double y)
- Returns:
-
createRect
public Rectangle2D createRect()
- Returns:
-
createRect
public Rectangle2D createRect(double x,
double y,
double w,
double h)
- Returns:
-
createRect
public Rectangle2D createRect(Point2D pt)
- Returns:
-
createRect
public Rectangle2D createRect(Point2D pt,
double size)
- Returns:
-
createRect
public Rectangle2D createRect(Rectangle2D rect)
- Returns:
-
createRect
public Rectangle2D createRect(double x,
double y,
double w,
double h,
double grow1,
double grow2)
- Returns:
-
createRect
public Rectangle2D createRect(Rectangle2D rect,
double grow1,
double grow2)
- Returns:
-
applyMap
public AttributeMap applyMap(Map change)
- Apply the
change to the target.
change must be a Map previously obtained
from this object. Returns a map that may be used to undo the change to
target.
clonePoints
public List clonePoints(List points)
- Returns a list where all instances of PortView are replaced by their
correspnding Point instance.
translate
public static void translate(Collection c,
double dx,
double dy)
- Translates the maps in
c using
translate(Map, int, int).
translate
public void translate(double dx,
double dy)
- Translates
map by the given amount.
scale
public void scale(double sx,
double sy,
Point2D origin)
- Scales
map by the given amount.
diff
public AttributeMap diff(AttributeMap 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.
clone
public Object 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.
- Overrides:
clone in class Hashtable
Copyright (C) 2001-2004 Gaudenz Alder. All rights reserved.