1 13 14 package org.netbeans.lib.awtextra; 15 16 import java.awt.Dimension ; 17 import java.awt.Point ; 18 19 25 public class AbsoluteConstraints implements java.io.Serializable { 26 27 static final long serialVersionUID = 5261460716622152494L; 28 29 30 public int x; 31 32 public int y; 33 34 public int width = -1; 35 36 public int height = -1; 37 38 41 public AbsoluteConstraints(Point pos) { 42 this (pos.x, pos.y); 43 } 44 45 49 public AbsoluteConstraints(int x, int y) { 50 this.x = x; 51 this.y = y; 52 } 53 54 59 public AbsoluteConstraints(Point pos, Dimension size) { 60 this.x = pos.x; 61 this.y = pos.y; 62 if (size != null) { 63 this.width = size.width; 64 this.height = size.height; 65 } 66 } 67 68 76 public AbsoluteConstraints(int x, int y, int width, int height) { 77 this.x = x; 78 this.y = y; 79 this.width = width; 80 this.height = height; 81 } 82 83 84 public int getX () { 85 return x; 86 } 87 88 89 public int getY () { 90 return y; 91 } 92 93 96 public int getWidth () { 97 return width; 98 } 99 100 103 public int getHeight () { 104 return height; 105 } 106 107 public String toString () { 108 return super.toString () +" [x="+x+", y="+y+", width="+width+", height="+height+"]"; 109 } 110 111 } 112 113 | Popular Tags |