Exemple #1
0
 /**
  * Adds a key to the row, and re-positions it to the end of the row
  *
  * @param key The key to be added.
  * @return true (as specified by Collection.add(E))
  */
 public boolean add(KeyZone key) {
   super.add(key);
   Dimension keydim = key.getSize();
   if (width != 0) width += padding;
   key.translate(width, 0);
   width += keydim.width;
   height = Math.max(keydim.height, height);
   return true;
 }
Exemple #2
0
 /**
  * Translates every key in the row.
  *
  * @param dx The desired change in the x direction.
  * @param dy The desired change in the y direction.
  */
 public void translate(int dx, int dy) {
   for (KeyZone key : this) key.translate(dx, dy);
 }