Exemplo n.º 1
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);
        }
      }
    }
Exemplo n.º 2
0
  @Override
  public void itemStateChanged(ItemEvent e) {
    //		e.getItem();//状态
    System.out.println("e.getItem()           === " + e.getItem());
    //		e.paramString();//状态
    System.out.println("e.paramString()       === " + e.paramString());
    //		e.getItemSelectable();//选中对象,相当于是getSource
    System.out.println("e.getItemSelectable() === " + e.getItemSelectable());
    //		e.getStateChange();
    System.out.println("e.getStateChange()    === " + e.getStateChange());

    if (e.getStateChange() == ItemEvent.SELECTED) {
      if (e.getSource() == c4) {
        c4.setIcon(new ImageIcon(ClassLoader.getSystemResource("img2.jpg")));
      }
      if (e.getSource() == c5) {
        c5.setIcon(new ImageIcon(ClassLoader.getSystemResource("img2.jpg")));
      }
    } else {
      if (e.getSource() == c4) {
        c4.setIcon(new ImageIcon(ClassLoader.getSystemResource("img1.jpg")));
      }
      if (e.getSource() == c5) {
        c5.setIcon(new ImageIcon(ClassLoader.getSystemResource("img1.jpg")));
      }
    }
  }
Exemplo n.º 3
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);
   }
 }
Exemplo n.º 4
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
 /** 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);
   }
 }
Exemplo n.º 6
0
 public void itemStateChanged(ItemEvent e) {
   if (e.getStateChange() == ItemEvent.DESELECTED) {
     playerCharacter.setTempBonusFilter(bonus);
   }
   if (e.getStateChange() == ItemEvent.SELECTED) {
     playerCharacter.unsetTempBonusFilter(bonus);
   }
   theParent.refresh();
 }
Exemplo n.º 7
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);
   }
 }
Exemplo n.º 8
0
 private void cbExpiresAfterOpenedItemStateChanged(ItemEvent e) {
   if (initPhase) return;
   txtExpiresIn.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
   cmbDaysWeeks.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
   if (e.getStateChange() == ItemEvent.SELECTED) {
     txtExpiresIn.setText("7");
     cmbDaysWeeks.setSelectedIndex(0);
     tradeForm.setDaysToExpireAfterOpened(7);
   } else {
     tradeForm.setDaysToExpireAfterOpened(null);
   }
 }
Exemplo n.º 9
0
  public void itemStateChanged(ItemEvent e) {

    Object source = e.getItemSelectable();

    if (source == brake) {

      myT.setBrake(e.getStateChange() == ItemEvent.SELECTED);
    }

    if (source == follow) {
      myT.followMe = (e.getStateChange() == ItemEvent.SELECTED);
    }
  }
Exemplo n.º 10
0
 /** Listens to the check box. */
 public void itemStateChanged(ItemEvent e) {
   if (!(graphPanel.getSelectState() || graphPanel.getOverlayState())) {
     if (e.getStateChange() == ItemEvent.DESELECTED) {
       selectionNumber = 0;
       graphPanel.getSelectedChannelShowSet().remove(channelView);
     } else if (e.getStateChange() == ItemEvent.SELECTED) {
       graphPanel.getSelectedChannelShowSet().add(channelView);
       currentSelectionNumber++;
       selectionNumber = currentSelectionNumber;
     }
   }
   selectionPerformed();
 }
  public void changePerspective(ItemEvent evt) {

    // if a perspective is deselected, remove it´s menu entries
    // from the menubar
    Perspective perspective = (Perspective) evt.getItem();

    if (evt.getStateChange() == java.awt.event.ItemEvent.DESELECTED) {
      editor.unsetPerspective(perspective);
    } else if (evt.getStateChange() == java.awt.event.ItemEvent.SELECTED) {
      editor.setPerspective(perspective);
    }

    EventManager.getInstance().firePerspectiveChangedEvent(evt);
  }
Exemplo n.º 12
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.getItem() instanceof Integer) {
     if (e.getStateChange() == ItemEvent.SELECTED) {
       JButton button = getButton((Integer) e.getItem());
       if (button != null) {
         button.setSelected(true);
       }
     } else if (e.getStateChange() == ItemEvent.DESELECTED) {
       JButton button = getButton((Integer) e.getItem());
       if (button != null) {
         button.setSelected(false);
       }
     }
   }
 }
Exemplo n.º 14
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);
    }
 public void itemStateChanged(ItemEvent e) {
   Object source = e.getItemSelectable();
   if (source == branchOverloadMonitorCheckbox) {
     if (e.getStateChange() == ItemEvent.SELECTED) overloadMonitorParams.setStatus(true);
     else overloadMonitorParams.setStatus(false);
   }
 }
Exemplo n.º 16
0
  private void jCmbLangsItemStateChanged(java.awt.event.ItemEvent evt) {
    if (evt.getStateChange() == ItemEvent.SELECTED) {
      String lang = jCmbLangs.getSelectedItem().toString();

      // save the state of the current JEditorPane, as it's Document is about
      // to be replaced.
      String oldText = jEditor.getText();

      // install a new DefaultSyntaxKit on the JEditorPane for the requested language.
      jEditor.setContentType(lang);
      // Recreate the Toolbar
      jToolBar1.removeAll();
      EditorKit kit = jEditor.getEditorKit();
      if (kit instanceof DefaultSyntaxKit) {
        DefaultSyntaxKit defaultSyntaxKit = (DefaultSyntaxKit) kit;
        defaultSyntaxKit.addToolBarActions(jEditor, jToolBar1);
      }
      jToolBar1.validate();
      try {
        // setText should not be called (read the JavaDocs).  Better use the read
        // method and create a new document.
        jEditor.read(new StringReader(oldText), lang);
      } catch (IOException ex) {
        Logger.getLogger(SyntaxTester.class.getName()).log(Level.SEVERE, null, ex);
      }
    }
    jEditor.requestFocusInWindow();
  }
Exemplo n.º 17
0
 public void itemStateChanged(ItemEvent e) {
   if (!myIsEnabled) return;
   if (e.getStateChange() == ItemEvent.SELECTED) {
     ThreadDescriptorImpl item = (ThreadDescriptorImpl) e.getItem();
     DebuggerContextUtil.setThread(getContextManager(), item);
   }
 }
Exemplo n.º 18
0
  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("");
      }
    }
  }
Exemplo n.º 19
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();
          }
        }
  @Override
  public void itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.SELECTED) {
      for (int i = 0; i < chapterListTable.getRowCount(); i++) {
        Chapter chapter =
            chapterTableModel.getChapterAt(chapterListTable.convertRowIndexToModel(i));

        if (!chapter.isAlreadyDownloaded()) {
          chapter.setDownload(true);
        }
      }
      chapterTableModel.fireTableDataChanged();
    } else if (e.getStateChange() == ItemEvent.DESELECTED) {
      mangaDownloader.deactivateDownloads();
    }
  }
Exemplo n.º 21
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);
   }
 }
  public void itemStateChanged(ItemEvent e) {
    Object source = e.getItemSelectable();

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

    execute();
  }
Exemplo n.º 23
0
 // filter the lstProdAvi when keyword changed
 private void cmbProdFilterItemStateChanged(ItemEvent evt) {
   if (evt.getStateChange() != ItemEvent.SELECTED) {
     return;
   }
   String key = cmbProdFilter.getSelectedItem().toString();
   getAllProdList(key);
 }
Exemplo n.º 24
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();
        }
      }
    }
Exemplo n.º 25
0
 public void itemStateChanged(ItemEvent e) {
   if (e.getStateChange() == ItemEvent.SELECTED) {
     this.activated = true;
   } else {
     this.activated = false;
   }
 }
  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();
  }
Exemplo n.º 27
0
    public void itemStateChanged(ItemEvent e) {
      if (e.getStateChange() == ItemEvent.SELECTED) {
        boolean custom;
        boolean anim;
        switch (comboBox.getSelectedIndex()) {
          case OPT_DEFAULT:
            custom = false;
            anim = true;
            break;

          case OPT_NOT_ANIMATED:
            custom = false;
            anim = false;
            break;

          case OPT_CUSTOM_ANIMATED:
            custom = true;
            anim = true;
            break;

          default:
            return;
        }
        MCPatcherUtils.set(MCPatcherUtils.HD_TEXTURES, customTag, custom);
        MCPatcherUtils.set(MCPatcherUtils.HD_TEXTURES, animatedTag, anim);
      }
    }
Exemplo n.º 28
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
Exemplo n.º 29
0
  /**
   * DOCUMENT ME!
   *
   * @param e DOCUMENT ME!
   */
  @Override
  public void itemStateChanged(ItemEvent e) {
    if (e.getSource() == gui.vv.getPickedEdgeState()) {
      if (e.getStateChange() == ItemEvent.DESELECTED) {
        Edge edge = (Edge) e.getItem();
        edge.setSelected(false);
        edge.from.setSelected(false);
        edge.to.setSelected(false);
      } else if (e.getStateChange() == ItemEvent.SELECTED) {
        gui.vv.getPickedVertexState().clear();

        Edge edge = (Edge) e.getItem();
        edge.setSelected(true);
        edge.from.setSelected(true);
        edge.to.setSelected(true);
        gui.statusPanel.setStatusBar(edge);
      }
    } else if (e.getSource() == gui.vv.getPickedVertexState()) {
      if (e.getStateChange() == ItemEvent.DESELECTED) {
        Node node = (Node) e.getItem();
        node.setSelected(false);

        Collection<Node> neighbors = gui.embed.getGraph().getNeighbors(node);

        if (neighbors != null) {
          for (Node n : neighbors) {
            n.setNeighbor(false);
          }
        }
      } else if (e.getStateChange() == ItemEvent.SELECTED) {
        gui.vv.getPickedEdgeState().clear();

        Node node = (Node) e.getItem();
        node.setSelected(true);

        Collection<Node> neighbors = gui.embed.getGraph().getNeighbors(node);

        if (neighbors != null) {
          for (Node n : neighbors) {
            n.setNeighbor(true);
          }
        }

        gui.statusPanel.setStatusBar(node);
      }
    }
  }
Exemplo n.º 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