edu.umd.cs.piccolox.swing
Class SwingLayoutNode.Anchor.AbstractAnchor

java.lang.Object
  extended by edu.umd.cs.piccolox.swing.SwingLayoutNode.Anchor.AbstractAnchor
All Implemented Interfaces:
SwingLayoutNode.Anchor
Enclosing interface:
SwingLayoutNode.Anchor

public abstract static class SwingLayoutNode.Anchor.AbstractAnchor
extends Object
implements SwingLayoutNode.Anchor


Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.umd.cs.piccolox.swing.SwingLayoutNode.Anchor
SwingLayoutNode.Anchor.AbstractAnchor
 
Field Summary
 
Fields inherited from interface edu.umd.cs.piccolox.swing.SwingLayoutNode.Anchor
CENTER, EAST, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, WEST
 
Constructor Summary
SwingLayoutNode.Anchor.AbstractAnchor()
           
 
Method Summary
protected static double centerX(PNode node, double x, double width)
          Returns the x at which the given node would need to be placed so that its center was in the middle of the horizontal segment defined by x and width.
protected static double centerY(PNode node, double y, double height)
          Returns the y at which the given node would need to be placed so that its center was in the middle of the vertical segment defined by y and h.
protected static double east(PNode node, double x, double width)
          Returns the x at which the given node would need to be placed so that its right side was against the right side of the horizontal range defined.
protected static double north(PNode node, double y, double height)
          Returns the y at which the given node would need to be placed so that its top was against the top of the vertical segment defined.
protected static double south(PNode node, double y, double height)
          Returns the y at which the given node would need to be placed so that its bottom was against the bottom of the vertical range defined.
protected static double west(PNode node, double x, double width)
          Returns the x at which the given node would need to be placed so that its left side was against the left side of the horizontal range defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.umd.cs.piccolox.swing.SwingLayoutNode.Anchor
positionNode
 

Constructor Detail

SwingLayoutNode.Anchor.AbstractAnchor

public SwingLayoutNode.Anchor.AbstractAnchor()
Method Detail

centerX

protected static double centerX(PNode node,
                                double x,
                                double width)
Returns the x at which the given node would need to be placed so that its center was in the middle of the horizontal segment defined by x and width.

Parameters:
node - node which is being analyzed
x - x component of horizontal line segment
width - width of horizontal line segment
Returns:
x at which node would need to be placed so that its center matched the center of the line segment

centerY

protected static double centerY(PNode node,
                                double y,
                                double height)
Returns the y at which the given node would need to be placed so that its center was in the middle of the vertical segment defined by y and h.

Parameters:
node - node which is being analyzed
y - y component of horizontal line segment
height - height of vertical line segment
Returns:
y at which node would need to be placed so that its center matched the center of the line segment

north

protected static double north(PNode node,
                              double y,
                              double height)
Returns the y at which the given node would need to be placed so that its top was against the top of the vertical segment defined.

Parameters:
node - node which is being analyzed
y - y component of horizontal line segment
height - height of vertical line segment
Returns:
y at which node would need to be placed so that its top matched the start of the line segment (y)

south

protected static double south(PNode node,
                              double y,
                              double height)
Returns the y at which the given node would need to be placed so that its bottom was against the bottom of the vertical range defined.

Parameters:
node - node which is being analyzed
y - y component of vertical range
height - height of vertical range
Returns:
y at which node would need to be placed so that its bottom matched the bottom of the range

east

protected static double east(PNode node,
                             double x,
                             double width)
Returns the x at which the given node would need to be placed so that its right side was against the right side of the horizontal range defined.

Parameters:
node - node which is being analyzed
x - x component of horizontal range
width - width of horizontal range
Returns:
x at which node would need to be placed so that its right side touched the right side of the range defined.

west

protected static double west(PNode node,
                             double x,
                             double width)
Returns the x at which the given node would need to be placed so that its left side was against the left side of the horizontal range defined.

Parameters:
node - node which is being analyzed
x - x component of horizontal range
width - width of horizontal range
Returns:
x at which node would need to be placed so that its left side touched the left side of the range defined (x)


Copyright © 1995-2010 Piccolo2D. All Rights Reserved.