@Override
 public void itemStateChanged(ItemEvent e) {
   Object source = e.getItemSelectable();
   CPArtwork artwork = controller.getArtwork();
   if (source == cbSampleAllLayers) {
     artwork.setSampleAllLayers(e.getStateChange() == ItemEvent.SELECTED);
   } else if (source == cbLockAlpha) {
     artwork.setLockAlpha(e.getStateChange() == ItemEvent.SELECTED);
   }
 }
Exemple #2
0
    public void itemStateChanged(ItemEvent ie) {
      if (ie.getSource() == red) {
        if (ie.getStateChange() == ItemEvent.SELECTED) redValue = 255;
        else redValue = 0;
      } else if (ie.getSource() == green) {
        if (ie.getStateChange() == ItemEvent.SELECTED) greenValue = 255;
        else greenValue = 0;
      } else if (ie.getSource() == blue) {
        if (ie.getStateChange() == ItemEvent.SELECTED) blueValue = 255;
        else blueValue = 0;
      }

      label.setBackground(new Color(redValue, greenValue, blueValue));
    }
    public void itemStateChanged(ItemEvent e) {
      if (e.getStateChange() == ItemEvent.SELECTED) {
        int oldDay = selectedDay;
        int oldMonth = selectedMonth;
        int oldYear = selectedYear;

        String dayString = ((JToggleButton) e.getItem()).getText();
        try {
          selectedDay = Integer.parseInt(dayString);
        } catch (Exception ex) {
          selectedDay = 1;
        }
        selectedMonth = displayMonth;
        selectedYear = displayYear;

        if (oldDay != selectedDay || oldMonth != selectedMonth || oldYear != selectedYear) {

          isNullDate = false;
          selectedCalendar.set(Calendar.YEAR, selectedYear);
          selectedCalendar.set(Calendar.MONTH, selectedMonth);
          selectedCalendar.set(Calendar.DATE, selectedDay);

          updateCalendarComponents();
          fireDateChange();
        }
      }
    }
  public void itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.SELECTED) {
      p5.add(mortgage);
      Slot pobject;
      pobject = Game.SlotsList[x.getProperties().get(propertydisplay.getSelectedIndex())];
      if (pobject instanceof Property) {
        ((Property) (pobject)).monopolizeProperty();
        pr1.setText("Buy Price:" + pobject.getBuyPrice());
        pr2.setText("Rent Price:" + pobject.getRentPrice());
        pr3.setText("House Price:" + pobject.getHousePrice());
        pr4.setText("Hotel Price:" + pobject.getHotelPrice());
        pr5.setText("Mortgaged:" + pobject.getMortgage());
      } else if (pobject instanceof Railroad) {
        pobject.adjustRentPrice();
        pr1.setText("Buy Price:" + pobject.getBuyPrice());
        pr2.setText("Rent Price:" + pobject.getRentPrice());
        pr3.setText("");
        pr4.setText("");
        pr5.setText("");

      } else {
        pobject.adjustDiceFactor();
        pr1.setText("Buy Price:" + pobject.getBuyPrice());
        pr2.setText("Dice Factor:" + pobject.getDiceFactor());
        pr3.setText("");
        pr4.setText("");
        pr5.setText("");
      }
    }
  }
Exemple #5
0
  @Override
  public void itemStateChanged(ItemEvent e) {
    p.setFocus();

    if (e.getStateChange() == ItemEvent.SELECTED) {
      p.getR().hardMode(true);
    } else {
      p.getR().hardMode(false);
    }
  }
 public void itemStateChanged(ItemEvent e) {
   if (e.getStateChange() == ItemEvent.SELECTED) {
     scale = parseScale(cmbScale.getSelectedItem().toString());
     if (scale < 100) {
       scale = 100;
     } else if (scale > 100000) {
       scale = 100000;
     }
     cmbScale.setSelectedItem("1:" + scale);
     guiChanged();
   }
 }
  private void cmbLieferantItemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.SELECTED && cmbLieferant.getSelectedIndex() > 0) {

      lieferant = (Lieferanten) cmbLieferant.getSelectedItem();
      Tools.log(txtLog, "=================================================================");
      Tools.log(txtLog, "Ab jetzt wird auf Lieferant: \"" + lieferant.getFirma() + "\" umgebucht.");
      Tools.log(txtLog, "=================================================================");
      loadVorratTable();
      txtSearch.requestFocus();
    } else {
      lieferant = null;
    }
  }
 public void itemStateChanged(ItemEvent evt) {
   if (evt.getSource() instanceof JOAJRadioButton) {
     JOAJRadioButton rb = (JOAJRadioButton) evt.getSource();
     if (rb == b1 && evt.getStateChange() == ItemEvent.SELECTED) {
       mOffset = JOAConstants.PROFSEQUENCE;
       setXRangeToSequence();
     } else if (rb == b2 && evt.getStateChange() == ItemEvent.SELECTED) {
       mOffset = JOAConstants.PROFDISTANCE;
       setXRangeToDistance();
     } else if (rb == b3 && evt.getStateChange() == ItemEvent.SELECTED) {
       mOffset = JOAConstants.PROFTIME;
       setXRangeToTime();
     }
   } else if (evt.getSource() instanceof JOAJCheckBox) {
   } else if (evt.getSource() instanceof JOAJComboBox) {
     JOAJComboBox cb = (JOAJComboBox) evt.getSource();
     if (cb == presetColorSchemes) {
       int colorScheme = cb.getSelectedIndex();
       if (colorScheme == 0) {
         // default bg
         plotBg.setColor(JOAConstants.DEFAULT_CONTENTS_COLOR);
         axesColor.setColor(Color.black);
       } else if (colorScheme == 1) {
         // white bg
         plotBg.setColor(Color.white);
         axesColor.setColor(Color.black);
       } else {
         // color bg
         plotBg.setColor(Color.black);
         axesColor.setColor(Color.white);
       }
     } else if (cb == mSymbolPopup) {
       mCurrSymbol = cb.getSelectedIndex() + 1;
     }
   }
   generatePlotName();
 }
 @Override
 public void itemStateChanged(ItemEvent ev) {
   if (ev.getStateChange() == ItemEvent.SELECTED) {
     SwingUtilities.invokeLater(
         new Runnable() {
           @Override
           public void run() {
             String newPainterName =
                 ((myjava.gui.syntax.Painter) (painterComboBox.getSelectedItem())).getName();
             cardLayout.show(centerPanel, newPainterName);
             centerPanel.revalidate();
             centerPanel.repaint();
           }
         });
   }
 }
 public void itemStateChanged(ItemEvent event) {
   if (event.getStateChange() == ItemEvent.SELECTED) {
     int index = getSelectedIndex();
     int lower = _lower[index];
     int upper = _upper[index];
     MMultiplicity mult = null;
     if (lower >= 0) {
       mult = new MMultiplicity(lower, upper);
     }
     try {
       _setMethod.invoke(_container.getTarget(), new Object[] {mult});
     } catch (Exception e) {
       System.out.println(e.toString() + " in UMLMultiplicityComboBox.itemStateChanged()");
     }
   }
 }
  private void cmbLagerItemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.SELECTED) {

      vorratsListeInsLogbuch();

      ziel = (Lager) cmbLager.getSelectedItem();
      Tools.log(txtLog, "=================================================================");
      Tools.log(txtLog, "Ab jetzt wird ins Lager: \"" + ziel.getBezeichnung() + "\" umgebucht.");
      Tools.log(txtLog, "=================================================================");
      Main.getProps()
          .put(
              "touch" + MODULENUMBER + "lager",
              new Integer(cmbLager.getSelectedIndex()).toString());
      loadVorratTable();
      txtSearch.requestFocus();
    }
  }
Exemple #12
0
  /** Handle ItemEvents. */
  public void itemStateChanged(ItemEvent e) {

    final String dialog_title = ResourceHandler.getMessage("template_dialog.title");

    Component target = (Component) e.getSource();

    if (target == recursiveCheckBox) {
      converter.setRecurse(recursiveCheckBox.isSelected());
    } else if (target == staticVersioningRadioButton || target == dynamicVersioningRadioButton) {
      converter.setStaticVersioning(staticVersioningRadioButton.isSelected());
    } else if (target == templateCh
        && (e.getStateChange() == e.SELECTED)) { // Process only when item is Selected

      // Get the current template selection
      String choiceStr = (String) templateCh.getSelectedItem();

      // If the user chooses 'other', display a file dialog to allow
      // them to select a template file.
      if (choiceStr.equals(TemplateFileChoice.OTHER_STR)) {
        String templatePath = null;
        FileDialog fd = new FileDialog(this, dialog_title, FileDialog.LOAD);
        fd.show();

        // Capture the path entered, if any.
        if (fd.getDirectory() != null && fd.getFile() != null) {
          templatePath = fd.getDirectory() + fd.getFile();
        }

        // If the template file is valid add it and select it.
        if (templatePath != null && setTemplateFile(templatePath)) {
          if (!templateCh.testIfInList(templatePath)) {
            templateCh.addItem(templatePath);
          }
          templateCh.select(templatePath);
        } else {
          templateCh.select(templateCh.getPreviousSelection());
        }
        fd.dispose();
      } else {
        templateCh.select(choiceStr);
      }
    }
  }
    public void itemStateChanged(ItemEvent e) {
      if (e.getStateChange() != ItemEvent.SELECTED) return;

      final Project selectedProject = (Project) e.getItem();
      if (selectedProject.isValid()) issueLoader.setProject(selectedProject);
    }
 public void itemStateChanged(ItemEvent evt) {
   // only on 'selection' event
   if (evt.getStateChange() == ItemEvent.SELECTED) {
     clOptions.show(pOptions, types[cbType.getSelectedIndex()]);
   }
 }
 public void itemStateChanged(ItemEvent i) {
   if (i.getStateChange() == ItemEvent.SELECTED) co = (String) i.getItem();
   z = 1;
 }
Exemple #16
0
 public void itemStateChanged(ItemEvent ev) {
   boolean selected = (ev.getStateChange() == ItemEvent.SELECTED);
   AbstractButton button = (AbstractButton) ev.getItemSelectable();
   String command = button.getActionCommand();
 }