Package net.sf.rej.java.constantpool

Examples of net.sf.rej.java.constantpool.FloatInfo


        sd.drawDefault("(");
        sd.drawKeyword("double");
        sd.drawDefault(") " + di.getDoubleValue());
        break;
      case ConstantPoolInfo.FLOAT:
        FloatInfo fi = (FloatInfo) constant;
        sd.drawDefault("(");
        sd.drawKeyword("float");
        sd.drawDefault(") " + fi.getFloatValue());
        break;
      case ConstantPoolInfo.INTEGER:
        IntegerInfo ii = (IntegerInfo) constant;
        sd.drawDefault("(");
        sd.drawKeyword("int");
View Full Code Here


    case ConstantPoolInfo.DOUBLE:
      DoubleInfo di = (DoubleInfo) cpi;
      bie.invoke("Edit Double Info", String.valueOf(di.getDoubleValue()));
      break;
    case ConstantPoolInfo.FLOAT:
      FloatInfo fi = (FloatInfo) cpi;
      bie.invoke("Edit Float Info", String.valueOf(fi.getFloatValue()));
      break;
    case ConstantPoolInfo.INTEGER:
      IntegerInfo ii = (IntegerInfo) cpi;
      bie.invoke("Edit Integer Info", String.valueOf(ii.getIntValue()));
      break;
View Full Code Here

  }

  void validateAndInsertFloatInfo(String str) throws BasicInfoEditor.ValidationException {
    try {
      float f = Float.parseFloat(str);
      EditorFacade.getInstance().addConstantPoolInfo(this.cf.getPool(), new FloatInfo(f, this.cf.getPool()));
    } catch (Exception e) {
      throw new BasicInfoEditor.ValidationException(e.getMessage());
    }
  }
View Full Code Here

      }
      EditorFacade.getInstance().modifyDoubleInfo(info, d);
      break;
    }
    case ConstantPoolInfo.FLOAT: {
      FloatInfo info = (FloatInfo) cpi;
      float f = 0;
      try {
        f = Float.parseFloat(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid float. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyFloatInfo(info, f);
      break;
    }
    case ConstantPoolInfo.INTEGER: {
      IntegerInfo info = (IntegerInfo) cpi;
      int i = 0;
      try {
        i = Integer.parseInt(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid integer. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyIntegerInfo(info, i);
      break;
    }
    case ConstantPoolInfo.LONG: {
      LongInfo info = (LongInfo) cpi;
      long l = 0;
      try {
        l = Long.parseLong(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid long. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyLongInfo(info, l);
      break;
    }
    case ConstantPoolInfo.STRING: {
      StringInfo info = (StringInfo) cpi;
      int answer = JOptionPane.showOptionDialog(this,
          "Modify underlying UTF-8 info or create a new one.",
          "Modify String Info item",
          JOptionPane.YES_NO_CANCEL_OPTION,
          JOptionPane.QUESTION_MESSAGE, null, new String[] {
              "Modify", "Create new", "Cancel" }, "Modify");
      if (answer == JOptionPane.YES_OPTION) {
        // Modify UTF-8 Info
        UTF8Info ui = info.getUTF8Info();
        EditorFacade.getInstance().modifyUTF8Info(ui, newValue);
        break;

      } else if (answer == JOptionPane.NO_OPTION) {
        // Create a new UTF-8 Info
View Full Code Here

                int index = destinationPool.optionalAdd(diCopy);
                copyParams.addValue(index);
                break;
              }
              case ConstantPoolInfo.FLOAT: {
                FloatInfo fi = (FloatInfo)cpi;
                FloatInfo fiCopy = new FloatInfo(fi.getBytes(), destinationPool);
                int index = destinationPool.optionalAdd(fiCopy);
                copyParams.addValue(index);
                break;                   
              }
              case ConstantPoolInfo.INTEGER: {
View Full Code Here

TOP

Related Classes of net.sf.rej.java.constantpool.FloatInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.