javax.print.attribute.standard
Class MediaPrintableArea
- Attribute, DocAttribute, PrintJobAttribute, PrintRequestAttribute, Serializable
The
MediaPrintableArea
attribute specifies the area
of a media sheet which is available for printing.
Due to hardware limitation its not possible with most printers to use the
whole area of a media sheet for printing. This attribute defines the area
for printing through the values of the upper left corner position (x,y)
on the sheet and the available width and height of the area. The units of
the values are determined by two defined constants:
- INCH - defines an inch
- MM - defines a millimeter
Internal storage:
The values of x, y, width and height are stored internally in micrometers.
The values of the provided constants for inch (value 25400) and millimeters
(value 1000) are used as conversion factors to the internal storage units.
To get the internal micrometers values a multiplication of a given
size value with its units constant value is done. Retrieving the size value
for specific units is done by dividing the internal stored value by the
units constant value.
IPP Compatibility: MediaPrintableArea is not an IPP 1.1 attribute.
static int | INCH - Constant for the units of inches.
|
static int | MM - Constant for the units of millimeters.
|
MediaPrintableArea(float x, float y, float w, float h, int units) - Creates a new
MediaPrintableArea object with the given
float values for the given units.
|
MediaPrintableArea(int x, int y, int w, int h, int units) - Creates a new
MediaPrintableArea object with the given
int values for the given units.
|
Class< | ? extends Attribute> getCategory() - Returns category of this class.
|
boolean | equals(Object obj) - Tests if the given object is equal to this object.
|
float | getHeight(int units) - Returns the height of the printable area for the given units.
|
String | getName() - Returns the name of this attribute.
|
float[] | getPrintableArea(int units) - Returns the printable area as an float[] with 4 values
(order x, y, width, height) in the given units.
|
float | getWidth(int units) - Returns the width of the printable area for the given units.
|
float | getX(int units) - Returns the position in x direction of the printable area
for the given units.
|
float | getY(int units) - Returns the position in y direction of the printable area
for the given units.
|
int | hashCode() - Returns the hashcode for this object.
|
String | toString() - Returns the string representation for this object in units of millimeters..
|
String | toString(int units, String unitsName) - Returns the string representation for this object in units of millimeters..
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
INCH
public static final int INCH
Constant for the units of inches.
The actual value is the conversion factor to micrometers.
MM
public static final int MM
Constant for the units of millimeters.
The actual value is the conversion factor to micrometers.
MediaPrintableArea
public MediaPrintableArea(float x,
float y,
float w,
float h,
int units)
Creates a new MediaPrintableArea
object with the given
float values for the given units.
x
- start of the printable area on the sheet in x direction.y
- start of the printable area on the sheet in y direction.w
- the width of the printable area.h
- the height of the printable area.units
- the units of the given values.
MediaPrintableArea
public MediaPrintableArea(int x,
int y,
int w,
int h,
int units)
Creates a new MediaPrintableArea
object with the given
int values for the given units.
x
- start of the printable area on the sheet in x direction.y
- start of the printable area on the sheet in y direction.w
- the width of the printable area.h
- the height of the printable area.units
- the units of the given values.
equals
public boolean equals(Object obj)
Tests if the given object is equal to this object.
- equals in interface Object
true
if both objects are equal, false
otherwise.
getHeight
public float getHeight(int units)
Returns the height of the printable area for the given units.
units
- the units conversion factor.
getPrintableArea
public float[] getPrintableArea(int units)
Returns the printable area as an float[] with 4 values
(order x, y, width, height) in the given units.
units
- the units to use.
- The printable area as float array.
getWidth
public float getWidth(int units)
Returns the width of the printable area for the given units.
units
- the units conversion factor.
getX
public float getX(int units)
Returns the position in x direction of the printable area
for the given units.
units
- the units conversion factor.
- The position in x direction.
getY
public float getY(int units)
Returns the position in y direction of the printable area
for the given units.
units
- the units conversion factor.
- The position in y direction.
toString
public String toString()
Returns the string representation for this object in units of millimeters..
The returned string is in the form "(x,y)->(width,height)mm".
- toString in interface Object
- The string representation in millimeters.
toString
public String toString(int units,
String unitsName)
Returns the string representation for this object in units of millimeters..
The returned string is in the form "(x,y)->(width,height)unitsName".
units
- the units to use for conversion.unitsName
- the name of the used units, appended to the resulting
string if not null
.
- The string representation in millimeters.
MediaPrintableArea.java --
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.