/** Listener to handle button actions */ public void actionPerformed(ActionEvent e) { // Check if the user changed the service filter option if (e.getSource() == service_box) { service_list.setEnabled(service_box.isSelected()); service_list.clearSelection(); remove_service_button.setEnabled(false); add_service_field.setEnabled(service_box.isSelected()); add_service_field.setText(""); add_service_button.setEnabled(false); } // Check if the user pressed the add service button if ((e.getSource() == add_service_button) || (e.getSource() == add_service_field)) { String text = add_service_field.getText(); if ((text != null) && (text.length() > 0)) { service_data.addElement(text); service_list.setListData(service_data); } add_service_field.setText(""); add_service_field.requestFocus(); } // Check if the user pressed the remove service button if (e.getSource() == remove_service_button) { Object[] sels = service_list.getSelectedValues(); for (int i = 0; i < sels.length; i++) { service_data.removeElement(sels[i]); } service_list.setListData(service_data); service_list.clearSelection(); } }
public void actionPerformed(ActionEvent e) { if (e.getSource() == m_findBt) { if (m_field.equals("employee")) { find(); } else if (m_PayrollPaychequeSubmitPanel != null) { PayrollPaychequeSubmitPanel(); } else if (m_PayrollMealAllowanceSubmitPanel != null) { PayrollMealAllowanceSubmitPanel(); } else if (m_PayrollOvertimeSubmitPanel != null) { PayrollOvertimeSubmitPanel(); } else if (m_PayrollTransportationAllowanceSubmitPanel != null) { PayrollTransportationAllowanceSubmitPanel(); } else if (m_RptFieldAllowances != null) { RptFieldAllowances(); } else if (m_RptPersonalUtilization != null) { RptPersonalUtilization(); } else if (m_PayrollInsuranceAllowanceSubmitPanel != null) { PayrollInsuranceAllowanceSubmitPanel(); } else if (m_PayrollOtherAllowanceSubmitPanel != null) { PayrollOtherAllowanceSubmitPanel(); } else if (m_PayrollTaxArt21SubmitPanel != null) { PayrollTaxArt21SubmitPanel(); } else if (m_PayrollTaxArt21VerificationPanel != null) { PayrollTaxArt21VerificationPanel(); } else if (m_payrollPaychequeVerificationPanel != null) { PayrollPaychequesVerivicationPanel(); } } else if (e.getSource() == m_closeBt) { if (m_panel != null) m_panel.m_show = false; dispose(); } else if (e.getSource() == m_clearBt) { m_table.clear(); } }
/** Listener to handle button actions */ public void actionPerformed(ActionEvent e) { // Check if the user pressed the ok button if (e.getSource() == ok_button) { filter_include_list = include_panel.getServiceList(); filter_exclude_list = exclude_panel.getServiceList(); if (status_box.isSelected()) { filter_active = status_active.isSelected(); filter_complete = status_complete.isSelected(); } else { filter_active = false; filter_complete = false; } ok_pressed = true; dialog.dispose(); } // Check if the user pressed the cancel button if (e.getSource() == cancel_button) { dialog.dispose(); } // Check if the user changed the status filter option if (e.getSource() == status_box) { status_active.setEnabled(status_box.isSelected()); status_complete.setEnabled(status_box.isSelected()); } }
public void actionPerformed(ActionEvent e) { if (e.getSource() == enableDefaultEncryption) { loadStates(); } else if (e.getSource() == cmdExpandAdvancedSettings) { pnlAdvancedSettings.setVisible(!pnlAdvancedSettings.isVisible()); } }
/** * Invoked when an action occurs. * * @param e ActionEvent * @todo Implement this java.awt.event.ActionListener method */ public void actionPerformed(ActionEvent e) { try { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); if (e.getSource() == addButton) { processAddEvent(); } else if (e.getSource() == editButton) { processEditEvent(); } else if (e.getSource() == delButton) { processDeleteEvent(); } processTaskTable(); } finally { setCursor(Cursor.getDefaultCursor()); } }
public void actionPerformed(ActionEvent e) { JMenuItem jmi = (JMenuItem) e.getSource(); Iterator marks = mediator.getMarkerModel().getMarkersWithLabel(jmi.getText()); if (marks.hasNext()) { ChronicleMarker marker = (ChronicleMarker) marks.next(); Instant to = marker.getWhen(); Instant from = mediator.getMajorMoment(); viper.api.impl.Util.shiftDescriptors(new Descriptor[] {desc}, from, to); } }
@Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == b1) { int index = box.getSelectedIndex(); String column = ""; if (index == 0) column = "ename"; else if (index == 1) column = "hiredate"; else column = "deptno"; String data = tf.getText().trim(); if (data.length() < 1) { tf.requestFocus(); return; } getFindData(column, data); } if (e.getSource() == b2) { getData(); } }
public void actionPerformed(ActionEvent e) { Iterator toInterp = Collections.singleton(desc).iterator(); JMenuItem jmi = (JMenuItem) e.getSource(); Iterator marks = mediator.getMarkerModel().getMarkersWithLabel(jmi.getText()); if (marks.hasNext()) { ChronicleMarker marker = (ChronicleMarker) marks.next(); Instant to = marker.getWhen(); Instant from = mediator.getMajorMoment(); mediator.getPropagator().interpolateDescriptors(toInterp, from, to); } }
/** Listener to handle button actions */ public void actionPerformed(ActionEvent e) { // Check if the user pressed the remove button if (e.getSource() == remove_button) { int row = table.getSelectedRow(); model.removeRow(row); table.clearSelection(); table.repaint(); valueChanged(null); } // Check if the user pressed the remove all button if (e.getSource() == remove_all_button) { model.clearAll(); table.setRowSelectionInterval(0, 0); table.repaint(); valueChanged(null); } // Check if the user pressed the filter button if (e.getSource() == filter_button) { filter.showDialog(); if (filter.okPressed()) { // Update the display with new filter model.setFilter(filter); table.repaint(); } } // Check if the user pressed the start button if (e.getSource() == start_button) { start(); } // Check if the user pressed the stop button if (e.getSource() == stop_button) { stop(); } // Check if the user wants to switch layout if (e.getSource() == layout_button) { details_panel.remove(details_soap); details_soap.removeAll(); if (details_soap.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) { details_soap = new JSplitPane(JSplitPane.VERTICAL_SPLIT); } else { details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); } details_soap.setTopComponent(request_panel); details_soap.setRightComponent(response_panel); details_soap.setResizeWeight(.5); details_panel.add(details_soap, BorderLayout.CENTER); details_panel.validate(); details_panel.repaint(); } // Check if the user is changing the reflow option if (e.getSource() == reflow_xml) { request_text.setReflowXML(reflow_xml.isSelected()); response_text.setReflowXML(reflow_xml.isSelected()); } }
public void actionPerformed(ActionEvent e) { if (!this.isEnabled()) { return; } if (NEW_AIRSPACE.equals(e.getActionCommand())) { this.createNewEntry(this.getView().getSelectedFactory()); } else if (CLEAR_SELECTION.equals(e.getActionCommand())) { this.selectEntry(null, true); } else if (SIZE_NEW_SHAPES_TO_VIEWPORT.equals(e.getActionCommand())) { if (e.getSource() instanceof AbstractButton) { boolean selected = ((AbstractButton) e.getSource()).isSelected(); this.setResizeNewShapesToViewport(selected); } } else if (ENABLE_EDIT.equals(e.getActionCommand())) { if (e.getSource() instanceof AbstractButton) { boolean selected = ((AbstractButton) e.getSource()).isSelected(); this.setEnableEdit(selected); } } else if (OPEN.equals(e.getActionCommand())) { this.openFromFile(); } else if (OPEN_URL.equals(e.getActionCommand())) { this.openFromURL(); } else if (OPEN_DEMO_AIRSPACES.equals(e.getActionCommand())) { this.openFromPath(DEMO_AIRSPACES_PATH); this.zoomTo( LatLon.fromDegrees(47.6584074779224, -122.3059199579634), Angle.fromDegrees(-152), Angle.fromDegrees(75), 750); } else if (REMOVE_SELECTED.equals(e.getActionCommand())) { this.removeEntries(Arrays.asList(this.getSelectedEntries())); } else if (SAVE.equals(e.getActionCommand())) { this.saveToFile(); } else if (SELECTION_CHANGED.equals(e.getActionCommand())) { this.viewSelectionChanged(); } }
/** * * Each non abstract class that implements the ActionListener must have this method. * * @param e the action event. */ public void actionPerformed(ActionEvent e) { if (e.getSource() == submitButton) { int result = submit(); if (result == 0) { JOptionPane.showMessageDialog( this, "Fehler: Produktgruppe " + produktgruppeFormular.nameField.getText() + " konnte nicht eingefügt werden.", "Fehler", JOptionPane.ERROR_MESSAGE); } else { produktgruppenListe.updateAll(); closeButton.doClick(); } return; } super.actionPerformed(e); }
public void actionPerformed(ActionEvent e) { JButton b = (JButton) e.getSource(); if (b == bu) { j14 = new JLabel("NEW IMAGE"); j14.setBounds(840, 200, 300, 300); q.add(j14); JFileChooser filechooser = new JFileChooser(); int result = filechooser.showOpenDialog(this); f = filechooser.getSelectedFile(); try { String dir1 = f.getAbsolutePath(); // setText(dir); str = dir1; // ResizeImage.resize(dir); f = new File(dir1); } catch (Exception e1) { } repaint(); // b=(JButton)e.getSource(); } if (b == ba) { try { read(); patient.add(tadd.getText(), tsym.getText(), f, str); JOptionPane.showMessageDialog(null, "Patient ID: " + patient.pid + " Record Added"); } catch (Exception e4) { System.out.println("" + e4); } } if (b == bm) { try { setVisible(false); } catch (Exception e4) { System.out.println("" + e4); } } }
// {{{ actionPerformed() method public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); if (source == ok) { ok(); } else if (source == cancel) { cancel(); } else if (source == clear) { sortTableModel.clear(); } else if (source == help) { showHelp(); } /* else if(source == delDupsCheckBox) { if (delDupsCheckBox.isSelected()) dontSortCheckBox.setEnabled(true); else { dontSortCheckBox.setEnabled(false); dontSortCheckBox.setSelected(false); } } */ } // }}}
/** Reaction to buttons and combo boxes. */ public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); if (cmdCtrlProp.equals(cmd)) { try { Class c = Class.forName("aurora.hwc.control.Panel" + myController.getClass().getSimpleName()); AbstractPanelController cp = (AbstractPanelController) c.newInstance(); cp.initialize(myController, null); } catch (Exception ex) { } } if (cmdCtrlList.equals(cmd)) { JComboBox cb = (JComboBox) e.getSource(); if (cb.getSelectedIndex() > 0) { myController = (AbstractControllerComplex) listCControllers.getSelectedItem(); buttonProp.setEnabled(true); } else { buttonProp.setEnabled(false); myController = null; } myMonitor.setMyController(myController); } return; }
/** @param e It is the type of action event the user pursues. */ public void actionPerformed(ActionEvent e) { if (e.getSource() == apply) apply(); else if (e.getSource() == close) close(); }
@Override public void actionPerformed(ActionEvent axnEve) { Object obj = axnEve.getSource(); if (obj == selectAllCB) { Boolean state; if (selectAllCB.isSelected()) { state = true; deleteBut.setVisible(true); if (Home.titlePan.getTitle().equals("Trash")) { restoreBut.setVisible(true); } } else { state = false; deleteBut.setVisible(false); if (Home.titlePan.getTitle().equals("Trash")) { restoreBut.setVisible(false); } } for (int i = 0; i < table.getRowCount(); i++) { table.setValueAt(state, i, 0); } } else if (obj == refreshBut || obj == backBut) { setContent(Home.titlePan.getTitle()); backBut.setVisible(false); } else if (obj == deleteBut) { ArrayList selectedMessages = getSelectedMessages(); if (selectedMessages.isEmpty()) { FootPan.setMessage(FootPan.NO_SELECTION_MESSAGE); } else { int option = JOptionPane.showConfirmDialog( Home.home.homeFrame, "Are You Sure?", "DELETE", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (option == 0) { Database.deleteMessages(selectedMessages, Home.titlePan.getTitle()); setContent(Home.titlePan.getTitle()); } } } else if (obj == restoreBut) { ArrayList selectedMessages = getSelectedMessages(); if (selectedMessages.isEmpty()) { FootPan.setMessage(FootPan.NO_SELECTION_MESSAGE); } else { int option = JOptionPane.showConfirmDialog( Home.home.homeFrame, "Are You Sure?", "RESTORE", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (option == 0) { Database.restoreMessages(selectedMessages); setContent(Home.titlePan.getTitle()); } } } }