Exemplo n.º 1
0
 /**
  * Returns the gap which should be used between the given gui objects for the y direction. The
  * value will be configurable by guiprefs modifiers. Valid values are all entries in the static
  * String array Y_GAP_NAME_LOOK_UP of this class. There are constant ints for the indexes of this
  * array.
  *
  * @param gapId index in array GAP_NAME_LOOK_UP for the needed gap
  * @return the gap depend on the xml-configurable guiprefs modifier
  */
 public int getYGap(int gapId) {
   gapId = IzPanelLayout.verifyGapId(gapId);
   if (IzPanelLayout.getDefaultYGap(GAP_LOAD_MARKER) >= 0) {
     return (IzPanelLayout.getDefaultYGap(gapId));
   }
   if (!(installData instanceof GUIInstallData)) {
     return (IzPanelLayout.getDefaultYGap(gapId));
   }
   String var;
   GUIInstallData id = (GUIInstallData) installData;
   int commonDefault = -1;
   if (id.guiPrefs.modifier.containsKey(ALL_Y_GAP)) {
     try {
       commonDefault = Integer.parseInt(id.guiPrefs.modifier.get(ALL_Y_GAP));
     } catch (NumberFormatException nfe) {
       // Do nothing else use the default value.
       // Need to set it again at this position??
     }
   }
   for (int i = 0; i < Y_GAP_NAME_LOOK_UP.length; ++i) {
     int currentDefault = 0;
     if (commonDefault >= 0) {
       currentDefault = commonDefault;
     } else {
       var = id.guiPrefs.modifier.get(Y_GAP_NAME_LOOK_UP[i]);
       if (var != null) {
         try {
           currentDefault = Integer.parseInt(var);
         } catch (NumberFormatException nfe) {
           // Do nothing else use the default value.
           // Need to set it again at this position??
         }
       }
     }
     IzPanelLayout.setDefaultYGap(currentDefault, i);
   }
   IzPanelLayout.setDefaultYGap(0, GAP_LOAD_MARKER); // Mark external settings allready
   // loaded.
   return (IzPanelLayout.getDefaultYGap(gapId));
 }