edu.umd.cs.piccolox.util
Class PBoundsLocator

java.lang.Object
  extended by edu.umd.cs.piccolox.util.PLocator
      extended by edu.umd.cs.piccolox.util.PNodeLocator
          extended by edu.umd.cs.piccolox.util.PBoundsLocator
All Implemented Interfaces:
Serializable

public class PBoundsLocator
extends PNodeLocator

PBoundsLocator is a locator that locates points on the bounds of a node.

Version:
1.0
Author:
Jesse Grosjean
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.umd.cs.piccolox.util.PNodeLocator
node
 
Constructor Summary
PBoundsLocator(PNode node, int aSide)
          Constructs a locator for tracking the position on the node provided.
 
Method Summary
static PBoundsLocator createEastLocator(PNode node)
          Creates a locator for tracking the east side of the provided node.
static PBoundsLocator createNorthEastLocator(PNode node)
          Creates a locator for tracking the north east corner of the provided node.
static PBoundsLocator createNorthLocator(PNode node)
          Creates a locator for tracking the north side of the provided node.
static PBoundsLocator createNorthWestLocator(PNode node)
          Creates a locator for tracking the north west corner of the provided node.
static PBoundsLocator createSouthEastLocator(PNode node)
          Creates a locator for tracking the south east corner of the provided node.
static PBoundsLocator createSouthLocator(PNode node)
          Creates a locator for tracking the south side of the provided node.
static PBoundsLocator createSouthWestLocator(PNode node)
          Creates a locator for tracking the south west corner of the provided node.
static PBoundsLocator createWestLocator(PNode node)
          Creates a locator for tracking the west side of the provided node.
 int getSide()
          Returns the side of the node that's being tracked.
 double locateX()
          Maps the locator's side to its x position.
 double locateY()
          Maps the locator's side to its y position.
 void setSide(int side)
          Sets the side to track on the node.
 
Methods inherited from class edu.umd.cs.piccolox.util.PNodeLocator
getNode, setNode
 
Methods inherited from class edu.umd.cs.piccolox.util.PLocator
locatePoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PBoundsLocator

public PBoundsLocator(PNode node,
                      int aSide)
Constructs a locator for tracking the position on the node provided.

Parameters:
node - node to track
aSide - specified the position on the node to track
Method Detail

createEastLocator

public static PBoundsLocator createEastLocator(PNode node)
Creates a locator for tracking the east side of the provided node.

Parameters:
node - node to track
Returns:
a new locator

createNorthEastLocator

public static PBoundsLocator createNorthEastLocator(PNode node)
Creates a locator for tracking the north east corner of the provided node.

Parameters:
node - node to track
Returns:
a new locator

createNorthWestLocator

public static PBoundsLocator createNorthWestLocator(PNode node)
Creates a locator for tracking the north west corner of the provided node.

Parameters:
node - node to track
Returns:
a new locator

createNorthLocator

public static PBoundsLocator createNorthLocator(PNode node)
Creates a locator for tracking the north side of the provided node.

Parameters:
node - node to track
Returns:
a new locator

createSouthLocator

public static PBoundsLocator createSouthLocator(PNode node)
Creates a locator for tracking the south side of the provided node.

Parameters:
node - node to track
Returns:
a new locator

createWestLocator

public static PBoundsLocator createWestLocator(PNode node)
Creates a locator for tracking the west side of the provided node.

Parameters:
node - node to track
Returns:
a new locator

createSouthWestLocator

public static PBoundsLocator createSouthWestLocator(PNode node)
Creates a locator for tracking the south west corner of the provided node.

Parameters:
node - node to track
Returns:
a new locator

createSouthEastLocator

public static PBoundsLocator createSouthEastLocator(PNode node)
Creates a locator for tracking the south east corner of the provided node.

Parameters:
node - node to track
Returns:
a new locator

getSide

public int getSide()
Returns the side of the node that's being tracked.

Returns:
tracked side

setSide

public void setSide(int side)
Sets the side to track on the node.

Parameters:
side - new side to track

locateX

public double locateX()
Maps the locator's side to its x position.

Overrides:
locateX in class PNodeLocator
Returns:
x position on side this locator is tracking

locateY

public double locateY()
Maps the locator's side to its y position.

Overrides:
locateY in class PNodeLocator
Returns:
y position on side this locator is tracking


Copyright © 1995-2010 Piccolo2D. All Rights Reserved.