List of usage examples for java.awt.event ActionEvent getSource
public Object getSource()
From source file:com.enderville.enderinstaller.ui.Installer.java
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == getNextButton()) { advanceStep();/* w w w.j a v a 2 s . co m*/ } else if (e.getSource() == getCancelButton()) { setVisible(false); dispose(); } else if (e.getSource() == getPresetDropdown()) { loadPreset(getPresetDropdown().getSelectedItem().toString()); } else if (e.getSource() == getTargetButton()) { chooseTargetMinecraftFolder(); } }
From source file:Main_Window.java
@Override public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); if (Retrieve_POIs_Button == source) { //Do Checks if (Connectivity_Checker()) { if (Blank_Fileds_Checker()) { if (Validility_Fields_Checker()) { if (Open_Status_Checker()) { Send_Receive_Data_Google_Service(true); } else { Send_Receive_Data_Google_Service(false); }//from w w w .j a v a2s. c o m } } } } }
From source file:com.neurotec.samples.panels.EnrollFromScanner.java
@Override public void actionPerformed(ActionEvent ev) { try {//ww w . j av a 2s . c o m if (ev.getSource() == btnRefresh) { updateScannerList(); } else if (ev.getSource() == btnScan) { startCapturing(); } else if (ev.getSource() == btnCancel) { cancelCapturing(); } else if (ev.getSource() == btnForce) { FingersTools.getInstance().getClient().force(); } else if (ev.getSource() == btnIdentifyPatient) { identifyPatient(); } else if (ev.getSource() == cbShowProcessed) { updateShownImage(); } else if (ev.getSource() == btnRegisterPatient) { String template = DatatypeConverter.printBase64Binary(subject.getTemplateBuffer().toByteArray()); service.callRegisterPatientJavaScriptFunction(template); } } catch (Exception e) { e.printStackTrace(); JOptionPane.showMessageDialog(this, e.toString(), "Error", JOptionPane.ERROR_MESSAGE); } }
From source file:javaresturentdesktopclient.PreviousBillInfo.java
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed // TODO add your handling code here: int index; Integer index;//from ww w. jav a2 s. c o m index = ((JComboBox) evt.getSource()).getSelectedIndex(); Month = MonthId[index]; }
From source file:com.net2plan.gui.GUINet2Plan.java
@Override public void actionPerformed(ActionEvent e) { try {//from www . ja v a2 s . c om if (!(e.getSource() instanceof JMenuItem)) throw new RuntimeException("Bad"); JMenuItem item = (JMenuItem) e.getSource(); if (item.equals(optionsItem)) { JDialog dialog = new GUIConfiguration(); dialog.setVisible(true); } else if (item.equals(errorConsoleItem)) { ErrorHandling.showConsole(); } else if (item.equals(classPathEditorItem)) { ClassPathEditor.showGUI(); } else if (item.equals(keyCombinationItem)) { showKeyCombinations(); } else if (item.equals(exitItem)) { askForClose(); } else if (item.equals(helpItem)) { loadHelp(); } else if (item.equals(javadocItem)) { loadJavadocLib(); } else if (item.equals(javadocExamplesItem)) { loadExamples(); } else { Object object = itemObject.get(item); WindowUtils.setWindowLeftSide(instance); if (object != null) { if (object instanceof Class) { Object classInstance = ((Class) object).newInstance(); if (classInstance instanceof IGUIModule) { IGUIModule module = (IGUIModule) classInstance; module.start(); object = module; } } if (object instanceof JPanel) { container.removeAll(); container.add((JPanel) object, "grow"); container.revalidate(); container.updateUI(); } } } } catch (Throwable ex) { ErrorHandling.addErrorOrException(ex, GUINet2Plan.class); ErrorHandling.showErrorDialog("Unable to execute option"); } }
From source file:net.aepik.alasca.gui.ldap.SchemaObjectEditorFrame.java
/** * Gre les actions de la vue et permet de modifier les donnes. * @param e L'action souleve par un lment du panel. *///from www . j a va2s . c o m public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o == boutonOk) { if (this.checkNoBlankValues()) { this.saveValues(); this.windowClosing(null); this.schema.notifyUpdates(true); } else { JOptionPane.showMessageDialog(this, "Impossible de spcifier des valeurs nulles", "Erreur", JOptionPane.ERROR_MESSAGE); } } else if (o == boutonAnnuler) { this.windowClosing(null); } }
From source file:edu.ku.brc.af.ui.forms.formatters.DataObjFieldFormatDlg.java
/** * /* ww w . j a v a2 s .c o m*/ */ protected void addDisplayTypeRadioButtonListeners() { ActionListener displayTypeRadioBtnL = new ActionListener() { public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof JRadioButton) { JRadioButton btn = (JRadioButton) e.getSource(); // boolean hasChanged = (dataObjFormatter.isSingle() && btn != singleDisplayBtn) || // (!dataObjFormatter.isSingle() && btn == singleDisplayBtn); dataObjFormatter.setSingle(btn == singleDisplayBtn); if (btn == singleDisplayBtn) { // single editing panel selected fmtSingleEditingPanel.setHasChanged(true); } else { // multiple editing panel selected fmtMultipleEditingPanel.setHasChanged(true); } setVisibleFormatPanel(btn); } } }; singleDisplayBtn.addActionListener(displayTypeRadioBtnL); multipleDisplayBtn.addActionListener(displayTypeRadioBtnL); }
From source file:iDynoOptimizer.MOEAFramework26.src.org.moeaframework.analysis.diagnostics.ApproximationSetViewer.java
@Override public void actionPerformed(ActionEvent e) { if ((e.getSource() == xAxisSelection) || (e.getSource() == yAxisSelection)) { initialRangeBounds = null;/*from ww w . j a va 2 s. c om*/ initialDomainBounds = null; initializeReferenceSetBounds(); } update(); }
From source file:kg.apc.jmeter.vizualizers.SynthesisReportGui.java
@Override public void actionPerformed(ActionEvent ev) { if (ev.getSource() == saveTable) { JFileChooser chooser = FileDialoger.promptToSaveFile("synthesis.csv"); if (chooser == null) { return; }//from w w w . jav a 2s .co m FileWriter writer = null; try { writer = new FileWriter(chooser.getSelectedFile()); // TODO // Charset ? CSVSaveService.saveCSVStats(getAllTableData(model, FORMATS), writer, saveHeaders.isSelected() ? getLabels(COLUMNS) : null); } catch (FileNotFoundException e) { log.warn(e.getMessage()); } catch (IOException e) { log.warn(e.getMessage()); } finally { JOrphanUtils.closeQuietly(writer); } } }
From source file:com.vgi.mafscaling.LogPlay.java
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == newPlayButton) createPlayTable();// ww w. j av a2s .c o m else if (e.getSource() == playButton) { if (playing) pause(); else play(); } else if (e.getSource() == rewButton) { rewind(); } else if (e.getSource() == ffwButton) { forward(); } else if (e.getSource() == stopButton) { stop(); } else if (e.getSource() == showIntepCells) { setShowInterpolationCells(); } else if (e.getSource() == showSignifCells) { setShowSignificantCell(); } else if (e.getSource() == showTraceLine) { setShowTraceLine(); } else if (e.getSource() == showTraceMarker) { showMarker = showTraceMarker.isSelected(); } }