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.PrintJobAttributeCustom 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 booleanequals(java.lang.Object object)floatgetBottom(int units)java.lang.Class<? extends javax.print.attribute.Attribute>getCategory()floatgetLeft(int units)float[]getMargins(int units)Get the margins as an array of 4 values in the order top, left, right, bottom.java.lang.StringgetName()floatgetRight(int units)floatgetTop(int units)inthashCode()java.lang.StringtoString()java.lang.StringtoString(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:
getCategoryin interfacejavax.print.attribute.Attribute
-
getName
public final java.lang.String getName()
- Specified by:
getNamein interfacejavax.print.attribute.Attribute
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(int units)
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-