1 14 package org.compiere.apps; 15 16 import org.compiere.util.Log; 17 18 24 public class ALayoutConstraint implements Comparable 25 { 26 31 public ALayoutConstraint(int row, int col) 32 { 33 m_row = row; 34 m_col = col; 35 } 37 41 public ALayoutConstraint createNext() 42 { 43 return new ALayoutConstraint(m_row, m_col+1); 44 } 46 private int m_row; 47 private int m_col; 48 49 53 public int getRow() 54 { 55 return m_row; 56 } 58 62 public int getCol() 63 { 64 return m_col; 65 } 67 77 public int compareTo(Object o) 78 { 79 ALayoutConstraint comp = null; 80 if (o instanceof ALayoutConstraint) 81 comp = (ALayoutConstraint)o; 82 if (comp == null) 83 return +111; 84 85 int rowComp = m_row - comp.getRow(); 87 if (rowComp != 0) 88 return rowComp; 89 return m_col - comp.getCol(); 91 } 93 98 public boolean equals(Object o) 99 { 100 if (o instanceof ALayoutConstraint) 101 return compareTo(o) == 0; 102 return false; 103 } 105 109 public String toString() 110 { 111 return "ALayoutConstraint [Row=" + m_row + ", Col=" + m_col + "]"; 112 } 114 } | Popular Tags |