1 package org.columba.core.print; 17 18 import java.awt.Point ; 19 import java.awt.geom.Point2D ; 20 21 22 public class cPoint { 23 private cUnit x; 24 private cUnit y; 25 26 public cPoint(cUnit x, cUnit y) { 27 this.x = x; 28 this.y = y; 29 } 30 31 public void setLocation(cUnit x, cUnit y) { 32 this.x = x; 33 this.y = y; 34 } 35 36 public void setX(cUnit x) { 37 this.x = x; 38 } 39 40 public void setY(cUnit y) { 41 this.y = y; 42 } 43 44 public cUnit getX() { 45 return x; 46 } 47 48 public cUnit getY() { 49 return y; 50 } 51 52 public Point2D.Double getPoint2D() { 53 Point2D.Double temp = new Point2D.Double (x.getPoints(), y.getPoints()); 54 55 return temp; 56 } 57 58 public Point getPoint() { 59 Point temp = new Point ((int) x.getPoints(), (int) y.getPoints()); 60 61 return temp; 62 } 63 64 public cPoint add(cPoint p) { 65 cPoint temp = new cPoint(p.getX().add(getX()), p.getY().add(getY())); 66 67 return temp; 68 } 69 70 public cPoint subHeight(cUnit h) { 71 cPoint temp = new cPoint(getX(), getY().sub(h)); 72 73 return temp; 74 } 75 76 public cPoint addHeight(cUnit h) { 77 cPoint temp = new cPoint(getX(), getY().add(h)); 78 79 return temp; 80 } 81 82 public Object clone() { 83 cPoint clone = new cPoint(getX(), getY()); 84 85 return clone; 86 } 87 } 88 | Popular Tags |