Package org.gjt.sp.jedit.print
Class Margins
- java.lang.Object
-
- org.gjt.sp.jedit.print.Margins
-
- All Implemented Interfaces:
java.io.Serializable
,javax.print.attribute.Attribute
,javax.print.attribute.DocAttribute
,javax.print.attribute.PrintJobAttribute
,javax.print.attribute.PrintRequestAttribute
public class Margins extends java.lang.Object implements javax.print.attribute.DocAttribute, javax.print.attribute.PrintRequestAttribute, javax.print.attribute.PrintJobAttribute
Custom printing attribute to represent page margins.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Margins(float top, float left, float right, float bottom)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
float
getBottom(int units)
java.lang.Class<? extends javax.print.attribute.Attribute>
getCategory()
float
getLeft(int units)
float[]
getMargins(int units)
Get the margins as an array of 4 values in the order top, left, right, bottom.java.lang.String
getName()
float
getRight(int units)
float
getTop(int units)
int
hashCode()
java.lang.String
toString()
java.lang.String
toString(int units)
-
-
-
Method Detail
-
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:
java.lang.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
public final java.lang.Class<? extends javax.print.attribute.Attribute> getCategory()
- Specified by:
getCategory
in interfacejavax.print.attribute.Attribute
-
getName
public final java.lang.String getName()
- Specified by:
getName
in interfacejavax.print.attribute.Attribute
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(int units)
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-