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 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()");
     }
   }
 }
Example #3
0
 @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 e) {
   Object obj = e.getSource();
   if (obj == choice) {
     graph.newStat = true;
     if (choice.getSelectedItem().equals("Show Sequences")) {
       if (graph.originX * graph.originX + graph.originY * graph.originY < 9) {
         graph.originX = 40.0;
         graph.originY = 2 * Math.PI;
         graph.setZoom(15);
       }
     } else {
       if (graph.originX * graph.originX + graph.originY * graph.originY > 9) {
         graph.originX = 0.0;
         graph.originY = 0.0;
         graph.setZoom(11);
       }
     }
     graph.repaint();
   }
 }
 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();
 }
 // Implementation of stateChanged
 public void itemStateChanged(ItemEvent e) {
   if (e.getSource() == allfieldcheckbox) {
     update();
   }
 }
Example #7
0
 @Override
 public void itemStateChanged(ItemEvent event) {
   if (event.getStateChange() == ItemEvent.SELECTED)
     gui.getTestText().setForeground(FontManager.COLORS[gui.getBox().getSelectedIndex()]);
 }
Example #8
0
 @Override
 public void itemStateChanged(ItemEvent e) {
   if (e.getSource() instanceof JRadioButton) checkUeberSchreib();
 }
 public void itemStateChanged(ItemEvent i) {
   if (i.getStateChange() == ItemEvent.SELECTED) co = (String) i.getItem();
   z = 1;
 }
Example #10
0
 public void itemStateChanged(ItemEvent e) {
   texta.setText(
       lblName.getText() + text0.getText() + '\n' + lblAcad.getText() + e.getItem());
 }