01: //The contents of this file are subject to the Mozilla Public License Version 1.1
02: //(the "License"); you may not use this file except in compliance with the
03: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
04: //
05: //Software distributed under the License is distributed on an "AS IS" basis,
06: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
07: //for the specific language governing rights and
08: //limitations under the License.
09: //
10: //The Original Code is "The Columba Project"
11: //
12: //The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
14: //
15: //All Rights Reserved.
16: package org.columba.core.print;
17:
18: import java.awt.Dimension;
19: import java.awt.geom.Dimension2D;
20:
21: public class cSize implements Cloneable {
22: private cUnit width;
23: private cUnit height;
24:
25: public cSize() {
26: }
27:
28: public cSize(cUnit x, cUnit y) {
29: this .width = x;
30: this .height = y;
31: }
32:
33: public void setSize(cUnit x, cUnit y) {
34: this .width = x;
35: this .height = y;
36: }
37:
38: public void setWidth(cUnit x) {
39: this .width = x;
40: }
41:
42: public void setHeight(cUnit y) {
43: this .height = y;
44: }
45:
46: public cUnit getWidth() {
47: return width;
48: }
49:
50: public cUnit getHeight() {
51: return height;
52: }
53:
54: public Dimension2D getDimension2D() {
55: Dimension temp = new Dimension((int) width.getPoints(),
56: (int) height.getPoints());
57:
58: return temp;
59: }
60:
61: public Dimension getDimension() {
62: Dimension temp = new Dimension((int) width.getPoints(),
63: (int) height.getPoints());
64:
65: return temp;
66: }
67:
68: public cSize subHeight(cUnit h) {
69: return new cSize(getWidth(), getHeight().sub(h));
70: }
71:
72: public Object clone() {
73: cSize clone = new cSize(width, height);
74:
75: return clone;
76: }
77: }
|