示例#1
0
 @Override
 public Object getNextValue() {
   if (part.getArmor(side) < part.getArmorMax(side)) {
     return Integer.valueOf(part.getArmor(side) + 1);
   }
   return Integer.valueOf(part.getArmor(side) + 1);
 }
示例#2
0
  @Override
  public void setValue(Object arg0) {
    if (getValue().equals(arg0)) return;

    try {
      final boolean setSymmetric =
          symmetric.isSelected()
              && part.getInternalComponent().getLocation().oppositeSide() != null;
      final int armor = ((Integer) arg0).intValue();

      if (setSymmetric) {
        opStack.pushAndApply(new OpSetArmorSymmetric(xBar, loadout, part, side, armor, true));
      } else {
        opStack.pushAndApply(new OpSetArmor(xBar, loadout, part, side, armor, true));
      }
    } catch (IllegalArgumentException exception) {
      // TODO: Handle failed case better!
      Toolkit.getDefaultToolkit().beep();
    } finally {
      fireStateChanged();
    }
  }
示例#3
0
 @Override
 public Object getValue() {
   return Integer.valueOf(part.getArmor(side));
 }
示例#4
0
 @Override
 public Object getPreviousValue() {
   if (part.getArmor(side) < 1) return null;
   return Integer.valueOf(part.getArmor(side) - 1);
 }