private void setSpinnerModelsNotNull() {
    startHourSpinner.setModel(new SpinnerNumberModel(model.getStartHour(), 00, 23, 1));
    startMinuteSpinner.setModel(new SpinnerNumberModel(model.getStartMinute(), 00, 59, 1));

    endHourSpinner.setModel(new SpinnerNumberModel(model.getFinishedHour(), 00, 23, 1));
    endMinuteSpinner.setModel(new SpinnerNumberModel(model.getFinishedMinute(), 00, 59, 1));
  }
 private void addListener(final JComponent component) {
   if (component instanceof JComboBox) {
     ItemListener itemListener =
         new ItemListener() {
           public void itemStateChanged(ItemEvent e) {
             JComboBox comboBox = (JComboBox) component;
             final Object selectedItem = comboBox.getSelectedItem();
             _dotDefinitionDialogFrame
                 .getScratchDisplayObjectType()
                 .setValueOfStaticProperty(_primitiveForm.getName(), _property, selectedItem);
           }
         };
     JComboBox comboBox = (JComboBox) component;
     comboBox.addItemListener(itemListener);
   } else if (component instanceof JSpinner) {
     javax.swing.event.ChangeListener changeListener =
         new javax.swing.event.ChangeListener() {
           public void stateChanged(ChangeEvent e) {
             JSpinner spinner = (JSpinner) component;
             final Object value = spinner.getValue();
             _dotDefinitionDialogFrame
                 .getScratchDisplayObjectType()
                 .setValueOfStaticProperty(_primitiveForm.getName(), _property, value);
           }
         };
     JSpinner spinner = (JSpinner) component;
     spinner.addChangeListener(changeListener);
   }
 }
예제 #3
1
    public ParameterEditDialog(Field field) {
      targetField = field;
      setBounds(20, 10, 100, 100);
      // Fieldの型を取得する
      Class<?> type = targetField.getType();
      if (type.isPrimitive()) {
        JSpinner valueSpnipper = new JSpinner();
        valueSpnipper.setPreferredSize(new Dimension(80, 20));
        GridBagLayoutUtil.setGbcLayout(
            0, 0, new GridBagConstraints(), valueSpnipper, new GridBagLayout(), this);
      }
      addKeyListener(
          new KeyListener() {
            @Override
            public void keyTyped(KeyEvent e) {}

            @Override
            public void keyReleased(KeyEvent e) {}

            @Override
            public void keyPressed(KeyEvent e) {
              if (e.equals(KeyEvent.VK_ENTER)) {}
            }
          });
    }
예제 #4
1
  public void stateChanged(ChangeEvent e) {
    JSpinner source = (JSpinner) e.getSource();
    Calendar c = this.getDateCalendar();
    if (source.getName().equals("Hour")) {
      c.set(Calendar.HOUR_OF_DAY, getSelectedHour());
      this.date = c.getTime();
      return;
    } else if (source.getName().equals("Minute")) {
      c.set(Calendar.MINUTE, getSelectedMinute());
      this.date = c.getTime();
      return;
    } else if (source.getName().equals("Second")) {
      c.set(Calendar.SECOND, getSelectedSecond());
      this.date = c.getTime();
      return;
    }
    dayColorUpdate(true);

    if (source.getName().equals("Year")) {
      c.set(Calendar.YEAR, getSelectedYear());
    } else {
      c.set(Calendar.MONTH, getSelectedMonth() - 1);
    }
    this.date = c.getTime();
    flushWeekAndDay();
  }
  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();
  }
예제 #6
0
 private void enableNumericIterativeOptions(boolean b) {
   startLabel.setEnabled(b);
   autoIDStart.setEnabled(b);
   endLabel.setEnabled(b);
   autoIDEnd.setEnabled(b);
   saveIterativeIds.setEnabled(b);
 }
 public String getValue() {
   return (enable.isSelected() ? "1" : "0")
       + ","
       + (radioCut.isSelected() ? OPTION_CUT : OPTION_LEAVE)
       + ","
       + (radioCut.isSelected() ? cutNumber.getValue() : leaveNumber.getValue());
 }
예제 #8
0
  public ConfigEntries(String text, int configMax) {
    FlowLayout layout = new FlowLayout();
    this.setLayout(layout);

    if (text.length() > 0) {
      label = new JLabel(text);
      SpinnerNumberModel numberModel = new SpinnerNumberModel(1, 1, configMax, 1);
      configValue = new JSpinner(numberModel);

      configValue
          .getComponent(0)
          .addMouseListener(
              new MouseAdapter() {
                public void mouseClicked(MouseEvent me) {
                  Object value = configValue.getNextValue();
                  if (value != null) configValue.setValue(value);
                }
              });

      configValue
          .getComponent(1)
          .addMouseListener(
              new MouseAdapter() {
                public void mouseClicked(MouseEvent me) {
                  Object value = configValue.getPreviousValue();
                  if (value != null) configValue.setValue(value);
                }
              });

      this.add(label);
      this.add(configValue);
    }
  }
예제 #9
0
 private void setLandscapeCommon(final List<Pair<String, Float>> landscape) {
   this.landscape = landscape;
   if (!stkLineChartZoom.empty()) {
     pnlLineChart.setViewport(stkLineChartZoom.get(0));
     stkLineChartZoom.clear();
   }
   if (landscape == null) {
     landscapeMin = landscapeMax = null;
   } else {
     float min = Float.POSITIVE_INFINITY;
     float max = Float.NEGATIVE_INFINITY;
     for (final Pair<String, Float> p : landscape) {
       final float fitness = p.getSecond();
       if (Float.isInfinite(fitness)) {
         continue;
       }
       if (fitness < min) {
         min = fitness;
       }
       if (fitness > max) {
         max = fitness;
       }
     }
     landscapeMin = new Float(min - max * 0.05);
     landscapeMax = new Float(max * 1.05);
   }
   if (!stkHistogramZoom.empty()) {
     pnlHistogram.setViewport(stkHistogramZoom.get(0));
     stkHistogramZoom.clear();
   }
   if (useMinMax && (landscapeMin != null) && (landscapeMax != null)) {
     pnlHistogram.setBins(
         binLandscape(((Number) spnBins.getValue()).intValue()),
         landscapeMin.floatValue(),
         landscapeMax.floatValue());
   } else {
     pnlHistogram.setBins(binLandscape(((Number) spnBins.getValue()).intValue()));
   }
   // cboDisplayType.setSelectedIndex(0);
   if (landscape == null) {
     txaRaw.setText("");
   } else {
     final StringBuffer b = new StringBuffer();
     if (rawTextComparator != null) {
       Collections.sort(landscape, rawTextComparator);
     }
     b.append(getXAxisLabel());
     b.append('\t');
     b.append(getYAxisLabel());
     b.append('\n');
     for (final Pair<String, Float> p : landscape) {
       b.append(p.getFirst());
       b.append('\t');
       b.append(Float.toString(p.getSecond()));
       b.append('\n');
     }
     txaRaw.setText(b.toString());
     txaRaw.select(0, 0);
   }
 }
예제 #10
0
 public SpinSlider() {
   this.setLayout(new FlowLayout());
   final JSpinner spinner = new JSpinner();
   final JSlider slider = new JSlider();
   slider.addChangeListener(
       new ChangeListener() {
         @Override
         public void stateChanged(ChangeEvent e) {
           JSlider s = (JSlider) e.getSource();
           spinner.setValue(s.getValue());
         }
       });
   this.add(slider);
   spinner.setModel(new SpinnerNumberModel(50, 0, 100, 1));
   spinner.setEditor(new JSpinner.NumberEditor(spinner, "0'%'"));
   spinner.addChangeListener(
       new ChangeListener() {
         @Override
         public void stateChanged(ChangeEvent e) {
           JSpinner s = (JSpinner) e.getSource();
           slider.setValue((Integer) s.getValue());
         }
       });
   this.add(spinner);
 }
 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();
 }
예제 #12
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();
 }
예제 #13
0
  private MainPanel() {
    super(new BorderLayout());
    StringBuffer buf = new StringBuffer();
    for (int i = 0; i < 100; i++) {
      String s = i + LF;
      buf.append(s);
    }

    final JScrollPane scrollPane = new JScrollPane(new JTextArea(buf.toString()));
    scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    JSpinner spinner =
        new JSpinner(
            new SpinnerNumberModel(
                scrollPane.getVerticalScrollBar().getUnitIncrement(1), 1, 100000, 1));
    spinner.setEditor(new JSpinner.NumberEditor(spinner, "#####0"));
    spinner.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent e) {
            JSpinner s = (JSpinner) e.getSource();
            scrollPane.getVerticalScrollBar().setUnitIncrement((Integer) s.getValue());
          }
        });
    Box box = Box.createHorizontalBox();
    box.add(new JLabel("Unit Increment:"));
    box.add(Box.createHorizontalStrut(2));
    box.add(spinner);
    box.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    add(box, BorderLayout.NORTH);
    add(scrollPane);
    setPreferredSize(new Dimension(320, 240));
  }
예제 #14
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;
  }
예제 #15
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();
     }
   }
 }
예제 #16
0
 /** 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);
   }
 }
  public void apply() {
    if (!isModified()) return;

    final ScalaProjectSettings scalaProjectSettings = ScalaProjectSettings.getInstance(myProject);
    scalaProjectSettings.setImplicitParametersSearchDepth(
        (Integer) implicitParametersSearchDepthSpinner.getValue());
    scalaProjectSettings.setOutputLimit((Integer) outputSpinner.getValue());
    scalaProjectSettings.setInProcessMode(runWorksheetInTheCheckBox.isSelected());
    scalaProjectSettings.setInteractiveMode(worksheetInteractiveModeCheckBox.isSelected());

    scalaProjectSettings.setSearchAllSymbols(searchAllSymbolsIncludeCheckBox.isSelected());
    scalaProjectSettings.setEnableJavaToScalaConversion(
        enableConversionOnCopyCheckBox.isSelected());
    scalaProjectSettings.setDontShowConversionDialog(donTShowDialogCheckBox.isSelected());
    scalaProjectSettings.setTreatDocCommentAsBlockComment(
        treatDocCommentAsBlockComment.isSelected());

    scalaProjectSettings.setShowImplisitConversions(showImplicitConversionsInCheckBox.isSelected());
    scalaProjectSettings.setShowArgumentsToByNameParams(
        showArgumentsToByNameParametersCheckBox.isSelected());
    scalaProjectSettings.setIncludeBlockExpressions(
        includeBlockExpressionsExpressionsCheckBox.isSelected());
    scalaProjectSettings.setIncludeLiterals(includeLiteralsCheckBox.isSelected());

    scalaProjectSettings.setIgnorePerformance(myResolveToAllClassesCheckBox.isSelected());
    scalaProjectSettings.setDisableLangInjection(myDisableLanguageInjection.isSelected());
    scalaProjectSettings.setDisableI18N(myDisablei18n.isSelected());
    scalaProjectSettings.setDontCacheCompoundTypes(myDontCacheCompound.isSelected());
    scalaProjectSettings.setScalaPriority(useScalaClassesPriorityCheckBox.isSelected());
    scalaProjectSettings.setCollectionTypeHighlightingLevel(
        collectionHighlightingChooser.getSelectedIndex());
    injectionPrefixTable.saveSettings(scalaProjectSettings);
  }
예제 #18
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);
   }
 }
  public void updateAttribsFromComponents() {
    if (widthCB.isSelected()) {
      String w = widthField.getModel().getValue().toString();
      if (widthCombo.getSelectedIndex() == 0) w += "%"; // $NON-NLS-1$
      attribs.put("width", w); // $NON-NLS-1$
    } else attribs.remove("width"); // $NON-NLS-1$

    if (alignCB.isSelected())
      attribs.put("align", alignCombo.getSelectedItem().toString()); // $NON-NLS-1$
    else attribs.remove("align"); // $NON-NLS-1$

    if (borderCB.isSelected())
      attribs.put(
          "border", //$NON-NLS-1$
          borderField.getModel().getValue().toString());
    else attribs.remove("border"); // $NON-NLS-1$

    if (cellSpacingCB.isSelected())
      attribs.put(
          "cellspacing", //$NON-NLS-1$
          cellSpacingField.getModel().getValue().toString());
    else attribs.remove("cellspacing"); // $NON-NLS-1$

    if (cellPaddingCB.isSelected())
      attribs.put(
          "cellpadding", //$NON-NLS-1$
          cellPaddingField.getModel().getValue().toString());
    else attribs.remove("cellpadding"); // $NON-NLS-1$

    if (bgPanel.isSelected()) attribs.put("bgcolor", bgPanel.getColor()); // $NON-NLS-1$
    else attribs.remove("bgcolor"); // $NON-NLS-1$
  }
예제 #20
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;
  }
  @Override
  public void setSelection(List<Operator> selection) {
    Operator operator = selection.isEmpty() ? null : selection.get(0);
    if (operator == this.operator) {
      return;
    }
    if (this.operator != null) {
      this.operator.getParameters().removeObserver(parameterObserver);
    }
    this.operator = operator;
    if (operator != null) {
      this.operator.getParameters().addObserver(parameterObserver, true);
      breakpointButton.setEnabled(true);

      // compatibility level
      OperatorVersion[] versionChanges = operator.getIncompatibleVersionChanges();
      if (versionChanges.length == 0) {
        // no incompatible versions exist
        compatibilityLevelSpinner.setVisible(false);
        compatibilityLabel.setVisible(false);
      } else {
        compatibilityLevelSpinner.setVisible(true);
        compatibilityLabel.setVisible(true);
        ((CompatibilityLevelSpinnerModel) compatibilityLevelSpinner.getModel())
            .setOperator(operator);
      }

    } else {
      breakpointButton.setEnabled(false);
    }
    setNameFor(operator);
    setupComponents();
  }
예제 #22
0
  protected void actualizarMuestraActual() {
    int r = (int) spinRed.getValue();
    int g = (int) spinGreen.getValue();
    int b = (int) spinBlue.getValue();

    lblMuestra.setIcon(new ImageIcon(new ImgMuestra(new Color(r, g, b), 100, 100)));
  }
  public ObstetCalculatorWindow() {
    Calendar dtNow = Calendar.getInstance();
    // Date dtNow = new Date();

    dtDay = dtNow.get(Calendar.DAY_OF_MONTH);
    dtMonth = dtNow.get(Calendar.MONTH);
    dtYear = dtNow.get(Calendar.YEAR);

    initComponents();

    spinDays.setModel(new SpinnerNumberModel(dtDay, 1, maxDay(), 1));
    spinMonth.setModel(new SpinnerNumberModel(dtMonth + 1, 1, 12, 1));
    spinYear.setModel(new SpinnerNumberModel(dtYear, dtYear - 1, dtYear + 1, 1));
    spinYear.setEditor(new javax.swing.JSpinner.NumberEditor(spinYear, "####"));

    SetListeners();

    txtWeek.addKeyListener(keyListW);
    txtDays.addKeyListener(keyListD);

    // setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    // setMaximizedBounds(new java.awt.Rectangle(0, 0, 0, 0));
    setResizable(false);
    this.setTitle("Obstet Tools");
  }
예제 #24
0
    public void stateChanged(ChangeEvent e) {
      JSpinner source = (JSpinner) e.getSource();
      if (source.getName().equals("Hour")) {
        calendar.set(Calendar.HOUR_OF_DAY, getSelectedHour());
        return;
      }
      if (source.getName().equals("Year")) {

        calendar.set(Calendar.YEAR, getSelectedYear());
        dayPanel.removeAll();
        this.flushWeekAndDayPanal(calendar);
        dayPanel.revalidate();
        dayPanel.updateUI();
        return;
      }
      if (source.getName().equals("Month")) {
        calendar.set(Calendar.MONTH, getSelectedMonth() - 1);

        dayPanel.removeAll();
        this.flushWeekAndDayPanal(calendar);
        dayPanel.revalidate();
        dayPanel.updateUI();
        return;
      }
    }
  public JComponent renderSpecial(final Shield shield) {
    final JSpinner atSpinner =
        new JSpinner(new SpinnerNumberModel(shield.getAttackeMod(), -10, 10, 1));
    atSpinner.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            shield.setAttackeMod(((Number) atSpinner.getValue()).intValue());
          }
        });

    final JSpinner paSpinner =
        new JSpinner(new SpinnerNumberModel(shield.getParadeMod(), -10, 10, 1));
    paSpinner.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            shield.setParadeMod(((Number) paSpinner.getValue()).intValue());
          }
        });

    final JPanel panel = new JPanel();

    panel.add(atSpinner);
    panel.add(new JLabel("/"));
    panel.add(paSpinner);

    return panel;
  }
예제 #26
0
  void selectExhibit() {
    ExhibitInfo e = getCurrentExhibit();

    contentListModel.notifyChange();
    exhibitPhotosModel.notifyChange();
    contentList.setSelectionInterval(0, 0);
    for (ListSelectionListener l : contentList.getListSelectionListeners()) {
      l.valueChanged(new ListSelectionEvent(contentList, 0, 0, false));
    }
    exhibitXCoordField.getModel().setValue(e.getX());
    exhibitXCoordOrig.setText("X coordinate: (was " + e.origXCoord + ")");
    exhibitYCoordField.getModel().setValue(e.getY());
    exhibitYCoordOrig.setText("Y coordinate: (was " + e.origYCoord + ")");

    exhibitNextDropdown.setSelectedItem(e.getNext());
    if (e.getNext() != null) {
      exhibitNextOrig.setText("Next: (was " + e.origNext + ")");
    } else {
      exhibitPreviousOrig.setText("Next:");
    }
    exhibitPreviousDropdown.setSelectedItem(e.getPrevious());
    if (e.getPrevious() != null) {
      exhibitPreviousOrig.setText("Previous: (was " + e.origPrevious + ")");
    } else {
      exhibitPreviousOrig.setText("Previous:");
    }

    exhibitPhotosList.setSelectionInterval(0, 0);
    exhibitAliasesList.setSelectionInterval(0, 0);

    exhibitAliasesModel.notifyChange();

    selectPhoto();
    selectAlias();
  }
예제 #27
0
  private void setEnableStatusOfUseProxy(boolean enableStatus) {
    httpLabel.setEnabled(enableStatus);
    httpsLabel.setEnabled(enableStatus);
    ftpLabel.setEnabled(enableStatus);

    proxyAddressLabel.setEnabled(enableStatus);
    proxyPortLabel.setEnabled(enableStatus);
    proxyUserNameLabel.setEnabled(enableStatus);
    proxyPasswordLabel.setEnabled(enableStatus);
    httpProxyAddressTextField.setEnabled(enableStatus);
    httpProxyPortSpinner.setEnabled(enableStatus);
    httpProxyUserNameTextField.setEnabled(enableStatus);
    httpProxyPasswordField.setEnabled(enableStatus);

    httpsProxyAddressTextField.setEnabled(enableStatus);
    httpsProxyPortSpinner.setEnabled(enableStatus);
    httpsProxyUserNameTextField.setEnabled(enableStatus);
    httpsProxyPasswordField.setEnabled(enableStatus);

    ftpProxyAddressTextField.setEnabled(enableStatus);
    ftpProxyPortSpinner.setEnabled(enableStatus);
    ftpProxyUserNameTextField.setEnabled(enableStatus);
    ftpProxyPasswordField.setEnabled(enableStatus);

    socksLabel.setEnabled(!enableStatus);

    socksProxyAddressLabel.setEnabled(!enableStatus);
    socksProxyPortLabel.setEnabled(!enableStatus);
    socksProxyUserNameLabel.setEnabled(!enableStatus);
    socksProxyPasswordLabel.setEnabled(!enableStatus);
    socksProxyAddressTextField.setEnabled(!enableStatus);
    socksProxyPortSpinner.setEnabled(!enableStatus);
    socksProxyUserNameTextField.setEnabled(!enableStatus);
    socksProxyPasswordField.setEnabled(!enableStatus);
  }
예제 #28
0
  public ComponentHolder(ManagerInterface manager, Dimension mapDimension) {
    peer = manager;
    mapPanel = new JMapPanel(new GridLayout(1, 1, 2, 2), mapDimension, peer.getLoader());
    modifiedFilesListModel = new ModifiedListModel();
    originalFilesListModel = new OriginalFilesListModel();
    contentListModel = new ContentListModel();
    exhibitPhotosModel = new ExhibitPhotosModel();
    exhibitNameModel = new ExhibitListModel();
    groupListModel = new GroupListModel();
    groupExhibitsModel = new GroupExhibitsModel();
    exhibitAliasesModel = new ExhibitAliasesModel();
    eventsListModel = new EventsListModel();

    Calendar calendar = Calendar.getInstance();
    Date initDate = calendar.getTime();
    calendar.add(Calendar.YEAR, -100);
    Date earliestDate = calendar.getTime();
    calendar.add(Calendar.YEAR, 200);
    Date latestDate = calendar.getTime();
    SpinnerModel dateModel1 =
        new SpinnerDateModel(initDate, earliestDate, latestDate, Calendar.DATE);
    SpinnerModel dateModel2 =
        new SpinnerDateModel(initDate, earliestDate, latestDate, Calendar.DATE);
    eventStart = new JSpinner(dateModel1);
    eventEnd = new JSpinner(dateModel2);
    eventStart.setEditor(new JSpinner.DateEditor(eventStart, "MM/dd/yyyy"));
    eventEnd.setEditor(new JSpinner.DateEditor(eventEnd, "MM/dd/yyyy"));
  }
 @Override
 public void reset() {
   VcsContentAnnotationSettings settings = VcsContentAnnotationSettings.getInstance(myProject);
   myHighlightRecentlyChanged.setSelected(settings.isShow());
   myHighlightInterval.setValue(settings.getLimitDays());
   myHighlightInterval.setEnabled(myHighlightRecentlyChanged.isSelected());
 }
  private void setSpinnerModelsNull() {
    startHourSpinner.setModel(new SpinnerNumberModel(0, 0, 23, 1));
    startMinuteSpinner.setModel(new SpinnerNumberModel(0, 0, 59, 1));

    endHourSpinner.setModel(new SpinnerNumberModel(0, 0, 23, 1));
    endMinuteSpinner.setModel(new SpinnerNumberModel(0, 0, 59, 1));
  }