Java Code Examples for java.awt.event.ItemEvent#getItemSelectable()

The following examples show how to use java.awt.event.ItemEvent#getItemSelectable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VulcanTab.java    From FoxTelem with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	super.itemStateChanged(e);
	Object source = e.getItemSelectable();
	
	if (source == showRawValues) { //updateProperty(e, decoder.flipReceivedBits); }

		if (e.getStateChange() == ItemEvent.DESELECTED) {
			Config.displayRawValues = false;
		} else {
			Config.displayRawValues = true;
		}
		Config.save();
		updateTab(Config.payloadStore.getLatestRadTelem(foxId), true);
		
	}
	
}
 
Example 2
Source File: UwExperimentTab.java    From FoxTelem with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	super.itemStateChanged(e);
	Object source = e.getItemSelectable();

	if (source == showRawValues) { //updateProperty(e, decoder.flipReceivedBits); }

		if (e.getStateChange() == ItemEvent.DESELECTED) {
			Config.displayRawValues = false;
		} else {
			Config.displayRawValues = true;
		}
		Config.save();
		//			for (BitArrayLayout lay : layout)
		//				updateTab(Config.payloadStore.getLatest(foxId, lay.name), true);

		updateTab(Config.payloadStore.getLatest(foxId, Spacecraft.CAN_LAYOUT), true);

		//updateTab(Config.payloadStore.getLatestRad(foxId), true);  // we don't have RAD2 conversion for the Experiment Payloads so just get RAD.

	}
}
 
Example 3
Source File: ExperimentTab.java    From FoxTelem with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	super.itemStateChanged(e);
	Object source = e.getItemSelectable();
	
	if (source == showRawBytes) { //updateProperty(e, decoder.flipReceivedBits); }

		if (e.getStateChange() == ItemEvent.DESELECTED) {
			Config.displayRawRadData = false;
		} else {
			Config.displayRawRadData = true;
		}
		if (showRawBytes.isSelected()) {
			packetScrollPane.setVisible(false); 
			scrollPane.setVisible(true);
		} else { 
			packetScrollPane.setVisible(true);
			scrollPane.setVisible(false);
		}

		parseRadiationFrames();
		Config.save();
	}
}
 
Example 4
Source File: HerciLSTab.java    From FoxTelem with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	super.itemStateChanged(e);
	Object source = e.getItemSelectable();

	if (source == showRawValues) { //updateProperty(e, decoder.flipReceivedBits); }

		if (e.getStateChange() == ItemEvent.DESELECTED) {
			Config.displayRawValues = false;
		} else {
			Config.displayRawValues = true;
		}
		Config.save();
		updateTab(Config.payloadStore.getLatestRadTelem(foxId), true);
		
	}
}
 
Example 5
Source File: CameraTab.java    From FoxTelem with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	Object source = e.getItemSelectable();
	
	if (source == showLatestImage) { //updateProperty(e, decoder.flipReceivedBits); }

		if (e.getStateChange() == ItemEvent.DESELECTED) {
			Config.showLatestImage = false;
		} else {
			Config.showLatestImage = true;
		}
		Config.save();
		
	}

	
}
 
Example 6
Source File: HerciHSTab.java    From FoxTelem with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	super.itemStateChanged(e);
	Object source = e.getItemSelectable();

	if (source == showRawValues) { //updateProperty(e, decoder.flipReceivedBits); }
		if (e.getStateChange() == ItemEvent.DESELECTED) {
			Config.displayRawValues = false;
		} else {
			Config.displayRawValues = true;
		}
		Config.save();
		if (hsHeader != null) {
			updateTab(hsHeader, false);
		}
		
	}

}
 
Example 7
Source File: JAtomQueryFeatureDialog.java    From openchemlib-js with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public void itemStateChanged(ItemEvent e) {
if (e.getItemSelectable() == mCBAny) {
	if (mCBAny.isSelected()) {
		mTFAtomList.setText("");
		mLabelAtomList.setText("excluded atoms:");
		}
	else {
		mTFAtomList.setText(mMol.getAtomLabel(mAtom));
		mLabelAtomList.setText("allowed atoms:");
		}
	}
else if (e.getItemSelectable() == mCBBlocked && e.getStateChange() == ItemEvent.SELECTED) {
	mCBSubstituted.setSelected(false);
	mChoiceNeighbours.setSelectedIndex(0);
    }
else if (e.getItemSelectable() == mCBSubstituted && e.getStateChange() == ItemEvent.SELECTED)
	mCBBlocked.setSelected(false);
}
 
Example 8
Source File: ExtraPanel.java    From megamek with GNU General Public License v2.0 6 votes vote down vote up
public void itemStateChanged(ItemEvent ev) {
    ClientGUI clientgui = unitDisplay.getClientGUI();
    if (clientgui == null) {
        return;
    }
    // Only act when a new item is selected
    if (ev.getStateChange() != ItemEvent.SELECTED) {
        return;
    }
    if ((ev.getItemSelectable() == chSensors)) {
        int sensorIdx = chSensors.getSelectedIndex();
        Entity en = clientgui.getClient().getGame().getEntity(myMechId);
        Sensor s = en.getSensors().elementAt(sensorIdx);
        en.setNextSensor(s);
        refreshSensorChoices(en);
        String sensorMsg = Messages.getString(
                "MechDisplay.willSwitchAtEnd", new Object[] { //$NON-NLS-1$
                        "Active Sensors", s.getDisplayName() }); //$NON-NLS-1$
        clientgui.systemMessage(sensorMsg);
        clientgui.getClient().sendSensorChange(myMechId, sensorIdx);
    }
}
 
Example 9
Source File: ModuleTab.java    From FoxTelem with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	Object source = e.getItemSelectable();
	
	if (source == cbUTC) {
		showUTCtime = !showUTCtime;
		if (showUTCtime) {
			parseTextFields();
			//textToUtc.setText();
			
			if (SAMPLES > MAX_SAMPLES) {
				SAMPLES = MAX_SAMPLES;
			}
			txtSamplePeriod.setText(Integer.toString(SAMPLES));
			
		} else {
			parseUTCFields();
			if (SAMPLES > MAX_SAMPLES) {
				SAMPLES = MAX_SAMPLES;
			}
			txtSamplePeriod.setText(Integer.toString(SAMPLES));
		}
		showUptimeQuery(!showUTCtime);
		Config.displayUTCtime = showUTCtime;
		Config.save();
	}
	
}
 
Example 10
Source File: Find.java    From pdfxtk with Apache License 2.0 5 votes vote down vote up
public void itemStateChanged(ItemEvent e) {
   if(e.getItemSelectable() == sortorder) {
     FieldLine field = (FieldLine)sortorder.getSelectedInfo();
     sortRemove(field.field.name);
     sortAdd(field, 0);
     Object[] infos = sortorder.getInfos();
     for(int i = 0; i < infos.length; i++)
((FieldLine)infos[i]).set();
   }
   else {
     callFindListeners();
     relop = and_or.getSelectedIndex() == 0 ? Proxy.AND : Proxy.OR;
   }
 }
 
Example 11
Source File: CopyNewickForOpenTree.java    From MesquiteCore with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void itemStateChanged(ItemEvent e){

		for (int i=0; i<nodeAssociatedLabels.length; i++) {
			if (e.getItemSelectable() == nodeAssociatedLabels[i]){  //we have clicked on one
				if (nodeAssociatedLabels[i].getState()) {  // this one is on, need to turn the rest off
					for (int j=0; j<nodeAssociatedLabels.length; j++) {
						if (i!=j)
							nodeAssociatedLabels[j].setState(false);
					}
				}
			}
		}

	}
 
Example 12
Source File: ValueFunctionVisualizerGUI.java    From burlap with Apache License 2.0 5 votes vote down vote up
/**
 * Called when the check back for the policy rendering is checked or unchecked.
 */
public void itemStateChanged(ItemEvent e) {

    Object source = e.getItemSelectable();
    if(source == this.showPolicy){
    	if(this.showPolicy.isSelected()){
    		this.pLayer.setSpp(spp);
    	}
    	else{
    		this.pLayer.setSpp(null);
    	}
    	this.visualizer.repaint();
    }
    
}
 
Example 13
Source File: PlanManager.java    From cropplanning with GNU General Public License v3.0 5 votes vote down vote up
public void itemStateChanged(ItemEvent e) {
  Object source = e.getItemSelectable();

  if ( source == rdoBlank ) {
    cmbPlans.setEnabled(false);
    chkLockOld.setEnabled(false);
  }
  else if ( source == rdoBasedOn ) {
    cmbPlans.setEnabled(true);
    chkLockOld.setEnabled(true);
  }
}
 
Example 14
Source File: SampleCompilationManagerDialog.java    From ET_Redux with Apache License 2.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
    Object source = e.getItemSelectable();
    sourceFolder_jRadioButton.setEnabled(automaticFractionCreation);
    sourceSingle_jRadioButton.setEnabled(automaticFractionCreation);
    sourceGeochron_jRadioButton.setEnabled(automaticFractionCreation);

}
 
Example 15
Source File: BasicSearchForm.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
    ItemSelectable is = e.getItemSelectable();
    if (is == matchCase) {
        matchCaseChanged();
    } else if (is == textToFindType) {
        regexpChanged();
    }
}
 
Example 16
Source File: HealthTab.java    From FoxTelem with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	super.itemStateChanged(e);
	Object source = e.getItemSelectable();
	
	if (source == showRawValues) { //updateProperty(e, decoder.flipReceivedBits); }

		if (e.getStateChange() == ItemEvent.DESELECTED) {
			Config.displayRawValues = false;
		} else {
			Config.displayRawValues = true;
		}
		Config.save();
		if (realTime != null)
			updateTabRT(realTime, false);
		if (maxPayload != null)
			updateTabMax(maxPayload);
		if (minPayload != null)
			updateTabMin(minPayload);
	}
	
	if (source == cbUTC) {
		if (realTime != null)
			updateTabRT(realTime, false);
		if (maxPayload != null)
			updateTabMax(maxPayload);
		if (minPayload != null)
			updateTabMin(minPayload);
		//parseFrames();
	}
	
}
 
Example 17
Source File: Transfer.java    From evosql with Apache License 2.0 5 votes vote down vote up
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
 
Example 18
Source File: CommonSettingsDialog.java    From megamek with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Handle the player clicking checkboxes. <p/> Implements the
 * <code>ItemListener</code> interface.
 *
 * @param event - the <code>ItemEvent</code> that initiated this call.
 */
public void itemStateChanged(ItemEvent event) {
    Object source = event.getItemSelectable();
    GUIPreferences guip = GUIPreferences.getInstance();
    if (source.equals(keepGameLog)) {
        gameLogFilename.setEnabled(keepGameLog.isSelected());
        stampFormatLabel.setEnabled(stampFilenames.isSelected());
        gameLogFilenameLabel.setEnabled(keepGameLog.isSelected());
        // gameLogMaxSize.setEnabled(keepGameLog.isSelected());
    } else if (source.equals(stampFilenames)) {
        stampFormat.setEnabled(stampFilenames.isSelected());
        stampFormatLabel.setEnabled(stampFilenames.isSelected());
    } else if (source.equals(fovInsideEnabled)) {
        guip.setFovHighlight(fovInsideEnabled.isSelected());
        if ((clientgui != null) && (clientgui.bv != null)) {
            clientgui.bv.clearHexImageCache();
            clientgui.bv.repaint();
        }
        fovHighlightAlpha.setEnabled(fovInsideEnabled.isSelected());
        fovHighlightRingsRadii.setEnabled(fovInsideEnabled.isSelected());
        fovHighlightRingsColors.setEnabled(fovInsideEnabled.isSelected());
        fovHighlightRingsColorsLabel.setEnabled(fovInsideEnabled.isSelected());
        fovHighlightRingsRadiiLabel.setEnabled(fovInsideEnabled.isSelected());
        highlightAlphaLabel.setEnabled(fovInsideEnabled.isSelected());
    } else if (source.equals(fovOutsideEnabled)) {
        guip.setFovDarken(fovOutsideEnabled.isSelected());
        if ((clientgui != null) && (clientgui.bv != null)) {
            clientgui.bv.clearHexImageCache();
            clientgui.bv.repaint();
        }
        fovDarkenAlpha.setEnabled(fovOutsideEnabled.isSelected());
        numStripesSlider.setEnabled(fovOutsideEnabled.isSelected());
        darkenAlphaLabel.setEnabled(fovOutsideEnabled.isSelected());
        numStripesLabel.setEnabled(fovOutsideEnabled.isSelected());
        fovGrayscaleEnabled.setEnabled(fovOutsideEnabled.isSelected());
    } else if (source.equals(fovGrayscaleEnabled)) {
        guip.setFovGrayscale(fovGrayscaleEnabled.isSelected());
        if ((clientgui != null) && (clientgui.bv != null)) {
            clientgui.bv.clearHexImageCache();
            clientgui.bv.repaint();
        }
    } else if (source.equals(aOHexShadows)) {
        guip.setAOHexShadows(aOHexShadows.isSelected());
        if ((clientgui != null) && (clientgui.bv != null)) {
            clientgui.bv.clearHexImageCache();
            clientgui.bv.repaint();
        }
    } else if (source.equals(shadowMap)) {
        guip.setShadowMap(shadowMap.isSelected());
        if ((clientgui != null) && (clientgui.bv != null)) {
            clientgui.bv.clearHexImageCache();
            clientgui.bv.repaint();
        }
    } else if (source.equals(levelhighlight)) {
        guip.setLevelHighlight(levelhighlight.isSelected());
        if ((clientgui != null) && (clientgui.bv != null)) {
            clientgui.bv.clearHexImageCache();
            clientgui.bv.repaint();
        }
    } else if (source.equals(floatingIso)) {
        guip.setFloatingIso(floatingIso.isSelected());
        if ((clientgui != null) && (clientgui.bv != null)) {
            clientgui.bv.clearHexImageCache();
            clientgui.bv.repaint();
        }
    } else if (source.equals(mmSymbol)) {
        guip.setMmSymbol(mmSymbol.isSelected());
        if ((clientgui != null) && (clientgui.minimap != null)) {
            clientgui.minimap.drawMap();
        }

    }
}
 
Example 19
Source File: SettingsFrame.java    From FoxTelem with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	Object source = e.getItemSelectable();

	if (source == cbUploadToServer) { 
		if (e.getStateChange() == ItemEvent.DESELECTED) {
			setServerPanelEnabled(false);
		} else {
			setServerPanelEnabled(true);
		}
	}
	
	if (source == cbUseDDEAzEl) { 
		if (e.getStateChange() == ItemEvent.SELECTED) {
			cbFoxTelemCalcsPosition.setSelected(false);
			cbFoxTelemCalcsDoppler.setSelected(false);
		}
	}
	
	if (source == cbFoxTelemCalcsPosition) { 
		if (e.getStateChange() == ItemEvent.SELECTED) {
			cbUseDDEAzEl.setSelected(false);
			cbFoxTelemCalcsDoppler.setEnabled(true);
		} else {
			if (cbWhenAboveHorizon.isSelected())
				cbWhenAboveHorizon.setSelected(false);
			if (cbFoxTelemCalcsDoppler.isSelected())
				cbFoxTelemCalcsDoppler.setSelected(false);
			cbFoxTelemCalcsDoppler.setEnabled(false);
		}
	}
	if (source == cbFoxTelemCalcsDoppler) { 
		if (e.getStateChange() == ItemEvent.SELECTED) {
			rdbtnTrackSignal.setSelected(false);
		} else {
		}
	}
	if (source == cbWhenAboveHorizon) { 
		if (e.getStateChange() == ItemEvent.SELECTED) {
			if (!cbFoxTelemCalcsPosition.isSelected() && !cbUseDDEAzEl.isSelected())
				cbFoxTelemCalcsPosition.setSelected(true);
			MainWindow.inputTab.rdbtnFindSignal.setSelected(true);
		}
		
	}
	if (e.getSource() == rdbtnTrackSignal) {
		if (e.getStateChange() == ItemEvent.DESELECTED) {
            Config.findSignal=false;
            //Config.save();
        } else {
        	Config.findSignal=true;
        	cbFoxTelemCalcsDoppler.setSelected(false);
        	//Config.save();
        }
	}
}
 
Example 20
Source File: CropDBCropInfo.java    From cropplanning with GNU General Public License v3.0 3 votes vote down vote up
public void itemStateChanged ( ItemEvent arg0 ) {

      Object source = arg0.getItemSelectable();

      if ( source == chkDS )
         setDSComponentsEnabled( chkDS.isSelected() );
      else if ( source == chkTP )
         setTPComponentsEnabled( chkTP.isSelected() );

   }