コード例 #1
0
 protected void trainIconMoved(java.awt.event.ComponentEvent ae) {
   if (ae.getSource() == _tIon) {
     log.debug("train icon X: {} Y: {}", _tIon.getLocation().x, _tIon.getLocation().y);
     spinTrainIconX.setValue(_tIon.getLocation().x);
     spinTrainIconY.setValue(_tIon.getLocation().y);
   }
 }
コード例 #2
0
ファイル: ObjectNURBS.java プロジェクト: freezzone/cscg
 /** Nasatavení počtu kroků pro vykreslení. 0=automatické určení. */
 public final synchronized void setSteps(int steps) {
   if (steps < 0 || steps > MAX_STEPS) {
     steps = 0;
   }
   if (steps == 0) {
     guiSteps.setEnabled(false);
     guiChangingValue = true; // zabráním opětovnému vyvolání akce změny při změně gui
     guiStepsAuto.setSelected(true);
     // zabráním aby byla hodnota "0" v gui prvku pro počet kroů
     if (((Integer) guiSteps.getValue()).intValue() == 0) {
       guiSteps.setValue(100);
     }
     guiChangingValue = false;
   } else {
     guiSteps.setEnabled(true);
     guiChangingValue = true; // zabráním opětovnému vyvolání akce změny při změně gui
     guiStepsAuto.setSelected(false);
     guiSteps.setValue(steps);
     guiChangingValue = false;
   }
   this.steps = steps;
   for (ObjectListener l : listeners) {
     l.eventSpecificPropertiesChanged(this);
   }
 }
コード例 #3
0
 @SuppressWarnings("resource")
 private void checkFileLocationInfo() {
   File fileAutoSave = new File(LOCATION_URL + "/autoconf.txt");
   if (fileAutoSave.exists()) {
     try {
       BufferedReader br = new BufferedReader(new FileReader(fileAutoSave));
       String line = "";
       while ((line = br.readLine()) != null) {
         String[] info = line.split(";");
         dateStart = dateFormat.parse(info[0]);
         dateEnd = dateFormat.parse(info[1]);
         idTimeOption = Integer.parseInt(info[2]);
         stepHour = Integer.parseInt(info[3]);
         location = info[4];
         stepSave = Integer.parseInt(info[5]);
         hourStart = Integer.parseInt(info[6]);
         minuteStart = Integer.parseInt(info[7]);
       }
       startDate.setDate(dateStart);
       endDate.setDate(dateEnd);
       spinner.setValue(stepHour);
       txtLocation.setText(location);
       spinnerQuantityFile.setValue(stepSave);
       spinnerHourStart.setValue(hourStart);
       spinnerMinute.setValue(minuteStart);
     } catch (ParseException ex) {
       ex.printStackTrace();
     } catch (IOException ex) {
       ex.printStackTrace();
     }
   }
 }
コード例 #4
0
  /** initializes the GUI components with the data. */
  private void setData() {
    m_IgnoreChanges = true;

    // Precision
    m_MeanPrecSpinner.setValue(m_ResultMatrix.getMeanPrec());
    m_StdDevPrecSpinner.setValue(m_ResultMatrix.getStdDevPrec());

    // format
    for (int i = 0; i < m_OutputFormatClasses.size(); i++) {
      if (m_OutputFormatClasses.get(i).equals(m_ResultMatrix.getClass())) {
        m_OutputFormatComboBox.setSelectedItem(m_OutputFormatNames.get(i));
        break;
      }
    }

    // average
    m_ShowAverageCheckBox.setSelected(m_ResultMatrix.getShowAverage());

    // filter names
    m_RemoveFilterNameCheckBox.setSelected(m_ResultMatrix.getRemoveFilterName());

    // GOE
    m_ResultMatrixEditor.setValue(m_ResultMatrix);

    m_IgnoreChanges = false;
  }
コード例 #5
0
 /**
  * @param parent the interval item's parent component
  * @param left initial left value
  * @param right initial right value
  * @param binValue the bin value
  * @param type the column type of this interval
  */
 IntervalItemPanel(
     final IntervalPanel parent,
     final Double left,
     final Double right,
     final Double binValue,
     final DataType type) {
   this(parent, type);
   if (binValue == null) {
     m_bin.setValue(0);
     m_bin.setEnabled(false);
   } else {
     m_bin.setValue(binValue);
   }
   JPanel p1 = new JPanel(new BorderLayout());
   p1.add(m_bin, BorderLayout.CENTER);
   p1.add(new JLabel(" :  "), BorderLayout.EAST);
   super.add(p1);
   JPanel p2 = new JPanel(new BorderLayout());
   p2.add(m_borderLeft, BorderLayout.WEST);
   p2.add(m_left, BorderLayout.CENTER);
   p2.add(new JLabel(" ."), BorderLayout.EAST);
   setLeftValue(left);
   super.add(p2);
   JPanel p3 = new JPanel(new BorderLayout());
   p3.add(new JLabel(". "), BorderLayout.WEST);
   p3.add(m_right, BorderLayout.CENTER);
   p3.add(m_borderRight, BorderLayout.EAST);
   setRightValue(right);
   super.add(p3);
   initListener();
 }
コード例 #6
0
  private void initOtherComponents() {
    Calendar now = Calendar.getInstance();
    toDatejSpinner.setValue(now.getTime());
    now.add(Calendar.MONTH, -6);
    fromDatejSpinner.setValue(now.getTime());

    exchangeJComboBox.setModel(
        new DefaultComboBoxModel(mainJFrame.mappingExchangeID_Assets.keySet().toArray()));
    exchangeComboKeyHandler = new ComboKeyHandler(exchangeJComboBox);
    JTextField fieldExchange = (JTextField) exchangeJComboBox.getEditor().getEditorComponent();
    fieldExchange.addKeyListener(exchangeComboKeyHandler);

    assetJComboBox.setModel(
        new DefaultComboBoxModel(
            mainJFrame.mappingExchangeID_Assets.get(
                (ExchangeEntity) exchangeJComboBox.getSelectedItem())));
    assetComboKeyHandler = new ComboKeyHandler(assetJComboBox);
    JTextField fieldSymbol = (JTextField) assetJComboBox.getEditor().getEditorComponent();
    fieldSymbol.addKeyListener(assetComboKeyHandler);

    asset = (AssetEntity) assetJComboBox.getSelectedItem();
    toDate = (Date) toDatejSpinner.getValue();
    fromDate = (Date) fromDatejSpinner.getValue();

    newAddDecAlgJDialog();
    newAddCriteriaJDialog();
    newImportPortfolioJDialog();
  }
コード例 #7
0
 private void loadFloor() {
   if (currentFloor == null) return;
   isLoading = true;
   blendingCheckbox.setSelected(currentFloor.occlude);
   switch (previewBox.getMode()) {
     case RT3_GAME:
       gameColour.setColour(currentFloor.colour2);
       gameTexture.setValue(currentFloor.texture);
       gameName.setText(currentFloor.name);
       break;
     case RT3_MAP:
       gameColour.setColour(currentFloor.minimapColour);
       gameTexture.setValue(currentFloor.texture);
       gameName.setText(currentFloor.name);
       break;
     case RT4P_OVERLAY:
       gameColour.setColour(currentFloor.hdColour);
       gameTexture.setValue(currentFloor.hdTexture);
       // gameName.setText(currentFloor.name);
       break;
     case RT4P_UNDERLAY:
       gameColour.setColour(currentFloor.hdUlColour);
       gameTexture.setValue(currentFloor.hdUlTexture);
       // gameName.setText(currentFloor.name);
       break;
   }
   isLoading = false;
   previewBox.repaint();
 }
コード例 #8
0
  /** Called in order to adjust the route start time and the UI accordingly */
  private void adjustStartTime() {

    // Stop widget listeners
    boolean wasQuiescent = quiescent;
    quiescent = true;

    // Get start time or default now
    if (!readOnlyRoute) {
      route.adjustStartTime();
    }
    Date starttime = route.getStarttime();

    departurePicker.setDate(starttime);
    departureSpinner.setValue(starttime);

    // Attempt to get ETA (only possible if GPS data is available)
    Date etaStart = route.getEta(starttime);
    if (etaStart != null) {
      // GPS data available.
      arrivalPicker.setDate(etaStart);
      arrivalSpinner.setValue(etaStart);
    } else {
      // No GPS data available.
      // Find the default ETA.
      Date defaultEta = route.getEtas().get(route.getEtas().size() - 1);
      arrivalPicker.setDate(defaultEta);
      arrivalSpinner.setValue(defaultEta);
    }

    // Recalculate and update route fields
    updateFields();

    // Restore the quiescent state
    quiescent = wasQuiescent;
  }
コード例 #9
0
  public void setMuestra(int r, int g, int b, int limit) {
    spinRed.setValue(r);
    spinGreen.setValue(g);
    spinBlue.setValue(b);
    spinLimite.setValue(limit);

    actualizarMuestraActual();
  }
コード例 #10
0
  /**
   * Changes animation delay
   *
   * @param delay delay in seconds
   */
  public void setPlayDelay(double delay) {
    playDelay = delay;

    try {
      spDelay.setValue(new Double(playDelay));
    } catch (Exception e) {
      spDelay.setValue(new Integer((int) Math.round(playDelay)));
    }
  }
コード例 #11
0
  /**
   * Given a new arrival date, re-calculate the speed
   *
   * @param arrivalDate the new arrival date
   */
  private void recalculateSpeeds(Date arrivalDate) {
    // Stop widget listeners
    boolean wasQuiescent = quiescent;
    quiescent = true;

    // Special case if the arrival date is before the start time
    if (route.getStarttime().after(arrivalDate)) {
      // Reset arrival to a valid time
      arrivalPicker.setDate(route.getEta());
      arrivalSpinner.setValue(route.getEta());

      quiescent = wasQuiescent;
      return;
    }

    // Total distance
    Dist distanceToTravel = new Dist(DistType.NAUTICAL_MILES, route.getRouteDtg());
    // And we want to get there in milliseconds:
    Time timeToTravel =
        new Time(TimeType.MILLISECONDS, arrivalDate.getTime() - route.getStarttime().getTime());

    // Subtract the distance and time from the locked way points
    for (int i = 0; i < route.getWaypoints().size() - 1; i++) {
      if (locked[i]) {
        distanceToTravel =
            distanceToTravel.subtract(new Dist(DistType.NAUTICAL_MILES, route.getWpRng(i)));
        timeToTravel =
            timeToTravel.subtract(new Time(TimeType.MILLISECONDS, route.getWpTtg(i + 1)));
      }
    }

    // Ensure the remaining time is actually positive (say, more than a minute)
    if (timeToTravel.in(TimeType.MINUTES).doubleValue() < 1.0) {
      // Reset arrival to a valid time
      arrivalPicker.setDate(route.getEta());
      arrivalSpinner.setValue(route.getEta());

      quiescent = wasQuiescent;
      return;
    }

    // So we need to travel how fast?
    double speed = distanceToTravel.inTime(timeToTravel).in(SpeedType.KNOTS).doubleValue();

    for (int i = 0; i < route.getWaypoints().size(); i++) {
      if (!locked[i]) {
        route.getWaypoints().get(i).setSpeed(speed);
      }
    }

    // Update fields
    updateFields();

    // Restore the quiescent state
    quiescent = wasQuiescent;
  }
コード例 #12
0
ファイル: MainForm.java プロジェクト: kplogo/google
 public MainForm() {
   alfa.setValue(1);
   beta.setValue(1);
   gamma.setValue(1);
   loadDatabase.addActionListener(
       e -> {
         fileChooser.setCurrentDirectory(new File(database.getText()));
         int returnVal = fileChooser.showOpenDialog(panel1);
         if (returnVal == JFileChooser.APPROVE_OPTION) {
           File file = fileChooser.getSelectedFile();
           database.setText(file.getPath());
         }
       });
   loadKeyword.addActionListener(
       e -> {
         fileChooser.setCurrentDirectory(new File(keywords.getText()));
         int returnVal = fileChooser.showOpenDialog(panel1);
         if (returnVal == JFileChooser.APPROVE_OPTION) {
           File file = fileChooser.getSelectedFile();
           keywords.setText(file.getPath());
         }
       });
   search.addActionListener(
       e -> {
         isKeywordsEnabled = keywordsEnabled.getSelectedIndex() != 0;
         DatabaseCollection.clear();
         if (isKeywordsEnabled) {
           new KeywordParser(keywords.getText()).parse();
         }
         new DocumentParser(database.getText()).parse();
         Method method1 = Method.valueOf((String) MainForm.this.method.getSelectedItem());
         Document query1 = new Document(MainForm.this.query.getText(), "", false);
         showResults(method1, query1);
       });
   oznacz.addActionListener(
       e -> {
         for (Result result : results.getSelectedValuesList()) {
           result.setMarkedAsGood(!result.isMarkedAsGood());
         }
         results.repaint();
       });
   newQuestion.addActionListener(
       e -> {
         ResultModel model = (ResultModel) results.getModel();
         Document query1 = model.getQuery();
         calculateRelevance(
             model.getResultList(),
             query1,
             (Integer) alfa.getValue(),
             (Integer) beta.getValue(),
             (Integer) gamma.getValue());
         queryHelp.setText(query1.getQueryText());
         Method method1 = Method.valueOf((String) MainForm.this.method.getSelectedItem());
         showResults(method1, query1);
       });
 }
コード例 #13
0
 /** @param left new left value */
 public void setLeftValue(final Double left) {
   if (left == null || left.doubleValue() == NEGATIVE_INFINITY) {
     m_borderLeft.setSelectedItem(LEFT);
     m_borderLeft.setEnabled(false);
     m_left.setValue(NEGATIVE_INFINITY);
     m_left.setEnabled(false);
   } else {
     m_left.setValue(left);
     m_left.setEnabled(true);
     m_borderLeft.setEnabled(true);
   }
 }
コード例 #14
0
ファイル: ChunkEditor.java プロジェクト: holmgard/PCGG2012
 private void selectChunk() {
   Chunk sel = cl.getChunk(list.getSelectedValue());
   if (sel != null) {
     currentChunk = sel;
     levelDrawer.setSize(sel.getWidth() * 16, sel.getHeight() * 16);
     widthSpinner.setValue(sel.getWidth());
     heightSpinner.setValue(sel.getHeight());
     levelDrawer.setMap(currentChunk.getMap());
     levelDrawer.setSprites(currentChunk.getSprites());
     levelDrawer.repaint();
   }
 }
コード例 #15
0
 @Override
 public void setValue(PropertyType type, Object value) {
   final Timestamp t = (Timestamp) value;
   if (t != null) {
     datePicker.setDate(t);
     final Calendar calendar = GregorianCalendar.getInstance();
     calendar.setTime(t);
     final int hour = calendar.get(Calendar.HOUR_OF_DAY);
     final int minute = calendar.get(Calendar.MINUTE);
     hours.setValue(hour);
     minutes.setValue(minute);
   }
 }
コード例 #16
0
    /** @param right new right value */
    public void setRightValue(final Double right) {
      if (right == null || right.doubleValue() == POSITIVE_INFINITY) {
        m_borderRight.setSelectedItem(RIGHT);
        m_borderRight.setEnabled(false);
        m_right.setValue(POSITIVE_INFINITY);
        m_right.setEnabled(false);

      } else {
        m_right.setValue(right);
        m_right.setEnabled(true);
        m_borderRight.setEnabled(true);
      }
    }
コード例 #17
0
 @Override
 public void reset() {
   VcsContentAnnotationSettings settings = VcsContentAnnotationSettings.getInstance(myProject);
   myHighlightRecentlyChanged.setSelected(settings.isShow());
   myHighlightInterval.setValue(settings.getLimitDays());
   myHighlightInterval.setEnabled(myHighlightRecentlyChanged.isSelected());
 }
コード例 #18
0
  /**
   * Initialises the components.
   *
   * @param duration Duration to initialise to
   */
  private void initComponents(final long duration) {
    orderButtons(new JButton(), new JButton());
    daysSpinner = new JSpinner(new SpinnerNumberModel(0, 0, MAX_DAYS_IN_MONTH, 1));
    hoursSpinner = new JSpinner(new SpinnerNumberModel(0, 0, HOURS_IN_DAY, 1));
    minutesSpinner = new JSpinner(new SpinnerNumberModel(0, 0, SECONDS_IN_MINUTE, 1));
    secondsSpinner = new JSpinner(new SpinnerNumberModel(0, 0, SECONDS_IN_MINUTE, 1));

    long updatedDuration = duration;
    daysSpinner.setValue((int) duration / SECONDS_IN_DAY);
    updatedDuration = (updatedDuration % SECONDS_IN_DAY);
    hoursSpinner.setValue((int) duration / SECONDS_IN_HOURS);
    updatedDuration = (updatedDuration % SECONDS_IN_HOURS);
    minutesSpinner.setValue((int) duration / SECONDS_IN_MINUTE);
    updatedDuration = (updatedDuration % SECONDS_IN_MINUTE);
    secondsSpinner.setValue((int) duration);
  }
コード例 #19
0
  private void resetSettings() {
    downloadDirectoryTextField.setText(Groovesquid.getConfig().getDownloadDirectory());
    maxParallelDownloadsSpinner.setValue(Groovesquid.getConfig().getMaxParallelDownloads());
    fileNameSchemeTextField.setText(Groovesquid.getConfig().getFileNameScheme());

    String[] downloadCompleteActions = Config.DownloadComplete.names();
    DefaultComboBoxModel downloadCompleteComboBoxModel = new DefaultComboBoxModel();
    downloadCompletedComboBox.setModel(downloadCompleteComboBoxModel);
    for (String downloadCompleteAction : downloadCompleteActions) {
      downloadCompleteComboBoxModel.addElement(I18n.getLocaleString(downloadCompleteAction));
    }
    downloadCompletedComboBox.setSelectedIndex(Groovesquid.getConfig().getDownloadComplete());

    String[] startTabs = Config.StartTab.names();
    DefaultComboBoxModel startTabComboBoxModel = new DefaultComboBoxModel();
    startTabComboBox.setModel(startTabComboBoxModel);
    for (String startTab : startTabs) {
      startTabComboBoxModel.addElement(I18n.getLocaleString(startTab));
    }
    startTabComboBox.setSelectedIndex(Groovesquid.getConfig().getStartTab());

    String[] fileExistsActions = Config.FileExists.names();
    DefaultComboBoxModel fileExistsComboBoxModel = new DefaultComboBoxModel();
    fileExistsComboBox.setModel(fileExistsComboBoxModel);
    for (String fileExistsAction : fileExistsActions) {
      fileExistsComboBoxModel.addElement(I18n.getLocaleString(fileExistsAction));
    }
    fileExistsComboBox.setSelectedIndex(Groovesquid.getConfig().getFileExists());

    if (Groovesquid.getConfig().getProxyHost() != null
        && Groovesquid.getConfig().getProxyPort() != null) {
      proxyHostTextField.setText(Groovesquid.getConfig().getProxyHost());
      proxyPortTextField.setText(Groovesquid.getConfig().getProxyPort().toString());
    }
  }
コード例 #20
0
 @Override
 void doPropertyChange(PropertyChangeEvent evt) {
   super.doPropertyChange(evt);
   if (checkIsFieldChange(Field.SEMESTER, evt)) {
     spinnerSemester.setValue(kurseSemesterwahlModel.getSemester());
   }
 }
コード例 #21
0
  public void setXRangeToTime() {
    showTime();
    // set the x axis from the time range of the data
    GeoDate minDate = mFileViewer.getMinDate();
    GeoDate maxDate = mFileViewer.getMaxDate();

    xTics.setValue(new Integer(xTicsVal));
  }
コード例 #22
0
 /**
  * Set the selected font to the given font.
  *
  * @param font Font.
  */
 public void setSelectedFont(Font font) {
   myFontFamilyComboBox.setSelectedItem(font.getFamily());
   int style = Font.PLAIN;
   if (font.isBold()) style += Font.BOLD;
   if (font.isItalic()) style += Font.ITALIC;
   myFontStyleComboBox.setSelectedIndex(style);
   myFontSizeSpinner.setValue(new Integer(font.getSize()));
 }
コード例 #23
0
ファイル: Cogmaker.java プロジェクト: kaffeel/ThulikaIME
  private void populateImageData() {
    CharData currentChar = (CharData) charListBox.getSelectedValue();
    if (currentChar == null) {
      imageListBox.setListData(new Object[0]);
      symField.setText("");
      alignSelector.setValue(0);
      rulesBox.setText("");
      alterBox.setText("");
      return;
    }
    imageListBox.setListData(trainer.getCharSet().get(currentChar).keySet().toArray());
    imageListBox.setSelectedIndex(0);

    symField.setText(currentChar.toString());
    alignSelector.setValue(currentChar.getAlign());
    rulesBox.setText(makeRuleString(currentChar.getMergeRules()));
    // alterBox.setText(makeAlternativesString(currentChar.getAlternatives()));
  }
コード例 #24
0
ファイル: ShoppingListPage.java プロジェクト: YArane/ECSE_429
  private void refreshData() {
    ShoppingListManager rm = ShoppingListManager.getInstance();
    // error
    errorMessage.setText(error);
    if (error == null || error.length() == 0) {
      // item list
      items = new HashMap<Integer, Item>();
      itemList.removeAllItems();
      Iterator<Item> iIt = rm.getItems().iterator();
      Integer index = 0;
      while (iIt.hasNext()) {
        Item i = iIt.next();
        items.put(index, i);
        itemList.addItem(i.getName());
        index++;
      }
      selectedItem = -1;
      itemList.setSelectedIndex(selectedItem);
      // store visit list
      storeVisits = new HashMap<Integer, StoreVisit>();
      storeVisitList.removeAllItems();
      Iterator<StoreVisit> svIt = rm.getStoreVisits().iterator();
      index = 0;
      while (svIt.hasNext()) {
        StoreVisit sv = svIt.next();
        storeVisits.put(index, sv);
        storeVisitList.addItem(sv.getName());
        index++;
      }
      selectedStoreVisit = -1;
      storeVisitList.setSelectedIndex(selectedStoreVisit);
      // item
      itemNameTextField.setText("");
      // store visit
      storeVisitNameTextField.setText("");
      storeVisitDatePicker.getModel().setValue(null);
      storeVisitStartTimeSpinner.setValue(new Date());
      storeVisitEndTimeSpinner.setValue(new Date());
    }

    // this is needed because the size of the window changes depending on whether an error message
    // is shown or not
    pack();
  }
コード例 #25
0
 private void setValue(final JComponent component) {
   final String primitiveFormName = _primitiveForm.getName();
   if (_dotDefinitionDialogFrame.isPropertyStatic(primitiveFormName, _property)) {
     Object object =
         _dotDefinitionDialogFrame.getValueOfStaticProperty(primitiveFormName, _property);
     if (component instanceof JComboBox) {
       final String currentValue;
       if (object instanceof Color) {
         currentValue = ColorManager.getInstance().getColorName((Color) object);
       } else if (object instanceof Integer) {
         Integer i = (Integer) object;
         if (i.equals(Font.PLAIN)) {
           currentValue = STANDARD_FONT;
         } else if (i.equals(Font.BOLD)) {
           currentValue = BOLD_FONT;
         } else if (i.equals(Font.ITALIC)) {
           currentValue = ITALIC_FONT;
         } else {
           currentValue = "Unbekannter Font";
         }
       } else {
         currentValue = (String) object;
       }
       JComboBox comboBox = (JComboBox) component;
       comboBox.setSelectedItem(currentValue);
     } else if (component instanceof JSpinner) {
       JSpinner spinner = (JSpinner) component;
       if (object instanceof Integer) {
         spinner.setValue((Integer) object);
       } else {
         spinner.setValue((Double) object);
       }
     }
   } else {
     if (component instanceof JComboBox) {
       JComboBox comboBox = (JComboBox) component;
       comboBox.setSelectedItem(DOTPoint.getDefaultValue(_property));
     } else if (component instanceof JSpinner) {
       JSpinner spinner = (JSpinner) component;
       spinner.setValue(DOTPoint.getDefaultValue(_property));
     }
   }
 }
コード例 #26
0
ファイル: NPCPane.java プロジェクト: CrazyPyroEagle/MEH
 void Load(SpritesNPCManager mgr, int NPCIndex) {
   SpriteNPC t = mgr.mapNPCs.get(NPCIndex);
   txtSpriteSet.setValue(t.bSpriteSet & 0xFF);
   txtBehavior1.setText(Byte.toString(t.bBehavior1));
   txtBehavior2.setText(Byte.toString(t.bBehavior2));
   chkIsTrainer.setSelected(t.bIsTrainer == 1);
   txtTrainerLOS.setText(Byte.toString(t.bTrainerLOS));
   txtScript.setText(String.format("%X", ((int) t.pScript)));
   txtiFlag.setText(BitConverter.toHexString(t.iFlag));
 }
コード例 #27
0
 public void setType(String type) {
   if ("Control Change".equals(type)) {
     channel.setEnabled(true);
     cc.setEnabled(true);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(0);
     max.setValue(127);
     modeList.setEnabled(false);
   } else if ("NRPN".equals(type)) {
     channel.setEnabled(true);
     cc.setEnabled(true);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(0);
     max.setValue(127);
     modeList.setEnabled(false);
   } else if ("Pitch Bend".equals(type)) {
     channel.setEnabled(true);
     cc.setEnabled(false);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(-8192);
     max.setValue(8191);
     modeList.setEnabled(false);
   } else if ("Basenote".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(0);
     max.setValue(127);
     modeList.setEnabled(false);
   } else if ("Scale".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(false);
     max.setEnabled(false);
     modeList.setEnabled(false);
   } else if ("Mode Change".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(false);
     max.setEnabled(false);
     modeList.setEnabled(true);
   } else if ("Unassigned".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(false);
     max.setEnabled(false);
     modeList.setEnabled(false);
   }
 }
コード例 #28
0
ファイル: ConfigView.java プロジェクト: kira911/ServerJCM
  private void carregaConfig() {
    try {
      File file = new File("config.xml");
      SAXBuilder builder = new SAXBuilder();
      Document doc = builder.build(file);
      Element root = doc.getRootElement();
      List list = root.getChildren();
      Iterator i = list.iterator();

      while (i.hasNext()) {
        Element xml = (Element) i.next();

        Config c = new Config();
        c.setPathRouterSnapshot(xml.getChildText("pathRouterSnapshot"));
        c.setPathDestSnapshot(xml.getChildText("pathDestSnapshot"));
        c.setSmtpHostEmail(xml.getChildText("smtpHostEmail"));
        c.setSmtpPortEmail(Integer.parseInt(xml.getChildText("smtpPortEmail")));
        c.setUserEmail(xml.getChildText("userEmail"));
        c.setPassEmail(xml.getChildText("passEmail"));
        c.setHostFTP(xml.getChildText("hostFTP"));
        c.setPortaFTP(Integer.parseInt(xml.getChildText("portaFTP")));
        c.setUserFTP(xml.getChildText("userFTP"));
        c.setPassFTP(xml.getChildText("passFTP"));
        c.setPathDestFTP(xml.getChildText("pathDestFTP"));

        txtPathAlarmeRouter.setText(c.getPathRouterSnapshot());
        txtPathDestRouter.setText(c.getPathDestSnapshot());
        txtSmtpHostEmail.setText(c.getSmtpHostEmail());
        txtSmtpPortaEmail.setValue(c.getSmtpPortEmail());
        txtUserEmail.setText(c.getUserEmail());
        txtPassEmail.setText(c.getPassEmail());
        txtHostFTP.setText(c.getHostFTP());
        txtPortaFTP.setValue(c.getPortaFTP());
        txtUserFTP.setText(c.getUserFTP());
        txtPassFTP.setText(c.getPassFTP());
        txtPathDestFTP.setText(c.getPathDestFTP());
      }
    } catch (JDOMException ex) {
      System.out.println(ex.getMessage());
    } catch (IOException ex) {
      System.out.println(ex.getMessage());
    }
  }
コード例 #29
0
  /*-------------------------------------------------------------------------*/
  public void refresh(String name) {
    if (name == null) {
      return;
    }

    DifficultyLevel dl = Database.getInstance().getDifficultyLevels().get(name);

    impl.setText(dl.getClass().getName());
    sortOrder.setValue(dl.getSortOrder());
  }
コード例 #30
0
 public RegionEditorDialog(MapEditorGUI p, int i, Terrain r) {
   this(p);
   index = i;
   nameField.setText(r.getName());
   terrain.setSelectedItem(r.getBackground().getName());
   eRateSpinner.setValue(r.getStraightRate());
   formations = r.getFormations();
   fList.setListData(formations);
   fPane.setViewportView(fList);
 }