Initial work on support for objects whose images span multiple tiles.
Made TileSet an interface. Throw exceptions for unknown tile or tile set requests. General clean-up and documentation. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@427 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: Node.java,v 1.5 2001/08/28 23:50:45 shaper Exp $
|
||||
// $Id: Node.java,v 1.6 2001/10/11 00:41:27 shaper Exp $
|
||||
|
||||
package com.threerings.nodemap;
|
||||
|
||||
@@ -37,6 +37,9 @@ public abstract class Node implements ToolTipProvider
|
||||
* added to the node more than once.
|
||||
*
|
||||
* @param e the new edge.
|
||||
*
|
||||
* @exception DuplicateEdgeException thrown if the node already
|
||||
* contains the given edge.
|
||||
*/
|
||||
protected void addEdge (Edge e) throws DuplicateEdgeException
|
||||
{
|
||||
@@ -50,7 +53,7 @@ public abstract class Node implements ToolTipProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an <code>Iterator</code> object that iterates over the
|
||||
* Returns an <code>Iterator</code> object that iterates over the
|
||||
* edges leaving this node.
|
||||
*
|
||||
* @return the iterator object.
|
||||
@@ -90,7 +93,7 @@ public abstract class Node implements ToolTipProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the node contains the given point.
|
||||
* Returns whether the node contains the given point.
|
||||
*
|
||||
* @param x the x-position.
|
||||
* @param y the y-position.
|
||||
@@ -104,7 +107,7 @@ public abstract class Node implements ToolTipProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the node width in pixels.
|
||||
* Returns the node width in pixels.
|
||||
*/
|
||||
public int getWidth ()
|
||||
{
|
||||
@@ -112,7 +115,7 @@ public abstract class Node implements ToolTipProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the node height in pixels.
|
||||
* Returns the node height in pixels.
|
||||
*/
|
||||
public int getHeight ()
|
||||
{
|
||||
@@ -192,7 +195,7 @@ public abstract class Node implements ToolTipProvider
|
||||
public void handleMouseClicked (int x, int y) { }
|
||||
|
||||
/**
|
||||
* Return a string representation of this node.
|
||||
* Returns a string representation of this node.
|
||||
*/
|
||||
public String toString ()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: NodeMap.java,v 1.4 2001/08/28 23:50:45 shaper Exp $
|
||||
// $Id: NodeMap.java,v 1.5 2001/10/11 00:41:27 shaper Exp $
|
||||
|
||||
package com.threerings.nodemap;
|
||||
|
||||
@@ -36,7 +36,9 @@ public class NodeMap
|
||||
public void layout ()
|
||||
{
|
||||
// do nothing if we have no nodes
|
||||
if (_nodes.size() == 0) return;
|
||||
if (_nodes.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// default to using the first node as the root
|
||||
if (_root == null) {
|
||||
@@ -54,7 +56,8 @@ public class NodeMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the bounding rectangle that wholly contains the node map.
|
||||
* Calculate the bounding rectangle that wholly contains the node
|
||||
* map.
|
||||
*/
|
||||
protected void updateBounds ()
|
||||
{
|
||||
@@ -126,6 +129,9 @@ public class NodeMap
|
||||
* present in the node map more than once.
|
||||
*
|
||||
* @param n the node to add.
|
||||
*
|
||||
* @exception DuplicateNodeException thrown if the node already
|
||||
* exists in the node map.
|
||||
*/
|
||||
public void addNode (Node n) throws DuplicateNodeException
|
||||
{
|
||||
@@ -146,6 +152,11 @@ public class NodeMap
|
||||
*
|
||||
* @param n the node.
|
||||
* @param e the edge to add.
|
||||
*
|
||||
* @exception NoSuchNodeException thrown if the given node does
|
||||
* not exist in the node map.
|
||||
* @exception DuplicateEdgeException thrown if the given node
|
||||
* already contains the given edge.
|
||||
*/
|
||||
public void addEdge (Node n, Edge e)
|
||||
throws NoSuchNodeException, DuplicateEdgeException
|
||||
@@ -165,6 +176,9 @@ public class NodeMap
|
||||
* present in the node map.
|
||||
*
|
||||
* @param n the root node.
|
||||
*
|
||||
* @exception NoSuchNodeException thrown if the given node does
|
||||
* not exist in the node map.
|
||||
*/
|
||||
public void setRootNode (Node n) throws NoSuchNodeException
|
||||
{
|
||||
@@ -177,7 +191,7 @@ public class NodeMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the dimensions of the node map in pixels.
|
||||
* Returns the dimensions of the node map in pixels.
|
||||
*/
|
||||
public Dimension getSize ()
|
||||
{
|
||||
@@ -190,7 +204,7 @@ public class NodeMap
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the bounding rectangle of the node map.
|
||||
* Returns the bounding rectangle of the node map.
|
||||
*/
|
||||
public Rectangle getBounds ()
|
||||
{
|
||||
@@ -204,7 +218,7 @@ public class NodeMap
|
||||
* events.
|
||||
*
|
||||
* @param x the mouse x-coordinate.
|
||||
* @param y the ymouse y-coordinate.
|
||||
* @param y the mouse y-coordinate.
|
||||
*/
|
||||
public void handleMouseMoved (int x, int y)
|
||||
{
|
||||
@@ -263,7 +277,7 @@ public class NodeMap
|
||||
* Inform any affected nodes of mouse-clicked events.
|
||||
*
|
||||
* @param x the mouse x-coordinate.
|
||||
* @param y the ymouse y-coordinate.
|
||||
* @param y the mouse y-coordinate.
|
||||
*/
|
||||
public void handleMouseClicked (int x, int y)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: NodeMapPanel.java,v 1.4 2001/09/28 00:46:54 shaper Exp $
|
||||
// $Id: NodeMapPanel.java,v 1.5 2001/10/11 00:41:27 shaper Exp $
|
||||
|
||||
package com.threerings.nodemap;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class NodeMapPanel extends JPanel
|
||||
implements MouseListener, MouseMotionListener, ToolTipObserver
|
||||
{
|
||||
/**
|
||||
* Construct a node map panel.
|
||||
* Constructs a node map panel.
|
||||
*/
|
||||
public NodeMapPanel ()
|
||||
{
|
||||
@@ -28,7 +28,7 @@ public class NodeMapPanel extends JPanel
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a node map panel that displays the given node map.
|
||||
* Constructs a node map panel that displays the given node map.
|
||||
*
|
||||
* @param map the node map to display.
|
||||
*/
|
||||
@@ -39,7 +39,7 @@ public class NodeMapPanel extends JPanel
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the node map panel.
|
||||
* Initializes the node map panel.
|
||||
*/
|
||||
protected void init ()
|
||||
{
|
||||
@@ -49,7 +49,7 @@ public class NodeMapPanel extends JPanel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the node map displayed by this panel.
|
||||
* Sets the node map displayed by this panel.
|
||||
*
|
||||
* @param map the node map to display.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user