org.ujac.print
Class PagePosition

java.lang.Object
  extended by org.ujac.print.PagePosition

public class PagePosition
extends Object

Name: PagePosition
Description: A class holding positions within a document page.
These positions may be negative which means the position will be calculated by the methods calcX/calcY to place the object relative to the right/top edge of the page instead of the left/bottom edge.

Author:
lauerc

Constructor Summary
PagePosition()
          Constructs a PagePosition instance with specific attributes.
PagePosition(float x, float y)
          Constructs a PagePosition instance with specific attributes.
 
Method Summary
 float calcX(float pageWidth, float objectWidth)
          Calculates the horizontal position on the page.
 float calcY(float pageHeight, float objectHeight)
          Calculates the vertical position on the page.
 float getX()
          Getter method for the the property x.
 float getY()
          Getter method for the the property y.
 void setX(float x)
          Setter method for the the property x.
 void setY(float y)
          Setter method for the the property y.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PagePosition

public PagePosition()
Constructs a PagePosition instance with specific attributes.


PagePosition

public PagePosition(float x,
                    float y)
Constructs a PagePosition instance with specific attributes.

Parameters:
x - The horizontal position.
y - The vertical position.
Method Detail

getX

public float getX()
Getter method for the the property x.

Returns:
The current value of property x.

setX

public void setX(float x)
Setter method for the the property x.

Parameters:
x - The value to set for the property x.

getY

public float getY()
Getter method for the the property y.

Returns:
The current value of property y.

setY

public void setY(float y)
Setter method for the the property y.

Parameters:
y - The value to set for the property y.

calcX

public float calcX(float pageWidth,
                   float objectWidth)
Calculates the horizontal position on the page.

Parameters:
pageWidth - The width of the page.
objectWidth - The width of the object to calculate the position for.
Returns:
The calculated horizontal position.

calcY

public float calcY(float pageHeight,
                   float objectHeight)
Calculates the vertical position on the page.

Parameters:
pageHeight - The height of the page.
objectHeight - The height of the object to calculate the position for.
Returns:
The calculated vertical position.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.