java.lang.Object
org.gjt.sp.jedit.print.Margins
- All Implemented Interfaces:
Serializable
,Attribute
,DocAttribute
,PrintJobAttribute
,PrintRequestAttribute
public class Margins
extends Object
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
Custom printing attribute to represent page margins.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
float
getBottom
(int units) float
getLeft
(int units) float[]
getMargins
(int units) Get the margins as an array of 4 values in the order top, left, right, bottom.final String
getName()
float
getRight
(int units) float
getTop
(int units) int
hashCode()
toString()
toString
(int units)
-
Constructor Details
-
Margins
public Margins(float top, float left, float right, float bottom)
-
-
Method Details
-
getMargins
public float[] getMargins(int units) Get the margins as an array of 4 values in the order top, left, right, bottom. The values returned are in the given units.- Parameters:
units
- Unit conversion factor, either INCH or MM.- Returns:
- margins as array of top, left, right, bottom in the specified units.
- Throws:
IllegalArgumentException
- on invalid units.
-
getTop
public float getTop(int units) -
getLeft
public float getLeft(int units) -
getRight
public float getRight(int units) -
getBottom
public float getBottom(int units) -
getCategory
- Specified by:
getCategory
in interfaceAttribute
-
getName
-
toString
-
toString
-
equals
-
hashCode
public int hashCode()
-