Exemplo n.º 1
0
  @Override
  public void load(Plot plot) {
    slopeRG1.clearCheck();
    slopeRG2.clearCheck();
    slopeTV.setText(null);

    // String stringValue = plot.slope;
    // String stringValue = plot.slope == null ? null : Slope.valueOf(plot.slope).getDisplayName();
    String stringValue;
    try {
      stringValue = plot.slope == null ? null : Slope.valueOf(plot.slope).getDisplayName();
    } catch (IllegalArgumentException iAE) {
      stringValue = plot.slope;
      slopeTV.setText(stringValue);
      slopeTV.setVisibility(View.VISIBLE);
    }
    RadioButton rB = null;
    for (String slopeChoice : slopeChoices) {
      if (slopeChoice.equals(stringValue)) {
        rB = (RadioButton) slopeRG1.findViewWithTag(slopeChoice);
        if (rB == null) {
          rB = (RadioButton) slopeRG2.findViewWithTag(slopeChoice);
        }
        break;
      }
    }
    if (rB != null) rB.setChecked(true);

    // Waiting to add these here prevents Toast popping on load.  Still waiting to see if there are
    // side-effects.
    // slopeRG1.setOnCheckedChangeListener(slopeListener1);
    // slopeRG2.setOnCheckedChangeListener(slopeListener2);
  }
Exemplo n.º 2
0
  public boolean equals(Object object) {
    if (this == object) {
      return true;
    }

    if (object == null || object.getClass() != getClass()) {
      return false;
    }

    Slope other = (Slope) object;

    if (isVertical() && other.isVertical()) {
      return true;
    }

    if (isVertical() || other.isVertical()) {
      return false;
    }

    return (asDouble()) == (other.asDouble());
  }
Exemplo n.º 3
0
 static {
   for (Slope s : Slope.values()) {
     serverNameLookup.put(LandPKSApplication.getInstance().getString(s.serverName), s);
   }
 }