Added mechanism for displaying nodemap centered on a particular node.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@835 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: NodeMap.java,v 1.5 2001/10/11 00:41:27 shaper Exp $
|
||||
// $Id: NodeMap.java,v 1.6 2001/12/18 12:43:12 mdb Exp $
|
||||
|
||||
package com.threerings.nodemap;
|
||||
|
||||
@@ -30,6 +30,14 @@ public class NodeMap
|
||||
_dirty = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator over the nodes in this node map.
|
||||
*/
|
||||
public Iterator nodes ()
|
||||
{
|
||||
return _nodes.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Force the nodes in the map to be re-laid out.
|
||||
*/
|
||||
@@ -55,6 +63,15 @@ public class NodeMap
|
||||
_dirty = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the coordinates of the supplied node, adjusted into
|
||||
* absolute coordinates (where 0,0 is the upper left of the node map).
|
||||
*/
|
||||
public Point getNodeCoords (Node node)
|
||||
{
|
||||
return new Point(node.getX()-_minx, node.getY()-_miny);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the bounding rectangle that wholly contains the node
|
||||
* map.
|
||||
|
||||
Reference in New Issue
Block a user