예제 #1
0
 public void itemStateChanged(ItemEvent ev) {
   if (ev.getStateChange() == ItemEvent.SELECTED && ev.getSource() == cbSuspend) {
     int idx = cbSuspend.getSelectedIndex();
     tfThreadID.setEnabled(idx == CndBreakpoint.SUSPEND_THREAD);
     lThreadID.setEnabled(idx == CndBreakpoint.SUSPEND_THREAD);
   }
 }
예제 #2
0
  public void itemStateChanged(ItemEvent evt) {
    if (evt.getSource() == farbe) {
      status.setText("Farbe " + farben[farbe.getSelectedIndex()] + " ausgewaehlt");

      switch (farbe.getSelectedIndex()) {
        case 0:
          color = Color.blue;
          break;
        case 1:
          color = Color.yellow;
          break;
        case 2:
          color = Color.green;
          break;
        case 3:
          color = Color.red;
          break;
        case 4:
          color = Color.black;
          break;
        case 5:
          color = Color.white;
      }
    } else if (evt.getSource() == filled) {
      if (filled.getState() == true) status.setText("Ausgefuellt zeichnen");
      else status.setText("Rahmen zeichnen");
    }
  }
  public void itemStateChanged(ItemEvent e) {
    Object source = e.getItemSelectable();

    if (source == showPaths) doShowPaths = (e.getStateChange() == ItemEvent.SELECTED);

    execute();
  }
예제 #4
0
  public void itemStateChanged(ItemEvent E) {
    // The 'log chat' checkbox
    if (E.getSource() == logChat) {
      server.logChats = logChat.getState();

      // Loop through all of the chat rooms, and set the logging
      // state to be the same as the value of the checkbox
      for (int count = 0; count < server.chatRooms.size(); count++) {
        babylonChatRoom tmp = (babylonChatRoom) server.chatRooms.elementAt(count);
        try {
          tmp.setLogging(server.logChats);
        } catch (IOException e) {
          server.serverOutput(
              server.strings.get(thisClass, "togglelogerror") + " " + tmp.name + "\n");
        }
      }
    }

    // The user list
    if (E.getSource() == userList) {
      // If anything is selected, enable the 'disconnect user'
      // button, otherwise disable it
      synchronized (userList) {
        disconnect.setEnabled(userList.getSelectedItem() != null);
      }
    }
  }
예제 #5
0
 private void cbReportItemStateChanged(
     java.awt.event.ItemEvent evt) { // GEN-FIRST:event_cbReportItemStateChanged
   if (evt.getStateChange() == ItemEvent.SELECTED) {
     if (evt.getItem().toString().equals(I18N.getMsg("msg.export.book.text")))
       setOptions(cbFormat.getSelectedItem().toString());
   }
 } // GEN-LAST:event_cbReportItemStateChanged
예제 #6
0
 public void itemStateChanged(ItemEvent event) {
   if (event.getSource() == compact) {
     updateDetailView();
   } else if (event.getSource() == showAll) {
     updateAllLists();
   }
 }
예제 #7
0
    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) {
    Object source = e.getSource();
    if (e.getStateChange() != ItemEvent.SELECTED) return;

    if (source == ncbGridTickX) {
      double val = ncbGridTickX.getValue();
      if (val > 0) {
        double[] ticks = view.getGridDistances();
        ticks[0] = val;
        view.setGridDistances(ticks);
      }
    } else if (source == ncbGridTickY) {
      double val = ncbGridTickY.getValue();
      if (val > 0) {
        double[] ticks = view.getGridDistances();
        ticks[1] = val;
        view.setGridDistances(ticks);
      }
    } else if (source == cbGridTickAngle) {
      double val = cbGridTickAngle.getSelectedIndex();
      if (val >= 0) {
        double[] ticks = view.getGridDistances();
        // val = 4 gives  5*PI/12, skip this and go to 6*Pi/2 = Pi/2
        if (val == 4) val = 5;
        ticks[2] = (val + 1) * Math.PI / 12;
        view.setGridDistances(ticks);
      }
    }

    view.updateBackground();
    updateGUI();
  }
예제 #9
0
    public void itemStateChanged(ItemEvent arg0) {
      if (arg0.getStateChange() == ItemEvent.DESELECTED) {
        return;
      }
      String sSourceID = ((FComboBoxItem) arg0.getItem()).getValue().toString();
      lstdsDictionary = DefineReportI.getMethod().getFieldWithEname(sSourceID);

      Map dsDictionaryMap = null;
      String sDataSourceRef = "";
      if (lstdsDictionary != null) {
        int iCount = lstdsDictionary.size();
        for (int i = 0; i < iCount; i++) {
          dsDictionaryMap = (Map) lstdsDictionary.get(i);
          if (!"".equals(sDataSourceRef)) {
            sDataSourceRef = sDataSourceRef + "+";
          }
          sDataSourceRef =
              sDataSourceRef
                  + dsDictionaryMap.get(IDefineReport.FIELD_ENAME)
                  + ":"
                  + dsDictionaryMap.get(IDefineReport.FIELD_TYPE)
                  + "#"
                  + dsDictionaryMap.get(IDefineReport.FIELD_FNAME);
        }
      }
      cbxFieldName.setRefModel(sDataSourceRef);
      cbxFieldName.setSelectedIndex(-1);
    }
예제 #10
0
파일: FramesPanel.java 프로젝트: jexp/idea2
 public void itemStateChanged(ItemEvent e) {
   if (!myIsEnabled) return;
   if (e.getStateChange() == ItemEvent.SELECTED) {
     ThreadDescriptorImpl item = (ThreadDescriptorImpl) e.getItem();
     DebuggerContextUtil.setThread(getContextManager(), item);
   }
 }
예제 #11
0
    @Override
    public void itemStateChanged(ItemEvent e) {

      if (e.getSource() == coins) {

        if (e.getStateChange() == ItemEvent.SELECTED) {

          saveMask.setEnabled(true);

          Squeal.convertToCoins(true);

        } else {

          saveMask.setEnabled(false);

          Squeal.convertToCoins(false);
        }
      }

      if (e.getSource() == saveMask) {

        if (e.getStateChange() == ItemEvent.SELECTED) {

          Squeal.saveFishMasks(true);

        } else {

          Squeal.saveFishMasks(false);
        }
      }
    }
예제 #12
0
        public void itemStateChanged(ItemEvent e) {
          if (e.getStateChange() == ItemEvent.SELECTED) {

            AdjuPopupPane popup =
                (AdjuPopupPane) relComponents[LABELS.adjudicationDisagreement.ordinal()];
            if (isParent) {
              String itemValue = (String) ((JComboBox) e.getSource()).getSelectedItem();
              if (itemValue.equals("Selected Annotator") || itemValue.equals("Select and Edit")) {
                String diff = relation.getAdjuDiff();
                popup.setAnnValue(diff);
                popup.setClickable(true);
                // relComponents[LABELS.adjudicationDisagreement.ordinal()}.
              } else {
                popup.annReset();
                popup.setClickable(false);
              }
            } else {
              popup.annReset();
              popup.setClickable(false);
            }

            mainFrame.inputAction((JComponent) e.getSource(), spanButtons);
            enableRelationType();
          }
        }
예제 #13
0
 /** Handles CheckboxMenuItem state changes. */
 public void itemStateChanged(ItemEvent e) {
   MenuItem item = (MenuItem) e.getSource();
   MenuComponent parent = (MenuComponent) item.getParent();
   String cmd = e.getItem().toString();
   if ((Menu) parent == Menus.window) WindowManager.activateWindow(cmd, item);
   else doCommand(cmd);
 }
 public void itemStateChanged(ItemEvent e) {
   Object source = e.getItemSelectable();
   if (source == branchOverloadMonitorCheckbox) {
     if (e.getStateChange() == ItemEvent.SELECTED) overloadMonitorParams.setStatus(true);
     else overloadMonitorParams.setStatus(false);
   }
 }
예제 #15
0
 private void fullHeaderCheckBoxItemStateChanged(
     java.awt.event.ItemEvent evt) { // GEN-FIRST:event_fullHeaderCheckBoxItemStateChanged
   if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
     this.fullheader = true;
   } else if (evt.getStateChange() == java.awt.event.ItemEvent.DESELECTED) {
     this.fullheader = false;
   }
 } // GEN-LAST:event_fullHeaderCheckBoxItemStateChanged
예제 #16
0
 public void itemStateChanged(ItemEvent e) {
   if (e.getStateChange() == ItemEvent.SELECTED) {
     JRadioButton jrb = (JRadioButton) e.getSource();
     choice = jrb.getActionCommand();
     answer[i - 1] = choice;
     System.out.println(answer[i - 1]);
   }
 }
예제 #17
0
 public void itemStateChanged(ItemEvent itemEvent) {
   AbstractButton abstractButton = (AbstractButton) itemEvent.getSource();
   int state = itemEvent.getStateChange();
   if (state == ItemEvent.SELECTED) {
     // cb.setSelected(!cb.isSelected());
     System.out.println(course + " checkbox change");
   }
 }
예제 #18
0
 /**
  * The itemStateChanged method of the ItemListener interface.
  *
  * @param event The event which triggered this ItemListener.
  */
 public void itemStateChanged(ItemEvent event) {
   Object source = event.getItem();
   try {
     firePickedVertexChangeEvent((V) source, event.getStateChange() == ItemEvent.SELECTED);
   } catch (ClassCastException e) {
     firePickedEdgeChangeEvent((E) source, event.getStateChange() == ItemEvent.SELECTED);
   }
 }
예제 #19
0
 public void itemStateChanged(ItemEvent e) {
   Object source = e.getItemSelectable();
   if (e.getStateChange() == ItemEvent.DESELECTED) {
     myAgent.leaveCommunity(((JCheckBox) source).getText());
   } else {
     myAgent.joinCommunity(((JCheckBox) source).getText());
   }
 }
예제 #20
0
 public void itemStateChanged(ItemEvent e) {
   if (e.getStateChange() == ItemEvent.DESELECTED) {
     playerCharacter.setTempBonusFilter(bonus);
   }
   if (e.getStateChange() == ItemEvent.SELECTED) {
     playerCharacter.unsetTempBonusFilter(bonus);
   }
   theParent.refresh();
 }
 public void itemStateChanged(ItemEvent e) {
   if (e.getSource() == chckbxDimensioniPersonalizzate) {
     enableCustomDimension(chckbxDimensioniPersonalizzate.isSelected());
   } else if (e.getSource() == landscape) {
     portrait.setSelected(!landscape.isSelected());
   } else if (e.getSource() == portrait) {
     landscape.setSelected(!portrait.isSelected());
   }
 }
예제 #22
0
  @Override
  public void itemStateChanged(ItemEvent event) {

    int state = event.getStateChange();
    String item = (String) event.getItem();
    if (ab.isVertex()) {
      ((BiologicalNodeAbstract) ab).setCompartment(item);
    }
  }
예제 #23
0
 /** For the user selected answer event. */
 public void itemStateChanged(ItemEvent evt) { // ***Event
   if (evt.getStateChange() == ItemEvent.SELECTED) {
     if (evt.getSource() == cBox_Price) {
       que.setUserChoice(Q4_PriceDistance.PRICE);
     } else if (evt.getSource() == cBox_Distance) {
       que.setUserChoice(Q4_PriceDistance.DISTANCE);
     }
   }
 }
예제 #24
0
      public void itemStateChanged(ItemEvent e) {

        String value = e.getItem().toString();
        if (value.equals("Closed") || e.getItem().toString().equals("Open")) {
          jcbs[index][1].setVisible(false);
        } else {
          jcbs[index][1].setVisible(true);
        }
      }
 /** Callback method for check boxes Set values in check boxes map */
 @Override
 public void itemStateChanged(ItemEvent event) {
   JCheckBox checkBox = (JCheckBox) event.getSource();
   if (event.getStateChange() == ItemEvent.DESELECTED) {
     checkBoxValues.put(checkBox, false);
   } else if (event.getStateChange() == ItemEvent.SELECTED) {
     checkBoxValues.put(checkBox, true);
   }
 }
예제 #26
0
 @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);
   }
 }
예제 #27
0
  @Override
  public void itemStateChanged(ItemEvent e) {

    if (e.getStateChange() == ItemEvent.SELECTED) {

      String name = (String) e.getItem();

      window.updateActiveWrestler(name);
    }
  }
예제 #28
0
 /**
  * Updates the explorer for new perspectives / orderings.
  *
  * <p>{@inheritDoc}
  */
 public void itemStateChanged(ItemEvent e) {
   if (e.getSource() instanceof PerspectiveComboBox) {
     rules = ((ExplorerPerspective) e.getItem()).getList();
   } else { // it is the combo for "order"
     order = (Comparator) e.getItem();
   }
   structureChanged();
   // TODO: temporary - let tree expand implicitly - tfm
   tree.expandPath(tree.getPathForRow(1));
 }
예제 #29
-1
  /**
   * Invoked when an item has been selected or deselected by the user.
   *
   * <p>Invoked when an item has been selected or deselected by the user. The code written for this
   * method performs the operations that need to occur when an item is selected (or deselected).
   */
  public void itemStateChanged(ItemEvent e) {
    /* format menu */
    if (e.getSource() == wordWrap) {
      editor.setLineWrap(!editor.getLineWrap());
      side.setLineWrap(editor.getLineWrap());
      // wordWrap.setText(editor.getLineWrap() ? "Disable Word Wrap" : "Enable Word Wrap");
      wordWrap.setDisplayedMnemonicIndex(wordWrap.getText().indexOf('W'));
    }

    /* view menu */
    if (e.getSource() == toggleSide) {
      // hide the sidePane, sideButton, and update the text in the toggleSide JMenuItem (need to
      // update mnemonicindex as well)
      sidePane.setVisible(!sidePane.isVisible());
      sideButton.setVisible(sidePane.isVisible());
      // toggleSide.setText(sidePane.isVisible() ? "Hide Side Pane" : "Show Side Pane");
      toggleSide.setDisplayedMnemonicIndex(5);

      // easier to remove everything and then add them back
      centerPanel.removeAll();
      centerPanel.add(editorPane);
      if (sideButton.isVisible()) {
        centerPanel.add(sidePane);
      }
      centerPanel.validate();
    }
  }
예제 #30
-1
 private void timestampCheckBoxItemStateChanged(
     java.awt.event.ItemEvent evt) { // GEN-FIRST:event_timestampCheckBoxItemStateChanged
   if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
     this.timestamp = new java.text.SimpleDateFormat("HH:mm:ss.SSSS");
   } else if (evt.getStateChange() == java.awt.event.ItemEvent.DESELECTED) {
     this.timestamp = null;
   }
 } // GEN-LAST:event_timestampCheckBoxItemStateChanged