Java Code Examples for javax.swing.event.ChangeEvent

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project autopsy, under directory /Core/src/org/sleuthkit/autopsy/casemodule/.

Source file: AddImageWizardPanel1.java

  22 
vote

/** 
 * This method is auto-generated. It seems that this method is used to listen to any change in this wizard panel.
 */
protected final void fireChangeEvent(){
  Iterator<ChangeListener> it;
synchronized (listeners) {
    it=new HashSet<ChangeListener>(listeners).iterator();
  }
  ChangeEvent ev=new ChangeEvent(this);
  while (it.hasNext()) {
    it.next().stateChanged(ev);
  }
}
 

Example 2

From project coffeescript-netbeans, under directory /src/coffeescript/nb/project/sample/.

Source file: CoffeeScriptApplicationWizardPanel.java

  22 
vote

protected final void fireChangeEvent(){
  Set<ChangeListener> ls;
synchronized (listeners) {
    ls=new HashSet<ChangeListener>(listeners);
  }
  ChangeEvent ev=new ChangeEvent(this);
  for (  ChangeListener l : ls) {
    l.stateChanged(ev);
  }
}
 

Example 3

From project enclojure, under directory /netbeans/plugins/org-enclojure-plugin/src/main/java/org/enclojure/ide/nb/clojure/project/.

Source file: ClojureTemplateWizardPanel.java

  22 
vote

protected final void fireChangeEvent(){
  Set<ChangeListener> ls;
synchronized (listeners) {
    ls=new HashSet<ChangeListener>(listeners);
  }
  ChangeEvent ev=new ChangeEvent(this);
  for (  ChangeListener l : ls) {
    l.stateChanged(ev);
  }
}
 

Example 4

From project ISAcreator, under directory /src/main/java/org/isatools/isacreator/autofilterfield/.

Source file: DefaultAutoFilterCellEditor.java

  22 
vote

/** 
 * FireEditingCanceled method sets text back to its original value, and cancels editing by referring to the list of CellEditorListener objects and calling the editingStopped method with a ChangeEvent defined using the OntologyCellEditor as a reference.
 */
protected void fireEditingCanceled(){
  setText(originalValue);
  ChangeEvent ce=new ChangeEvent(this);
  for (int i=listeners.size() - 1; i >= 0; i--) {
    (listeners.get(i)).editingCanceled(ce);
  }
}
 

Example 5

From project lilith, under directory /lilith/src/main/java/de/huxhorn/lilith/swing/.

Source file: ViewContainer.java

  22 
vote

public void fireChange(){
  ArrayList<ChangeListener> clone;
synchronized (changeListeners) {
    clone=new ArrayList<ChangeListener>(changeListeners);
  }
  ChangeEvent event=new ChangeEvent(this);
  for (  ChangeListener listener : clone) {
    listener.stateChanged(event);
  }
}
 

Example 6

From project netbeans-plugin, under directory /src/org/netbeans/modules/php/nette/wizards/newpresenter/.

Source file: ParentPresenterWizardPanel.java

  22 
vote

protected final void fireChangeEvent(){
  Iterator<ChangeListener> it;
synchronized (listeners) {
    it=new HashSet<ChangeListener>(listeners).iterator();
  }
  ChangeEvent ev=new ChangeEvent(this);
  while (it.hasNext()) {
    it.next().stateChanged(ev);
  }
}
 

Example 7

From project QuakeInjector, under directory /src/de/haukerehfeld/quakeinjector/.

Source file: ChangeListenerList.java

  22 
vote

public void notifyChangeListeners(Object source){
  ChangeEvent e=new ChangeEvent(source);
  for (  ChangeListener l : listeners) {
    l.stateChanged(e);
  }
}
 

Example 8

From project QView, under directory /QView-suite/MQProject/src/org/qview/gui/nbexplorer/.

Source file: PropertiesNotifier.java

  22 
vote

public static void changed(){
  ChangeEvent ev=new ChangeEvent(PropertiesNotifier.class);
  Iterator it=listeners.iterator();
  while (it.hasNext()) {
    try {
      ((ChangeListener)it.next()).stateChanged(ev);
    }
 catch (    ConcurrentModificationException ex) {
      break;
    }
  }
}
 

Example 9

From project SwingOSC, under directory /src/main/java/de/sciss/swingosc/.

Source file: NumberField.java

  22 
vote

private void fireChange(){
  final ChangeEvent e=new ChangeEvent(this);
  for (int i=0; i < collChangeListeners.size(); i++) {
    final ChangeListener l=(ChangeListener)collChangeListeners.get(i);
    l.stateChanged(e);
  }
}
 

Example 10

From project TraVis, under directory /src/travis/view/project/tree/.

Source file: CheckBoxTreeCellRenderer.java

  22 
vote

public void fireStateChanged(){
  ChangeListener[] listeners=listenerList.getListeners(ChangeListener.class);
  ChangeEvent e=new ChangeEvent(this);
  for (  ChangeListener listener : listeners) {
    listener.stateChanged(e);
  }
}
 

Example 11

From project Valkyrie-RCP, under directory /valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/control/.

Source file: ExtTabbedPane.java

  22 
vote

private void updateTabVisibility(Tab tab){
  if (tab.isVisible()) {
    tabbedPane.insertTab(tab.getTitle(),tab.getIcon(),tab.getComponent(),tab.getTooltip(),getUIIndex(tab));
  }
 else {
    tabbedPane.removeTabAt(getUIIndex(tab));
  }
  ChangeEvent event=new ChangeEvent(tabbedPane);
  changeListeners.fire("stateChanged",event);
}
 

Example 12

From project des, under directory /daemon/lib/apache-log4j-1.2.16/src/main/java/org/apache/log4j/lf5/viewer/categoryexplorer/.

Source file: CategoryAbstractCellEditor.java

  21 
vote

protected void fireEditingStopped(){
  Object[] listeners=_listenerList.getListenerList();
  for (int i=listeners.length - 2; i >= 0; i-=2) {
    if (listeners[i] == CellEditorListener.class) {
      if (_changeEvent == null) {
        _changeEvent=new ChangeEvent(this);
      }
      ((CellEditorListener)listeners[i + 1]).editingStopped(_changeEvent);
    }
  }
}
 

Example 13

From project extension_libero_manufacturing, under directory /extension/eevolution/libero/src/main/java/org/eevolution/form/.

Source file: VOrderDistributionReceipt.java

  21 
vote

/** 
 * Save Selection & return selecion Query or ""
 * @return where clause like C_Order_ID IN (...)
 */
private void saveSelection(){
  log.info("");
  miniTable.editingStopped(new ChangeEvent(this));
  ArrayList<Integer> results=new ArrayList<Integer>();
  selection=null;
  int rows=miniTable.getRowCount();
  for (int i=0; i < rows; i++) {
    IDColumn id=(IDColumn)miniTable.getValueAt(i,0);
    if (id != null && id.isSelected())     results.add(id.getRecord_ID());
  }
  if (results.size() == 0)   return;
  log.config("Selected #" + results.size());
  selection=results;
}
 

Example 14

From project flyingsaucer, under directory /flying-saucer-core/src/main/java/org/xhtmlrenderer/swing/.

Source file: SelectionHighlighter.java

  21 
vote

protected void fireStateChanged(){
  Object[] listeners=listenerList.getListenerList();
  for (int i=listeners.length - 2; i >= 0; i-=2) {
    if (listeners[i] == ChangeListener.class) {
      if (changeEvent == null)       changeEvent=new ChangeEvent(this);
      ((ChangeListener)listeners[i + 1]).stateChanged(changeEvent);
    }
  }
}
 

Example 15

From project freemind, under directory /freemind/freemind/modes/attributes/.

Source file: AttributeRegistry.java

  21 
vote

public void fireStateChanged(){
  Object[] listeners=listenerList.getListenerList();
  for (int i=listeners.length - 2; i >= 0; i-=2) {
    if (listeners[i] == ChangeListener.class) {
      if (changeEvent == null)       changeEvent=new ChangeEvent(this);
      ((ChangeListener)listeners[i + 1]).stateChanged(changeEvent);
    }
  }
}
 

Example 16

From project jPOS, under directory /jpos/src/test/java/org/jpos/ui/factory/.

Source file: JTabbedPaneFactoryTest.java

  21 
vote

@Ignore("test fails because the component is not properly created from the jPOS UI") @Test public void testStateChanged() throws Throwable {
  JTabbedPaneFactory jTabbedPaneFactory=new JTabbedPaneFactory();
  jTabbedPaneFactory.stateChanged(new ChangeEvent(Integer.valueOf(0)));
  assertEquals("jTabbedPaneFactory.actions.size()",0,jTabbedPaneFactory.actions.size());
  assertNull("jTabbedPaneFactory.p",jTabbedPaneFactory.p);
  assertNull("jTabbedPaneFactory.ui",jTabbedPaneFactory.ui);
}
 

Example 17

From project knime-scripting, under directory /knutils/src/de/mpicbg/tds/knime/knutils/ui/.

Source file: TwoPaneSelectionPanel.java

  21 
vote

private void fireFilteringChangedEvent(){
  if (m_listeners != null) {
    for (    ChangeListener listener : m_listeners) {
      listener.stateChanged(new ChangeEvent(this));
    }
  }
}
 

Example 18

From project log4jna, under directory /thirdparty/log4j/src/main/java/org/apache/log4j/lf5/viewer/categoryexplorer/.

Source file: CategoryAbstractCellEditor.java

  21 
vote

protected void fireEditingStopped(){
  Object[] listeners=_listenerList.getListenerList();
  for (int i=listeners.length - 2; i >= 0; i-=2) {
    if (listeners[i] == CellEditorListener.class) {
      if (_changeEvent == null) {
        _changeEvent=new ChangeEvent(this);
      }
      ((CellEditorListener)listeners[i + 1]).editingStopped(_changeEvent);
    }
  }
}
 

Example 19

From project niravCS2103, under directory /CS2103/lib/apache-log4j-1.2.16/src/main/java/org/apache/log4j/lf5/viewer/categoryexplorer/.

Source file: CategoryAbstractCellEditor.java

  21 
vote

protected void fireEditingStopped(){
  Object[] listeners=_listenerList.getListenerList();
  for (int i=listeners.length - 2; i >= 0; i-=2) {
    if (listeners[i] == CellEditorListener.class) {
      if (_changeEvent == null) {
        _changeEvent=new ChangeEvent(this);
      }
      ((CellEditorListener)listeners[i + 1]).editingStopped(_changeEvent);
    }
  }
}
 

Example 20

From project nodebox, under directory /src/main/java/nodebox/client/.

Source file: ColorWell.java

  21 
vote

protected void fireStateChanged(){
  if (changeEvent == null) {
    changeEvent=new ChangeEvent(this);
  }
  for (  EventListener l : listenerList.getListeners(ChangeListener.class)) {
    ((ChangeListener)l).stateChanged(changeEvent);
  }
}
 

Example 21

From project RegexTagForMusic, under directory /src/org/essembeh/rtfm/ui/model/.

Source file: MusicFilesSelection.java

  21 
vote

@Override public void valueChanged(ListSelectionEvent e){
  currentSelection.clear();
  int[] selectedRows=jtable.getSelectedRows();
  if (selectedRows != null) {
    List<IMusicFile> filteredFiles=musicFilesModel.getFilteredFiles();
    for (    int i : selectedRows) {
      currentSelection.add(filteredFiles.get(i));
    }
  }
  changeListenerContainer.stateChanged(new ChangeEvent(this));
}
 

Example 22

From project SIARD-Val, under directory /SIARD-Val/external-sources/log4j-1.2.12/java/org/apache/log4j/lf5/viewer/categoryexplorer/.

Source file: CategoryAbstractCellEditor.java

  21 
vote

protected void fireEditingStopped(){
  Object[] listeners=_listenerList.getListenerList();
  for (int i=listeners.length - 2; i >= 0; i-=2) {
    if (listeners[i] == CellEditorListener.class) {
      if (_changeEvent == null) {
        _changeEvent=new ChangeEvent(this);
      }
      ((CellEditorListener)listeners[i + 1]).editingStopped(_changeEvent);
    }
  }
}
 

Example 23

From project SPREAD, under directory /src/colorpicker/swing/.

Source file: ColorPickerPanel.java

  21 
vote

protected void fireChangeListeners(){
  if (changeListeners == null)   return;
  for (int a=0; a < changeListeners.size(); a++) {
    ChangeListener l=(ChangeListener)changeListeners.get(a);
    try {
      l.stateChanged(new ChangeEvent(this));
    }
 catch (    RuntimeException e) {
      e.printStackTrace();
    }
  }
}
 

Example 24

From project treeGenerator, under directory /arbaro_1_9_8/src/net/sourceforge/arbaro/gui/.

Source file: ParamGroupsView.java

  21 
vote

protected void fireStateChanged(){
  Object[] listeners=listenerList.getListenerList();
  for (int i=listeners.length - 2; i >= 0; i-=2) {
    if (listeners[i] == ChangeListener.class) {
      if (changeEvent == null) {
        changeEvent=new ChangeEvent(this);
      }
      ((ChangeListener)listeners[i + 1]).stateChanged(changeEvent);
    }
  }
}
 

Example 25

From project alg-vis, under directory /src/algvis/btree/.

Source file: BTreeButtons.java

  19 
vote

@Override public void stateChanged(ChangeEvent evt){
  if (evt.getSource() == OS) {
    ((BTree)D).order=(Integer)OS.getValue();
    D.clear();
    ((BTree)D).reposition();
  }
}
 

Example 26

From project BDSup2Sub, under directory /src/main/java/bdsup2sub/gui/edit/.

Source file: EditDialogController.java

  19 
vote

@Override public void stateChanged(ChangeEvent event){
  if (model.isEnableSliders()) {
    SubPicture subPic=model.getSubPic();
    int y=subPic.getHeight() - view.getVerticalSliderValue();
    if (y < model.getCropOffsetY()) {
      y=model.getCropOffsetY();
    }
 else     if (y > subPic.getHeight() - subPic.getImageHeight() - model.getCropOffsetY()) {
      y=subPic.getHeight() - subPic.getImageHeight() - model.getCropOffsetY();
    }
    if (y != subPic.getYOffset()) {
      subPic.setOfsY(y);
      view.setYTextFieldText(String.valueOf(subPic.getYOffset()));
      view.setPreviewPanelOffsets(subPic.getXOffset(),subPic.getYOffset());
      view.setPreviewPanelAspectRatio(21.0 / 9);
      view.repaintPreviewPanel();
      setEdited(true);
    }
  }
}
 

Example 27

From project beanmill_1, under directory /src/main/java/com/traxel/lumbermill/filter/.

Source file: FilterSetControl.java

  19 
vote

/** 
 * Creates a new FilterSetControl object.
 */
public FilterSetControl(){
  filterPerTree=new HashMap<FilterControl,Filter>();
  filterSetView=new FilterSetView();
  filterSet=new FilterSet();
  treeControl=new TreeControl();
  final List<FilterControl> filterControls=new ArrayList();
  filterControls.add(treeControl);
  allFilterControls=Collections.unmodifiableList(filterControls);
  final JCheckBoxMenuItem[] filterItems=new JCheckBoxMenuItem[allFilterControls.size()];
  for (int i=0; i < allFilterControls.size(); i++) {
    final FilterControl fc=allFilterControls.get(i);
    final Action action=new FilterCheckBoxAction(fc);
    filterItems[i]=new JCheckBoxMenuItem(action);
    filterItems[i].setState(true);
    apply(fc);
  }
  filterSetMenu=new FilterSetMenu("Filters",filterItems);
  filterSetView.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    final ChangeEvent evt){
      if (LOG.isDebugEnabled()) {
        LOG.debug("stateChanged: " + evt);
      }
      for (      final FilterControl fc : filterPerTree.keySet()) {
        if (!(fc.getFilter() instanceof Regex)) {
          fc.getFilter().setActive(false);
        }
      }
      try {
        getActiveComponent().getFilter().setActive(true);
        filterSet.fireFilterAdded(null);
      }
 catch (      Exception e) {
        LOG.warn("could not set active filter",e);
      }
    }
  }
);
}
 

Example 28

From project Calendar-Application, under directory /com/toedter/calendar/.

Source file: JMonthChooser.java

  19 
vote

/** 
 * Is invoked if the state of the spinner changes.
 * @param e the change event.
 */
public void stateChanged(ChangeEvent e){
  SpinnerNumberModel model=(SpinnerNumberModel)((JSpinner)e.getSource()).getModel();
  int value=model.getNumber().intValue();
  boolean increase=(value > oldSpinnerValue) ? true : false;
  oldSpinnerValue=value;
  int month=getMonth();
  if (increase) {
    month+=1;
    if (month == 12) {
      month=0;
      if (yearChooser != null) {
        int year=yearChooser.getYear();
        year+=1;
        yearChooser.setYear(year);
      }
    }
  }
 else {
    month-=1;
    if (month == -1) {
      month=11;
      if (yearChooser != null) {
        int year=yearChooser.getYear();
        year-=1;
        yearChooser.setYear(year);
      }
    }
  }
  setMonth(month);
}
 

Example 29

From project ceres, under directory /ceres-glayer/src/main/java/com/bc/ceres/glayer/swing/.

Source file: AdjustableViewScrollPane.java

  19 
vote

@Override public void stateChanged(ChangeEvent e){
  if (!atWork) {
    try {
      atWork=true;
      updateViewport();
    }
  finally {
      atWork=false;
    }
  }
}
 

Example 30

From project ChkBugReport, under directory /src/com/sonyericsson/chkbugreport/.

Source file: Gui.java

  19 
vote

private void buildSettings(JPanel settingsPanel){
  final Settings settings=mMain.getSettings();
  for (  Setting setting : settings) {
    if (setting instanceof BoolSetting) {
      final BoolSetting bs=(BoolSetting)setting;
      final JCheckBox chk=new JCheckBox(setting.getDescription());
      settingsPanel.add(chk);
      chk.setSelected(bs.get());
      chk.addChangeListener(new ChangeListener(){
        @Override public void stateChanged(        ChangeEvent e){
          bs.set(chk.isSelected());
          settings.save();
        }
      }
);
    }
  }
}
 

Example 31

From project Cinch, under directory /src/com/palantir/ptoss/cinch/swing/.

Source file: JSliderWiringHarness.java

  19 
vote

public static Binding bindJSlider(final Mutator mutator,final JSlider slider){
  final ChangeListener changeListener=new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      try {
        if (!slider.getValueIsAdjusting()) {
          mutator.set(slider.getValue());
        }
      }
 catch (      Exception ex) {
        Wiring.logger.error("exception in JSlider binding",ex);
      }
    }
  }
;
  slider.addChangeListener(changeListener);
  Binding binding=new Binding(){
    public <T extends Enum<?> & ModelUpdate>void update(    T... changed){
      try {
        Integer val=(Integer)mutator.get();
        if (val == null) {
          val=-1;
        }
        if (!val.equals(slider.getValue())) {
          slider.removeChangeListener(changeListener);
          slider.setValue(val);
          slider.addChangeListener(changeListener);
        }
      }
 catch (      Exception ex) {
        Wiring.logger.error("exception in JSlider binding",ex);
      }
    }
  }
;
  mutator.getModel().bind(binding);
  return binding;
}
 

Example 32

From project CommunityCase, under directory /src/org/community/intellij/plugins/communitycase/update/.

Source file: UpdateOptionsPanel.java

  19 
vote

/** 
 * The constructor
 */
public UpdateOptionsPanel(){
  myForceRebaseRadioButton.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      boolean keepPossible=!myForceRebaseRadioButton.isSelected();
      if (!keepPossible && myKeepRadioButton.isSelected()) {
        myStashRadioButton.setSelected(true);
      }
      myKeepRadioButton.setEnabled(keepPossible);
    }
  }
);
}
 

Example 33

From project dawn-common, under directory /org.dawb.hdf5/src/ncsa/hdf/view/.

Source file: DefaultImageView.java

  19 
vote

/** 
 * Listen to the slider. 
 */
public void stateChanged(ChangeEvent e){
  Object source=e.getSource();
  if (!(source instanceof JSlider)) {
    return;
  }
  JSlider slider=(JSlider)source;
  if (!slider.isEnabled())   return;
  double value=slider.getValue();
  if (slider.equals(minSlider)) {
    double maxValue=maxSlider.getValue();
    if (value > maxValue) {
      value=maxValue;
      slider.setValue((int)value);
    }
    minField.setValue(new Double(value));
  }
 else   if (slider.equals(maxSlider)) {
    double minValue=minSlider.getValue();
    if (value < minValue) {
      value=minValue;
      slider.setValue((int)value);
    }
    maxField.setValue(new Double(value));
  }
}
 

Example 34

From project Euclidean-Pattern-Generator, under directory /src/com/hisschemoller/sequencer/view/components/.

Source file: Controls.java

  19 
vote

public void stateChanged(ChangeEvent event){
  if (event.getSource() == _tempoSlider) {
    _tempoValue=_tempoSlider.getValue() / 10f;
    dispatchViewEvent(_tempoSlider,ViewEvent.TEMPO_CHANGE);
  }
}
 

Example 35

From project FBReaderJ, under directory /obsolete/swing/src/org/geometerplus/zlibrary/ui/swing/dialogs/.

Source file: ZLBooleanOptionView.java

  19 
vote

protected void createItem(){
  final ZLBooleanOptionEntry booleanEntry=(ZLBooleanOptionEntry)myOption;
  myCheckBox=new JCheckBox(myName);
  myCheckBox.setSelected(booleanEntry.initialState());
  myCheckBox.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      booleanEntry.onStateChanged(myCheckBox.isSelected());
    }
  }
);
  myTab.insertWidget(myCheckBox);
}
 

Example 36

From project GenericKnimeNodes, under directory /com.genericworkflownodes.knime.base_plugin/src/com/genericworkflownodes/knime/nodes/io/listimporter/.

Source file: DialogComponentMultiFileChooser.java

  19 
vote

/** 
 * Transfers values from the  {@link SettingsModelStringArray} into theunderlying model.
 * @param model The data model.
 */
public FileListModel(final SettingsModelStringArray model){
  files=new ArrayList<File>();
  updateFromSettingsModel(model);
  model.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    final ChangeEvent event){
      if (event.getSource() instanceof SettingsModelStringArray) {
        SettingsModelStringArray eventSource=(SettingsModelStringArray)event.getSource();
        updateFromSettingsModel(eventSource);
      }
    }
  }
);
}
 

Example 37

From project gitblit, under directory /src/com/gitblit/client/.

Source file: GitblitPanel.java

  19 
vote

public GitblitPanel(GitblitRegistration reg,RegistrationsDialog.RegistrationListener listener){
  this.gitblit=new GitblitClient(reg);
  this.listener=listener;
  tabs=new JTabbedPane(JTabbedPane.BOTTOM);
  tabs.addTab(Translation.get("gb.repositories"),createRepositoriesPanel());
  tabs.addTab(Translation.get("gb.activity"),createFeedsPanel());
  tabs.addTab(Translation.get("gb.teams"),createTeamsPanel());
  tabs.addTab(Translation.get("gb.users"),createUsersPanel());
  tabs.addTab(Translation.get("gb.settings"),createSettingsPanel());
  tabs.addTab(Translation.get("gb.status"),createStatusPanel());
  tabs.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      tabs.getSelectedComponent().requestFocus();
    }
  }
);
  setLayout(new BorderLayout());
  add(tabs,BorderLayout.CENTER);
}
 

Example 38

From project GraphLab, under directory /src/graphlab/graph/ui/.

Source file: GTabbedGraphPane.java

  19 
vote

public GTabbedGraphPane(BlackBoard b){
  super(b);
  jtp.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      reTab();
    }
  }
);
  b.setData(GTabbedGraphPane.NAME,this);
}
 

Example 39

From project Hotel-Management_MINF10-HCM, under directory /HotelManagement/src/main/java/core/datechooser/.

Source file: JMonthChooser.java

  19 
vote

/** 
 * Is invoked if the state of the spnner changes.
 * @param e the change event.
 */
public void stateChanged(ChangeEvent e){
  SpinnerNumberModel model=(SpinnerNumberModel)((JSpinner)e.getSource()).getModel();
  int value=model.getNumber().intValue();
  boolean increase=(value > oldSpinnerValue) ? true : false;
  oldSpinnerValue=value;
  int month=getMonth();
  if (increase) {
    month+=1;
    if (month == 12) {
      month=0;
      if (yearChooser != null) {
        int year=yearChooser.getYear();
        year+=1;
        yearChooser.setYear(year);
      }
    }
  }
 else {
    month-=1;
    if (month == -1) {
      month=11;
      if (yearChooser != null) {
        int year=yearChooser.getYear();
        year-=1;
        yearChooser.setYear(year);
      }
    }
  }
  setMonth(month);
}
 

Example 40

From project imageflow, under directory /src/de/danielsenff/imageflow/gui/.

Source file: UnitPropertiesDialog.java

  19 
vote

private void addDisplayCheckbox(final UnitElement unit){
  JPanel panel=new JPanel();
  JCheckBox chkDisplay=new JCheckBox("Display result");
  chkDisplay.setToolTipText("After the workflow has been executed, nodes that are set to 'display' are displayed as a result.");
  chkDisplay.setSelected(unit.isDisplay());
  chkDisplay.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      boolean newValue=((JCheckBox)event.getSource()).isSelected();
      unit.setDisplay(newValue);
    }
  }
);
  panel.add(chkDisplay);
  ActionMap actionMap=ImageFlow.getApplication().getContext().getActionMap(ImageFlowView.class,ImageFlow.getApplication().getMainView());
  JToggleButton addToDashboard=new JToggleButton(actionMap.get("togglePropertiesOnDashboard"));
  addToDashboard.setPreferredSize(new Dimension(110,20));
  addToDashboard.setSelected(unit.hasWidget());
  panel.add(addToDashboard);
  JToggleButton addPreviewToDashboard=new JToggleButton(actionMap.get("togglePreviewOnDashboard"));
  addPreviewToDashboard.setSelected(unit.hasPreviewWidget());
  addPreviewToDashboard.setPreferredSize(new Dimension(110,20));
  panel.add(addPreviewToDashboard);
  addForm("",panel);
}
 

Example 41

From project isohealth, under directory /Oauth/java/jmeter/jmeter/src/main/java/org/apache/jmeter/protocol/oauth/control/gui/.

Source file: OAuthConfigGui.java

  19 
vote

public void stateChanged(ChangeEvent e){
  if (e.getSource() == signatureMethod) {
    if (signatureMethod.getText().equals(OAuthSampler.HMAC)) {
      secretLabel.setText(OAuthSamplerGui.getResString("oauth_consumer_secret"));
    }
 else {
      secretLabel.setText(OAuthSamplerGui.getResString("oauth_private_key"));
    }
  }
}
 

Example 42

From project JaamSim, under directory /com/sandwell/JavaSimulation3D/.

Source file: EditBox.java

  19 
vote

private EditBox(){
  super("Input Editor");
  cellRenderer=new CellRenderer();
  helpKeyListener=new HelpKeyListener();
  setDefaultCloseOperation(FrameBox.HIDE_ON_CLOSE);
  buildingTable=false;
  jTabbedPane=new JTabbedPane();
  jTabbedPane.setBackground(INACTIVE_TAB_COLOR);
  jTabbedPane.setPreferredSize(new Dimension(700,400));
  getContentPane().add(jTabbedPane);
  jTabbedPane.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent evt){
      JTabbedPane pane=(JTabbedPane)evt.getSource();
      if (buildingTable || pane.getSelectedIndex() < 0)       return;
      jTabbedPane.setBackgroundAt(presentPage,INACTIVE_TAB_COLOR);
      presentPage=jTabbedPane.getSelectedIndex();
      jTabbedPane.setBackgroundAt(presentPage,ACTIVE_TAB_COLOR);
      updateValues();
    }
  }
);
  JLabel helpLabel=new JLabel("Press F1 for help on any cell",JLabel.CENTER);
  helpLabel.setFont(helpLabel.getFont().deriveFont(9f));
  getContentPane().add("South",helpLabel);
  pack();
  setLocation(220,710);
  setSize(530,290);
}
 

Example 43

From project jftp, under directory /src/main/java/com/myjavaworld/jftp/ssl/.

Source file: CertificateManagerDlg.java

  19 
vote

public void stateChanged(ChangeEvent evt){
  if (tabs.getSelectedIndex() == 0) {
    int selectionCount=serverCertificatesTable.getSelectedRowCount();
    butView.setEnabled(selectionCount == 1);
    butDelete.setEnabled(selectionCount > 0);
  }
 else   if (tabs.getSelectedIndex() == 1) {
    int selectionCount=clientCertificatesTable.getSelectedRowCount();
    butView.setEnabled(selectionCount == 1);
    butDelete.setEnabled(selectionCount > 0);
  }
}
 

Example 44

From project jMemorize, under directory /src/jmemorize/gui/swing/dialogs/.

Source file: AboutDialog.java

  19 
vote

private void initComponents(){
  m_tabbedPane=new JTabbedPane();
  m_tabbedPane.setBorder(new EtchedBorder());
  m_tabbedPane.addTab("Info",buildInfoPanel());
  m_tabbedPane.addTab("License",buildLicensePanel());
  m_tabbedPane.addTab("Java Properties",buildPropertiesPanel());
  m_tabbedPane.addTab("Program Preferences",buildPreferencesPanel());
  m_tabbedPane.setPreferredSize(new java.awt.Dimension(500,300));
  m_tabbedPane.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      if (m_tabbedPane.getSelectedIndex() == 1)       loadLicense();
    }
  }
);
  getContentPane().add(m_tabbedPane,BorderLayout.CENTER);
  getContentPane().add(buildButtonBar(),BorderLayout.SOUTH);
  pack();
}
 

Example 45

From project jmeter-components, under directory /src/main/java/com/atlantbh/jmeter/plugins/rest/gui/.

Source file: RestGui.java

  19 
vote

private JPanel getResourceConfigPanel(){
  automaticRedirect=new JCheckBox(JMeterUtils.getResString("follow_redirects"));
  httpMethods=new JLabeledChoice("Method",new String[]{"GET","POST","PUT","DELETE"});
  httpMethods.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      JLabeledChoice c=(JLabeledChoice)e.getSource();
      String text=c.getText();
      if ("PUT".equals(text) || "POST".equals(text)) {
        automaticRedirect.setSelected(false);
        automaticRedirect.setEnabled(false);
      }
 else {
        automaticRedirect.setEnabled(true);
      }
    }
  }
);
  useKeepAlive=new JCheckBox(JMeterUtils.getResString("use_keepalive"));
  hostBaseUrl=new JLabeledTextField("Base Url",25);
  resource=new JLabeledTextField("Resource",20);
  port=new JLabeledTextField("Port",10);
  VerticalPanel panel=new VerticalPanel();
  HorizontalPanel panel1=new HorizontalPanel();
  panel1.add(httpMethods);
  panel1.add(useKeepAlive);
  panel1.add(automaticRedirect);
  HorizontalPanel panel2=new HorizontalPanel();
  panel2.add(hostBaseUrl);
  panel2.add(port);
  HorizontalPanel panel3=new HorizontalPanel();
  panel3.add(resource);
  panel.add(panel1);
  panel.add(panel2);
  panel.add(panel3);
  return panel;
}
 

Example 46

From project jSite, under directory /src/main/java/de/todesbaum/jsite/gui/.

Source file: NodeManagerPage.java

  19 
vote

/** 
 * {@inheritDoc}
 */
@Override public void stateChanged(ChangeEvent e){
  Object source=e.getSource();
  Node selectedNode=getSelectedNode();
  if (selectedNode == null) {
    return;
  }
  if (source instanceof JSpinner) {
    JSpinner sourceSpinner=(JSpinner)source;
    if ("node-port".equals(sourceSpinner.getName())) {
      selectedNode.setPort((Integer)sourceSpinner.getValue());
      fireNodeSelected(selectedNode);
      nodeList.repaint();
    }
  }
}
 

Example 47

From project jsmaa, under directory /gui/src/main/java/fi/smaa/jsmaa/gui/components/.

Source file: LambdaPanel.java

  19 
vote

private void initComponents(){
  lambdaSlider=new RangeSlider(50,100,(int)(model.getLambda().getStart() * 100.0),(int)(model.getLambda().getEnd() * 100.0));
  lambdaSlider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      fireLambdaSliderChanged();
    }
  }
);
  lambdaRangeLabel=new JLabel();
  add(lambdaSlider,BorderLayout.CENTER);
  add(new JLabel("Lambda range"),BorderLayout.NORTH);
  add(lambdaRangeLabel,BorderLayout.SOUTH);
}
 

Example 48

From project Laserschein, under directory /src/laserschein/ui/.

Source file: BooleanTweaker.java

  19 
vote

public BooleanTweaker(String theTitle,boolean theDefault){
  super();
  this.setOpaque(false);
  _myLabel=new JLabel(theTitle);
  _myLabel.setFocusable(false);
  this.add(_myLabel);
  _myCheckbox=new JCheckBox();
  _myCheckbox.setSelected(theDefault);
  _myCheckbox.setFocusable(true);
  this.add(_myCheckbox);
  _myCheckbox.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      notifyListeners();
    }
  }
);
}
 

Example 49

From project LateralGM, under directory /org/lateralgm/main/.

Source file: Listener.java

  19 
vote

public void editingStopped(ChangeEvent e){
  ResNode node=(ResNode)LGM.tree.getLastSelectedPathComponent();
  if (node.status == ResNode.STATUS_SECONDARY && node.isEditable()) {
    String txt=((String)node.getUserObject()).replaceAll("\\W","").replaceAll("^([0-9]+)","");
    Resource<?,?> r=deRef((ResourceReference<?>)node.getRes());
    if (r != null)     r.setName(txt);
  }
}
 

Example 50

From project maple-ide, under directory /build/windows/launcher/launch4j/src/net/sf/launch4j/formimpl/.

Source file: BasicFormImpl.java

  19 
vote

public void stateChanged(ChangeEvent e){
  boolean dontWrap=_dontWrapJarCheck.isSelected();
  if (dontWrap) {
    _jarLabel.setIcon(loadImage("images/asterix-o.gif"));
    _jarLabel.setText(Messages.getString("jarPath"));
    _jarField.setToolTipText(Messages.getString("jarPathTip"));
  }
 else {
    _jarLabel.setIcon(loadImage("images/asterix.gif"));
    _jarLabel.setText(Messages.getString("jar"));
    _jarField.setToolTipText(Messages.getString("jarTip"));
  }
  _jarButton.setEnabled(!dontWrap);
}
 

Example 51

From project nenya, under directory /core/src/main/java/com/threerings/cast/builder/.

Source file: ClassEditor.java

  19 
vote

public void stateChanged(ChangeEvent e){
  JSlider source=(JSlider)e.getSource();
  if (!source.getValueIsAdjusting()) {
    int val=source.getValue();
    setSelectedComponent(val);
    _clabel.setText(Integer.toString(val));
  }
}
 

Example 52

From project nuxeo-distribution, under directory /nuxeo-launcher/src/main/java/org/nuxeo/launcher/gui/.

Source file: NuxeoFrame.java

  19 
vote

protected JComponent buildTabbedPanel(){
  tabbedPanel=new JTabbedPane(SwingConstants.TOP);
  tabbedPanel.addTab(NuxeoLauncherGUI.getMessage("tab.summary.title"),buildSummaryPanel());
  logsTab=buildLogsTab();
  tabbedPanel.addTab(NuxeoLauncherGUI.getMessage("tab.logs.title"),logsTab);
  tabbedPanel.addTab(NuxeoLauncherGUI.getMessage("tab.shell.title"),buildConsolePanel());
  tabbedPanel.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      JTabbedPane pane=(JTabbedPane)e.getSource();
      if (pane.getSelectedIndex() == 2) {
        consolePanel.getConsole().requestFocusInWindow();
      }
    }
  }
);
  return tabbedPanel;
}
 

Example 53

From project Opal, under directory /discontinued/opal-geo/src/main/java/com/lyndir/lhunath/opal/gui/.

Source file: OnOffButton.java

  19 
vote

/** 
 * {@inheritDoc}
 */
@Override public void stateChanged(final ChangeEvent e){
  if (isSelected()) {
    setText(onText);
    setIcon(onIcon);
  }
 else {
    setText(offText);
    setIcon(offIcon);
  }
}
 

Example 54

From project OWASP-WebScarab, under directory /src/org/owasp/webscarab/plugin/sessionid/swing/.

Source file: SessionIDPanel.java

  19 
vote

private void mainTabbedPaneStateChanged(ChangeEvent evt){
  int selected=mainTabbedPane.getSelectedIndex();
  if (mainTabbedPane.getTitleAt(selected).equals("Visualisation")) {
    if (_chart == null) {
      new SwingWorker(){
        public Object construct(){
          return createChart(_sidd);
        }
        public void finished(){
          _chart=(JFreeChart)get();
          visualisationPanel.add(new ChartPanel(_chart,900,500,600,400,1280,1024,true,true,true,false,true,true));
          visualisationPanel.doLayout();
        }
      }
.start();
    }
  }
}
 

Example 55

From project parasim, under directory /extensions/visualisation-plot-impl/src/main/java/org/sybila/parasim/visualisation/plot/impl/gui/.

Source file: ProjectionPlotter.java

  19 
vote

private void initSliders(){
  sliders=new JPanel();
  sliders.setLayout(new BoxLayout(sliders,BoxLayout.LINE_AXIS));
  sliders.setBorder(new EmptyBorder(PADDING));
  ChangeListener changed=new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent ce){
      updateView();
    }
  }
;
  axisSliders=new AxisSlider[dimension];
  for (int i=0; i < dimension; i++) {
    axisSliders[i]=new AxisSlider(names.getName(i),changed,extent.getMinBounds().getValue(i),extent.getMaxBounds().getValue(i));
    sliders.add(axisSliders[i]);
  }
  axisSliders[0].setActive(false);
  axisSliders[1].setActive(false);
  add(sliders,BorderLayout.LINE_END);
}
 

Example 56

From project pegadi, under directory /client/src/main/java/org/pegadi/artis/.

Source file: Artis.java

  19 
vote

/** 
 * Creates the user interface for the editor.
 */
protected void createUI(){
  createActions();
  setJMenuBar(createMenu());
  setGlassPane(easter);
  leftPane=new JTabbedPane(JTabbedPane.TOP);
  rightPane=new JTabbedPane(JTabbedPane.TOP);
  splitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  splitPane.setOneTouchExpandable(true);
  charCountLabel=new JLabel(strings.getString("status_charcount"));
  statusPanel=new JPanel();
  FlowLayout statusLayout=new FlowLayout(FlowLayout.LEFT);
  statusLayout.setHgap(10);
  statusPanel.setLayout(statusLayout);
  statusPanel.add(charCountLabel);
  getContentPane().setLayout(new BorderLayout());
  getContentPane().add(splitPane,BorderLayout.CENTER);
  getContentPane().add(statusPanel,BorderLayout.SOUTH);
  ImageIcon icon=new ImageIcon(getClass().getResource(strings.getString("icon_artis")));
  setIconImage(icon.getImage());
  setTitle(strings.getString("application_title") + " " + ApplicationLauncher.getVersion());
  setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
  addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      exitAction(null);
    }
  }
);
  leftPane.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      editorChanged((Editor)leftPane.getSelectedComponent());
    }
  }
);
  splitPane.setDividerLocation(1.0);
}
 

Example 57

From project PhonePledge, under directory /src/phonepledge/client/gui/.

Source file: PledgeControlPanel.java

  19 
vote

@Override public void stateChanged(ChangeEvent e){
  if (e.getSource() == transitionSpeedSpinner) {
    Integer value=(Integer)transitionSpeedSpinner.getValue();
    DisplayCommand cmd=new DisplayCommand(DisplayCommand.CMD_SET_TRANSITION_TIME,value);
    pledgeClient.sendCommand(cmd);
  }
 else   if (e.getSource() == tickerSpeedSpinner) {
    Integer value=(Integer)tickerSpeedSpinner.getValue();
    DisplayCommand cmd=new DisplayCommand(DisplayCommand.CMD_SET_TICKER_SPEED,value);
    pledgeClient.sendCommand(cmd);
  }
}
 

Example 58

From project pomodoro-tm, under directory /src/ru/greeneyes/project/pomidoro/settings/.

Source file: SettingsPresenter.java

  19 
vote

private void setupUIBindings(){
  final ActionListener actionListener=new ActionListener(){
    @Override public void actionPerformed(    ActionEvent event){
      updateUIModel();
      updateUI();
    }
  }
;
  ChangeListener changeListener=new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      actionListener.actionPerformed(null);
    }
  }
;
  settingsForm.pomodoroLengthComboBox.addActionListener(actionListener);
  settingsForm.breakLengthComboBox.addActionListener(actionListener);
  settingsForm.popupCheckBox.addChangeListener(changeListener);
  settingsForm.blockDuringBreak.addChangeListener(changeListener);
  settingsForm.ringVolumeSlider.addChangeListener(changeListener);
  settingsForm.showToolWindowCheckbox.addChangeListener(changeListener);
}
 

Example 59

From project pomodoro4nb, under directory /src/org/matveev/pomodoro4nb/prefs/.

Source file: PreferencesDialog.java

  19 
vote

private void updateComponentsWithPrefs(){
  enableReminderCheckbox.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      final JCheckBox box=(JCheckBox)e.getSource();
      reminderIntervalSpinner.setEnabled(box.isSelected());
    }
  }
);
  pomodoroLengthSpinner.setValue(provider.getInteger(POMODORO_LENGTH_KEY,DefaultPreferencesProvider.DEFAULT_POMODORO_LENGTH));
  shorBreakLengthSpinner.setValue(provider.getInteger(SHORT_BREAK_LENGTH_KEY,DefaultPreferencesProvider.DEFAULT_SHORT_BREAK_LENGTH));
  longBreakLengthSpinner.setValue(provider.getInteger(LONG_BREAK_LENGTH_KEY,DefaultPreferencesProvider.DEFAULT_LONG_BREAK_LENGTH));
  longBreakIntervalSpinner.setValue(provider.getInteger(LONG_BREAK_INTERVAL_KEY,DefaultPreferencesProvider.DEFAULT_LONG_BREAK_INTERVAL));
  enableSoundsCheckbox.setSelected(provider.getBoolean(ENABLE_SOUNDS_KEY,true));
  enableReminderCheckbox.setSelected(provider.getBoolean(ENABLE_REMINDER_KEY,true));
  reminderIntervalSpinner.setEnabled(provider.getBoolean(ENABLE_REMINDER_KEY,true));
}
 

Example 60

From project RomRaider, under directory /3rdparty/launch4j/src/net/sf/launch4j/formimpl/.

Source file: BasicFormImpl.java

  19 
vote

public void stateChanged(ChangeEvent e){
  boolean dontWrap=_dontWrapJarCheck.isSelected();
  if (dontWrap) {
    _jarLabel.setIcon(loadImage("images/asterix-o.gif"));
    _jarLabel.setText(Messages.getString("jarPath"));
    _jarField.setToolTipText(Messages.getString("jarPathTip"));
  }
 else {
    _jarLabel.setIcon(loadImage("images/asterix.gif"));
    _jarLabel.setText(Messages.getString("jar"));
    _jarField.setToolTipText(Messages.getString("jarTip"));
  }
  _jarButton.setEnabled(!dontWrap);
}
 

Example 61

From project ScapeToad, under directory /src/src/ch/epfl/scapetoad/.

Source file: CartogramWizard.java

  19 
vote

/** 
 * This method gets called on a state change of the advanced options check box. It enables or disables the advanced options.
 */
public void stateChanged(ChangeEvent e){
  boolean enabled=mAdvancedOptionsCheckBox.isSelected();
  mManualParametersPane.setEnabled(enabled);
  mGrid1Pane.setEnabled(enabled);
  mCartogramGridSizeLabel.setEnabled(enabled);
  mCartogramGridSizeTextField.setEnabled(enabled);
  mBiasPane.setEnabled(enabled);
  mBiasLabel.setEnabled(enabled);
  mBiasTextField.setEnabled(enabled);
}
 

Example 62

From project seadas, under directory /seadas-processing/src/main/java/gov/nasa/gsfc/seadas/processing/l2gen/userInterface/.

Source file: L2genForm.java

  19 
vote

public L2genForm(AppContext appContext,String xmlFileName,File iFile,boolean showIOFields){
  setOpenInAppCheckBox(new JCheckBox("Open in " + appContext.getApplicationName()));
  getOpenInAppCheckBox().setSelected(true);
  l2genData.showIOFields=showIOFields;
  if (getL2genData().initXmlBasedObjects()) {
    createMainTab();
    createProductsTab();
    createCategoryParamTabs();
    tabIndex=jTabbedPane.getSelectedIndex();
    getjTabbedPane().addChangeListener(new ChangeListener(){
      public void stateChanged(      ChangeEvent evt){
        tabChangeHandler();
      }
    }
);
    setLayout(new GridBagLayout());
    add(getjTabbedPane(),new GridBagConstraintsCustom(0,0,1,1,GridBagConstraints.WEST,GridBagConstraints.BOTH));
    add(getOpenInAppCheckBox(),new GridBagConstraintsCustom(0,1,0,0,GridBagConstraints.EAST,GridBagConstraints.NONE));
    getL2genData().disableEvent(L2genData.PARSTRING);
    getL2genData().disableEvent(L2genData.L2PROD);
    if (iFile != null) {
      getL2genData().setInitialValues(iFile);
    }
 else {
      getL2genData().setInitialValues(getInitialSelectedSourceFile());
    }
    getL2genData().fireAllParamEvents();
    getL2genData().enableEvent(L2genData.L2PROD);
    getL2genData().enableEvent(L2genData.PARSTRING);
  }
 else {
    add(new JLabel("Problem initializing userInterface"));
  }
}
 

Example 63

From project skmclauncher, under directory /src/main/java/com/sk89q/mclauncher/.

Source file: OptionsPanel.java

  19 
vote

/** 
 * Build the "set" checkbox.
 * @param component component to control
 * @return checkbox
 */
private JCheckBox buildSetCheck(final Component component){
  final JCheckBox check=new JCheckBox("Set:");
  check.setBorder(null);
  check.setOpaque(false);
  check.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      component.setEnabled(check.isSelected());
    }
  }
);
  return check;
}
 

Example 64

From project srec, under directory /core/src/main/java/com/github/srec/rec/component/.

Source file: MenuNavigationRecorder.java

  19 
vote

public void stateChanged(ChangeEvent e){
  MenuElement[] path=MenuSelectionManager.defaultManager().getSelectedPath();
  if (path != null && path.length > 0 && path[path.length - 1] instanceof JMenuItem) {
    selectedPath=MenuSelectionManager.defaultManager().getSelectedPath();
  }
}
 

Example 65

From project subsonic, under directory /subsonic-main/src/main/java/net/sourceforge/subsonic/service/jukebox/.

Source file: PlayerTest.java

  19 
vote

private void createGUI(){
  JFrame frame=new JFrame();
  JButton startButton=new JButton("Start");
  JButton stopButton=new JButton("Stop");
  JButton resetButton=new JButton("Reset");
  final JSlider gainSlider=new JSlider(0,1000);
  startButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      player.play();
    }
  }
);
  stopButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      player.pause();
    }
  }
);
  resetButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      player.close();
    }
  }
);
  gainSlider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      float gain=(float)gainSlider.getValue() / 1000.0F;
      player.setGain(gain);
    }
  }
);
  frame.setLayout(new FlowLayout());
  frame.add(startButton);
  frame.add(stopButton);
  frame.add(resetButton);
  frame.add(gainSlider);
  frame.pack();
  frame.setVisible(true);
}
 

Example 66

From project subsonic_1, under directory /subsonic-main/src/main/java/net/sourceforge/subsonic/service/jukebox/.

Source file: PlayerTest.java

  19 
vote

private void createGUI(){
  JFrame frame=new JFrame();
  JButton startButton=new JButton("Start");
  JButton stopButton=new JButton("Stop");
  JButton resetButton=new JButton("Reset");
  final JSlider gainSlider=new JSlider(0,1000);
  startButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      player.play();
    }
  }
);
  stopButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      player.pause();
    }
  }
);
  resetButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      player.close();
    }
  }
);
  gainSlider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      float gain=(float)gainSlider.getValue() / 1000.0F;
      player.setGain(gain);
    }
  }
);
  frame.setLayout(new FlowLayout());
  frame.add(startButton);
  frame.add(stopButton);
  frame.add(resetButton);
  frame.add(gainSlider);
  frame.pack();
  frame.setVisible(true);
}
 

Example 67

From project Supersonic, under directory /subsonic-main/src/main/java/net/sourceforge/subsonic/service/jukebox/.

Source file: PlayerTest.java

  19 
vote

private void createGUI(){
  JFrame frame=new JFrame();
  JButton startButton=new JButton("Start");
  JButton stopButton=new JButton("Stop");
  JButton resetButton=new JButton("Reset");
  final JSlider gainSlider=new JSlider(0,1000);
  startButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      player.play();
    }
  }
);
  stopButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      player.pause();
    }
  }
);
  resetButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      player.close();
    }
  }
);
  gainSlider.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent e){
      float gain=(float)gainSlider.getValue() / 1000.0F;
      player.setGain(gain);
    }
  }
);
  frame.setLayout(new FlowLayout());
  frame.add(startButton);
  frame.add(stopButton);
  frame.add(resetButton);
  frame.add(gainSlider);
  frame.pack();
  frame.setVisible(true);
}
 

Example 68

From project tiled-java, under directory /src/tiled/mapeditor/dialogs/.

Source file: ResizeDialog.java

  19 
vote

public void stateChanged(ChangeEvent e){
  Object source=e.getSource();
  if (source == offsetX || source == offsetY) {
    int dx=offsetX.intValue();
    int dy=offsetY.intValue();
    double zoom=orient.getZoom();
    orient.moveMap((int)(dx * currentMap.getTileWidth() * zoom),(int)(dy * currentMap.getTileHeight() * zoom));
  }
}
 

Example 69

From project tomighty, under directory /tomighty-swing/src/main/java/org/tomighty/ui/swing/.

Source file: CheckableFileField.java

  19 
vote

public CheckableFileField(){
  setLayout(new BorderLayout());
  JPanel south=new JPanel(new BorderLayout());
  south.add(filenameField=new JTextField(),CENTER);
  south.add(defaultButton=new JButton(),EAST);
  add(checkBox=new JCheckBox(),NORTH);
  add(south);
  filenameField.setEditable(false);
  filenameField.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  filenameField.addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent e){
      if (e.getButton() == MouseEvent.BUTTON1 && filenameField.isEnabled()) {
        chooseFile();
      }
    }
  }
);
  checkBox.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      updateFileSelectionState();
    }
  }
);
  defaultButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      file(null);
    }
  }
);
  updateFileSelectionState();
  file(null);
}
 

Example 70

From project TransFile, under directory /src/net/sourceforge/transfile/ui/swing/.

Source file: NetworkPanel.java

  19 
vote

/** 
 * TODO doc
 * @return <br>Not null <br>New
 */
private final PortSpinner createLocalPortSpinner(){
  final PortSpinner localPortSpinner=new PortSpinner();
  localPortSpinner.addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      onUserActionChangeLocalPort();
    }
  }
);
  return localPortSpinner;
}
 

Example 71

From project Twister, under directory /src/client/userinterface/java/src/.

Source file: MainPanel.java

  19 
vote

public MainPanel(boolean applet){
  InputMap map=getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
  KeyStroke keyStroke=KeyStroke.getKeyStroke(KeyEvent.VK_UP,InputEvent.CTRL_MASK,false);
  map.put(keyStroke,"DoNothing");
  Repository.intro.setStatus("Started Main initialization");
  Repository.intro.addPercent(0.035);
  Repository.intro.repaint();
  Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
  this.applet=applet;
  p1=new Panel1("",applet,(int)screenSize.getWidth());
  p2=new Panel2(applet);
  p4=new Panel4();
  setBounds(0,5,(int)screenSize.getWidth() - 50,672);
  addTab("Suites",new ImageIcon(),p1);
  addTab("Monitoring",p2);
  addTab("Reports",null);
  addTab("Configuration",p4);
  askForFile();
  if (applet) {
    addChangeListener(new ChangeListener(){
      public void stateChanged(      ChangeEvent e){
        if (getSelectedIndex() == 2) {
          try {
            Repository.window.container.getAppletContext().showDocument(new URL("http://" + Repository.host + ":"+ Repository.getHTTPServerPort()+ "/report/"+ Repository.getUser()),"_blank");
          }
 catch (          Exception ex) {
            ex.printStackTrace();
          }
          setSelectedIndex(1);
        }
      }
    }
);
  }
  Repository.intro.setStatus("Finished Main initialization");
  Repository.intro.addPercent(0.035);
  Repository.intro.repaint();
}
 

Example 72

From project uniquery, under directory /src/org/uniquery/gui/query/.

Source file: QueryTabbedPane.java

  19 
vote

public QueryTabbedPane(Gui parent){
  super();
  this.gui=parent;
  this.queryTabs=new ArrayList<QueryTab>();
  InfoTab welcomeTab=new InfoTab("Welcome");
  addTab(welcomeTab.getTitle(),welcomeTab);
  addChangeListener(new ChangeListener(){
    @Override public void stateChanged(    ChangeEvent e){
      Component selectedComponent=getSelectedComponent();
      MainMenuBar mainMenu=gui.getMainMenuBar();
      if (selectedComponent instanceof QueryTab) {
        QueryTab qt=(QueryTab)selectedComponent;
        boolean enabled=qt.queryFieldHasText();
        mainMenu.setFormatQueryItemEnabled(enabled);
        mainMenu.setExecuteQueryItemEnabled(enabled);
        mainMenu.setCloseQueryItemEnabled(true);
        mainMenu.setSaveQueryItemEnabled(enabled);
      }
 else {
        mainMenu.setCloseQueryItemEnabled(false);
        mainMenu.setFormatQueryItemEnabled(false);
        mainMenu.setExecuteQueryItemEnabled(false);
        mainMenu.setSaveQueryItemEnabled(false);
      }
    }
  }
);
}
 

Example 73

From project watchmaker, under directory /swing/src/java/main/org/uncommons/watchmaker/swing/.

Source file: NumericParameterControl.java

  19 
vote

public NumericParameterControl(T minimum,T maximum,T stepSize,T initialValue){
  this.defaultValue=initialValue;
  this.numberGenerator=new AdjustableNumberGenerator<T>(this.defaultValue);
  control=new JSpinner(new SpinnerNumberModel(initialValue,minimum,maximum,stepSize));
  control.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent changeEvent){
      @SuppressWarnings("unchecked") T value=(T)control.getValue();
      numberGenerator.setValue(value);
    }
  }
);
}