コード例 #1
0
 protected void setToolTip() {
   TileI currentTile =
       orUIManager.getGameUIManager().getGameManager().getTileManager().getTile(internalId);
   StringBuffer tt = new StringBuffer("<html>");
   tt.append("<b>Tile</b>: ").append(currentTile.getName()); // or
   // getId()
   if (currentTile.hasStations()) {
     // for (Station st : currentTile.getStations())
     int cityNumber = 0;
     // TileI has stations, but
     for (Station st : currentTile.getStations()) {
       cityNumber++; // = city.getNumber();
       tt.append("<br>  ")
           .append(st.getType())
           .append(" ")
           .append(cityNumber) // .append("/").append(st.getNumber())
           .append(": value ");
       tt.append(st.getValue());
       if (st.getBaseSlots() > 0) {
         tt.append(", ").append(st.getBaseSlots()).append(" slots");
       }
     }
   }
   tt.append("</html>");
   toolTip = tt.toString();
 }
コード例 #2
0
  public void setAdvancedValues() {
    // get pretty ranges for the current parameters
    // get the range for the station value
    double min = 10000;
    double max = 0;
    for (int fc = 0; fc < mFileViewer.mNumOpenFiles; fc++) {
      OpenDataFile of = (OpenDataFile) mFileViewer.mOpenFiles.elementAt(fc);

      for (int sec = 0; sec < of.mNumSections; sec++) {
        Section sech = (Section) of.mSections.elementAt(sec);

        if (sech.mNumCasts == 0) {
          continue;
        }

        for (int stc = 0; stc < sech.mStations.size(); stc++) {
          Station sh = (Station) sech.mStations.elementAt(stc);
          if (!sh.mUseStn) {
            continue;
          }

          // get the station value
          double y = sh.getStnValue(mSelYParam);
          if (y == JOAConstants.MISSINGVALUE || y >= JOAConstants.EPICMISSINGVALUE) {
            continue;
          } else {
            min = y < min ? y : min;
            max = y > max ? y : max;
          }
        }
      }
    }

    Triplet newRange = JOAFormulas.GetPrettyRange(min, max);
    double yMinv = newRange.getVal1();
    double yMaxv = newRange.getVal2();
    double yIncv = newRange.getVal3();
    yMin.setText(JOAFormulas.formatDouble(String.valueOf(yMinv), 3, false));
    yMax.setText(JOAFormulas.formatDouble(String.valueOf(yMaxv), 3, false));
    yInc.setText(JOAFormulas.formatDouble(String.valueOf(yIncv), 3, false));
    yTics.setValue(new Integer(yTicsVal));
    if (b1.isSelected()) {
      mOffset = JOAConstants.PROFSEQUENCE;
      setXRangeToSequence();
    } else if (b2.isSelected()) {
      mOffset = JOAConstants.PROFDISTANCE;
      setXRangeToDistance();
    } else if (b3.isSelected()) {
      mOffset = JOAConstants.PROFTIME;
      setXRangeToTime();
    }
  }