Lines Matching defs:units

68  * internally as integers in units of micrometers (µm), where 1 micrometer
85 private int units;
90 * Value to indicate units of inches (in). It is actually the conversion
96 * Value to indicate units of millimeters (mm). It is actually the
107 * @param units in which the values are expressed.
112 * <CODE>units</CODE> < 1.
114 public MediaPrintableArea(float x, float y, float w, float h, int units) {
116 (units < 1)) {
120 this.x = (int) (x * units + 0.5f);
121 this.y = (int) (y * units + 0.5f);
122 this.w = (int) (w * units + 0.5f);
123 this.h = (int) (h * units + 0.5f);
133 * @param units in which the values are expressed.
138 * <CODE>units</CODE> < 1.
140 public MediaPrintableArea(int x, int y, int w, int h, int units) {
142 (units < 1)) {
145 this.x = x * units;
146 this.y = y * units;
147 this.w = w * units;
148 this.h = h * units;
154 * x, y, w, h. The values returned are in the given units.
155 * @param units
159 * @return printable area as array of x, y, w, h in the specified units.
162 * (unchecked exception) Thrown if <CODE>units</CODE> < 1.
164 public float[] getPrintableArea(int units) {
165 return new float[] { getX(units), getY(units),
166 getWidth(units), getHeight(units) };
171 * specified units.
172 * @param units
177 * specified units.
180 * (unchecked exception) Thrown if <CODE>units</CODE> < 1.
182 public float getX(int units) {
183 return convertFromMicrometers(x, units);
188 * specified units.
189 * @param units
194 * specified units.
197 * (unchecked exception) Thrown if <CODE>units</CODE> < 1.
199 public float getY(int units) {
200 return convertFromMicrometers(y, units);
204 * Get the width of the printable area in the specified units.
205 * @param units
209 * @return width of the printable area in the specified units.
212 * (unchecked exception) Thrown if <CODE>units</CODE> < 1.
214 public float getWidth(int units) {
215 return convertFromMicrometers(w, units);
219 * Get the height of the printable area in the specified units.
220 * @param units
224 * @return height of the printable area in the specified units.
227 * (unchecked exception) Thrown if <CODE>units</CODE> < 1.
229 public float getHeight(int units) {
230 return convertFromMicrometers(h, units);
292 * given units.
294 * @param units
299 * null, no units name is appended to the result.
304 * (unchecked exception) Thrown if <CODE>units</CODE> < 1.
306 public String toString(int units, String unitsName) {
310 float []vals = getPrintableArea(units);
329 private static float convertFromMicrometers(int x, int units) {
330 if (units < 1) {
331 throw new IllegalArgumentException("units is < 1");
333 return ((float)x) / ((float)units);