1 29 30 package nextapp.echo2.app; 31 32 import java.io.Serializable ; 33 34 38 public class Alignment 39 implements Serializable { 40 41 44 public static final Alignment ALIGN_LEFT = new Alignment(Alignment.LEFT, Alignment.DEFAULT); 45 46 49 public static final Alignment ALIGN_CENTER = new Alignment(Alignment.CENTER, Alignment.DEFAULT); 50 51 54 public static final Alignment ALIGN_RIGHT = new Alignment(Alignment.RIGHT, Alignment.DEFAULT); 55 56 59 public static final Alignment ALIGN_TOP = new Alignment(Alignment.DEFAULT, Alignment.TOP); 60 61 64 public static final Alignment ALIGN_BOTTOM = new Alignment(Alignment.DEFAULT, Alignment.BOTTOM); 65 66 69 public static final int DEFAULT = 0; 70 71 74 public static final int LEADING = 1; 75 76 79 public static final int TRAILING = 2; 80 81 84 public static final int LEFT = 3; 85 86 89 public static final int CENTER = 4; 90 91 94 public static final int RIGHT = 5; 95 96 99 public static final int TOP = 6; 100 101 104 public static final int BOTTOM = 7; 105 106 private int horizontal; 107 private int vertical; 108 109 131 public Alignment (int horizontal, int vertical) { 132 super(); 133 this.horizontal = horizontal; 134 this.vertical = vertical; 135 } 136 137 140 public boolean equals(Object o) { 141 if (!(o instanceof Alignment)) { 142 return false; 143 } 144 Alignment that = (Alignment) o; 145 return this.horizontal == that.horizontal && this.vertical == that.vertical; 146 } 147 148 162 public int getHorizontal() { 163 return horizontal; 164 } 165 166 178 public int getVertical() { 179 return vertical; 180 } 181 } 182 | Popular Tags |