1 29 30 package nextapp.echo2.app; 31 import java.io.Serializable ; 32 33 36 public class Border 37 implements Serializable { 38 39 42 public static final int STYLE_NONE = 0; 43 44 48 public static final int STYLE_SOLID = 1; 49 50 54 public static final int STYLE_INSET = 2; 55 56 60 public static final int STYLE_OUTSET = 3; 61 62 66 public static final int STYLE_GROOVE = 4; 67 68 72 public static final int STYLE_RIDGE = 5; 73 74 78 public static final int STYLE_DOUBLE = 6; 79 80 83 public static final int STYLE_DOTTED = 7; 84 85 88 public static final int STYLE_DASHED = 8; 89 90 private Extent size; 91 private Color color; 92 private int style; 93 94 112 public Border(int sizePx, Color color, int style) { 113 this(new Extent(sizePx), color, style); 114 } 115 116 136 public Border(Extent size, Color color, int style) { 137 super(); 138 this.size = size; 139 this.color = color; 140 this.style = style; 141 } 142 143 146 public boolean equals(Object o) { 147 if (this == o) { 148 return true; 149 } 150 if (!(o instanceof Border)) { 151 return false; 152 } 153 Border that = (Border) o; 154 if (this.style != that.style) { 155 return false; 156 } 157 if (color == null) { 158 if (that.color != null) { 159 return false; 160 } 161 } else { 162 if (!this.color.equals(that.color)) { 163 return false; 164 } 165 } 166 if (size == null) { 167 if (that.size != null) { 168 return false; 169 } 170 } else { 171 if (!this.size.equals(that.size)) { 172 return false; 173 } 174 } 175 return true; 176 } 177 178 183 public Color getColor() { 184 return color; 185 } 186 187 194 public Extent getSize() { 195 return size; 196 } 197 198 214 public int getStyle() { 215 return style; 216 } 217 } 218 | Popular Tags |