Example usage for java.awt.event ActionEvent getSource

List of usage examples for java.awt.event ActionEvent getSource

Introduction

In this page you can find the example usage for java.awt.event ActionEvent getSource.

Prototype

public Object getSource() 

Source Link

Document

The object on which the Event initially occurred.

Usage

From source file:com.mirth.connect.client.ui.SettingsPanelResources.java

private void typeComboBoxActionPerformed(ActionEvent evt) {
    JComboBox comboBox = (JComboBox) evt.getSource();
    if (comboBox.isPopupVisible()) {
        int selectedRow = resourceTable.getSelectedRow();
        if (selectedRow >= 0) {
            String type = (String) comboBox.getSelectedItem();

            if (propertiesPanelMap.containsKey(type)) {
                changePropertiesPanel(type);
                ResourceProperties properties = currentPropertiesPanel.getDefaults();
                resourceTable.getModel().setValueAt(properties, selectedRow, PROPERTIES_COLUMN);
                currentPropertiesPanel.setProperties(properties);
                getFrame().setSaveEnabled(true);
            }/*w ww  .jav a  2  s.c  o  m*/
        }
    }
}

From source file:com.projity.pm.graphic.chart.ChartLegend.java

void initControls() {
    chartInfo.setAxisPanel(new AxisPanel(chartInfo));
    filterComboBox = new TransformComboBox(null, MenuActionConstants.ACTION_CHOOSE_FILTER,
            TransformComboBoxModel.FILTER);
    filterComboBox.setView(ViewConfiguration.getView(MenuActionConstants.ACTION_CHARTS));
    filterComboBox.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (chartInfo.isRestoring())
                return;
            TransformComboBox combo = (TransformComboBox) e.getSource();
            CommonTransformFactory factory = (CommonTransformFactory) combo.getSelectedItem();
            ((TransformComboBoxModel) combo.getModel()).changeTransform(factory);
        }//from  www . j a v a 2 s  . co  m
    });

    initTree();
    Object[] fields = getFields(false);

    workTraces = getListInstance(false);
    tracesList = workTraces; // start off work
    tracesScrollPane = new JScrollPane(workTraces);
    workTraces.setVisibleRowCount(Environment.getStandAlone() ? HasTimeDistributedData.tracesCount
            : HasTimeDistributedData.serverTracesCount);

    //      final ViewTransformer transformer=ViewConfiguration.getView(MenuActionConstants.ACTION_CHARTS).getTransform();
    //      final ResourceInTeamFilter hiddenFilter=(ResourceInTeamFilter)transformer.getHiddenFilter();      
    //      teamResources= new JCheckBox(Messages.getString("Text.ShowTeamResourcesOnly"));
    //      teamResources.addItemListener(new ItemListener() {
    //         public void itemStateChanged(ItemEvent e) {
    //            hiddenFilter.setFilterTeam(e.getStateChange() == ItemEvent.SELECTED);
    //            transformer.update();
    //         }
    //      });
    //      teamResources.setSelected(hiddenFilter.isFilterTeam());

    if (simple) {
        chartInfo.setTraces(fields);
        tree.getSelectionModel().setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); // allow only 1 for histogram

        selectedOnTop = new JCheckBox(Messages.getString("Text.ShowSelectedOnTop")); //$NON-NLS-1$
        selectedOnTop.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {

                chartInfo.setSelectedOnTop(e.getStateChange() == ItemEvent.SELECTED);
                Object[] traces = getFields(false);
                chartInfo.setTraces(traces);
                workTraces = getListInstance(false);
                tracesScrollPane.getViewport().add(workTraces);
                workTraces.setVisibleRowCount(Environment.getStandAlone() ? HasTimeDistributedData.tracesCount
                        : HasTimeDistributedData.serverTracesCount);
            }
        });
        selectedOnTop.setSelected(chartInfo.isSelectedOnTop()); // start off as histogram

        return;
    }

    costTraces = getListInstance(true);
    cumulative = new JCheckBox(Messages.getString("Text.Cumulative")); //$NON-NLS-1$
    cumulative.setSelected(chartInfo.isCumulative()); // start off as histogram
    cumulative.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            chartInfo.setCumulative(e.getStateChange() == ItemEvent.SELECTED);
        }
    });
    histogram = new JCheckBox(Messages.getString("Text.Histogram")); //$NON-NLS-1$
    histogram.setSelected(chartInfo.isHistogram()); // start off as histogram
    histogram.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            boolean histogramSelected = e.getStateChange() == ItemEvent.SELECTED;
            chartInfo.setHistogram(histogramSelected);
            if (histogramSelected) {
                workTraces.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION); // allow only 1 for histogram
                costTraces.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION); // allow only 1 for histogram
            } else {
                workTraces.setSelectionMode(DefaultListSelectionModel.MULTIPLE_INTERVAL_SELECTION); // allow many
                costTraces.setSelectionMode(DefaultListSelectionModel.MULTIPLE_INTERVAL_SELECTION); // allow only 1 for histogram               
            }
        }
    });

    work = new JRadioButton(Messages.getString("Text.work")); //$NON-NLS-1$
    work.setSelected(chartInfo.isWork());
    cost = new JRadioButton(Messages.getString("Text.cost")); //$NON-NLS-1$

    ItemListener costWork = new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            boolean isCost = e.getSource() == cost;
            chartInfo.setWork(!isCost);
            tracesList = isCost ? costTraces : workTraces;
            tracesScrollPane.getViewport().add(tracesList);
            if (!chartInfo.isRestoring())
                chartInfo.setTraces(tracesList.getSelectedValues());
        }
    };
    cost.addItemListener(costWork);
    work.addItemListener(costWork);
    ButtonGroup group = new ButtonGroup();
    group.add(cost);
    group.add(work);

    // by default, always select first item
    chartInfo.setTraces(new Object[] { fields[0] });
}

From source file:io.github.jeremgamer.editor.panels.GeneralSettings.java

public GeneralSettings() {
    this.setBorder(BorderFactory.createTitledBorder(""));

    JPanel namePanel = new JPanel();
    JLabel nameLabel = new JLabel("Nom :");
    namePanel.add(nameLabel);/*from   w ww. j a v a 2 s .c  o  m*/
    name.setPreferredSize(new Dimension(220, 30));
    namePanel.add(name);
    CaretListener caretUpdateName = new CaretListener() {
        public void caretUpdate(javax.swing.event.CaretEvent e) {
            JTextField text = (JTextField) e.getSource();
            gs.set("name", text.getText());
        }
    };
    name.addCaretListener(caretUpdateName);
    this.add(namePanel);

    adress.setEditable(false);
    CaretListener caretUpdateAdress = new CaretListener() {
        public void caretUpdate(javax.swing.event.CaretEvent e) {
            JTextField text = (JTextField) e.getSource();
            gs.set("adress", text.getText());
        }
    };
    adress.addCaretListener(caretUpdateAdress);
    JPanel subTypePanel = new JPanel();
    JLabel typeLabel = new JLabel("Type :");
    subTypePanel.add(typeLabel);
    type.setPreferredSize(new Dimension(220, 30));
    type.addItem("Minecraft classique");
    type.addItem("Minecraft personnalis");
    if (new File("projects/" + Editor.getProjectName() + "/data.zip").exists()) {
        type.setSelectedIndex(1);
        browse.setEnabled(true);
        browse.setText("Supprimer l'import");
    } else {
        browse.setEnabled(false);
    }
    type.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            @SuppressWarnings("unchecked")
            JComboBox<String> combo = (JComboBox<String>) event.getSource();
            if (combo.getSelectedIndex() == 1) {
                browse.setEnabled(true);
                adress.setEnabled(true);
                adress.setEditable(true);
            } else {
                browse.setEnabled(false);
                adress.setEnabled(false);
                adress.setEditable(false);
            }
            gs.set("type", combo.getSelectedIndex());
        }

    });
    subTypePanel.add(type);
    JPanel typePanel = new JPanel();
    typePanel.setLayout(new BoxLayout(typePanel, BoxLayout.PAGE_AXIS));

    typePanel.add(subTypePanel);
    JPanel browsePanel = new JPanel();
    browsePanel.add(browse);
    JPanel adressPanel = new JPanel();
    adressPanel.setLayout(new BoxLayout(adressPanel, BoxLayout.PAGE_AXIS));
    JLabel adressLabel = new JLabel("Adresse de tlchargement :");
    adressPanel.setPreferredSize(new Dimension(0, 47));
    adress.setPreferredSize(new Dimension(0, 30));
    adressPanel.add(adressLabel);
    adressPanel.add(adress);
    typePanel.add(adressPanel);

    this.add(typePanel);
    closeOnStart.setSelected(true);
    closeOnStart.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            if (closeOnStart.isSelected()) {
                gs.set("close", true);
            } else {
                gs.set("close", false);
            }
        }

    });
    this.add(closeOnStart);

    JPanel look = new JPanel();
    look.setBorder(BorderFactory.createTitledBorder("Apparence"));
    look.setPreferredSize(new Dimension(290, 340));
    JPanel colors = new JPanel();
    cDark.setSelected(true);
    bg.add(cLight);
    bg.add(cDark);
    colors.add(cLight);
    colors.add(cDark);
    cLight.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            gs.set("color", 0);
        }

    });
    cDark.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            gs.set("color", 1);
        }

    });
    look.add(colors);
    JPanel checks = new JPanel();
    checks.setLayout(new BoxLayout(checks, BoxLayout.PAGE_AXIS));
    borders.setSelected(true);
    borders.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            if (borders.isSelected()) {
                gs.set("borders", true);
            } else {
                gs.set("borders", false);
            }
        }

    });
    resize.setSelected(true);
    resize.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            if (resize.isSelected()) {
                gs.set("resizable", true);
            } else {
                gs.set("resizable", false);
            }
        }

    });
    alwaysOnTop.setSelected(false);
    alwaysOnTop.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            if (alwaysOnTop.isSelected()) {
                gs.set("top", true);
            } else {
                gs.set("top", false);
            }
        }

    });
    checks.add(borders);
    checks.add(resize);
    checks.add(alwaysOnTop);
    checks.setPreferredSize(new Dimension(270, 60));

    JPanel size = new JPanel();
    width.setPreferredSize(new Dimension(57, 30));
    widthMin.setPreferredSize(new Dimension(57, 30));
    widthMax.setPreferredSize(new Dimension(57, 30));
    height.setPreferredSize(new Dimension(57, 30));
    heightMin.setPreferredSize(new Dimension(57, 30));
    heightMax.setPreferredSize(new Dimension(57, 30));
    JPanel widthPanel = new JPanel();
    widthPanel.setPreferredSize(new Dimension(130, 150));
    widthPanel.setBorder(BorderFactory.createTitledBorder("Largeur"));
    widthPanel.setLayout(new BoxLayout(widthPanel, BoxLayout.PAGE_AXIS));
    JPanel widthPanelBase = new JPanel();
    widthPanelBase.add(new JLabel("Base :"));
    widthPanelBase.add(width);
    JPanel widthPanelMin = new JPanel();
    widthPanelMin.add(new JLabel("Min :"));
    widthPanelMin.add(Box.createRigidArea(new Dimension(5, 1)));
    widthPanelMin.add(widthMin);
    JPanel widthPanelMax = new JPanel();
    widthPanelMax.add(new JLabel("Max :"));
    widthPanelMax.add(Box.createRigidArea(new Dimension(3, 1)));
    widthPanelMax.add(widthMax);
    widthPanel.add(widthPanelBase);
    widthPanel.add(widthPanelMin);
    widthPanel.add(widthPanelMax);

    JPanel heightPanel = new JPanel();
    heightPanel.setPreferredSize(new Dimension(130, 150));
    heightPanel.setBorder(BorderFactory.createTitledBorder("Hauteur"));
    heightPanel.setLayout(new BoxLayout(heightPanel, BoxLayout.PAGE_AXIS));
    JPanel heightPanelBase = new JPanel();
    heightPanelBase.add(new JLabel("Base :"));
    heightPanelBase.add(height);
    JPanel heightPanelMin = new JPanel();
    heightPanelMin.add(new JLabel("Min :"));
    heightPanelMin.add(Box.createRigidArea(new Dimension(5, 1)));
    heightPanelMin.add(heightMin);
    JPanel heightPanelMax = new JPanel();
    heightPanelMax.add(new JLabel("Max :"));
    heightPanelMax.add(Box.createRigidArea(new Dimension(3, 1)));
    heightPanelMax.add(heightMax);
    heightPanel.add(heightPanelBase);
    heightPanel.add(heightPanelMin);
    heightPanel.add(heightPanelMax);
    size.add(widthPanel);
    size.add(heightPanel);

    width.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            JSpinner spinner = (JSpinner) e.getSource();
            gs.set("width", spinner.getValue());
        }
    });
    widthMin.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            JSpinner spinner = (JSpinner) e.getSource();
            gs.set("widthMin", spinner.getValue());
        }
    });
    widthMax.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            JSpinner spinner = (JSpinner) e.getSource();
            ;
            gs.set("widthMax", spinner.getValue());
        }
    });
    height.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            JSpinner spinner = (JSpinner) e.getSource();
            gs.set("height", spinner.getValue());
        }
    });
    heightMin.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            JSpinner spinner = (JSpinner) e.getSource();
            gs.set("heightMin", spinner.getValue());
        }
    });
    heightMax.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            JSpinner spinner = (JSpinner) e.getSource();
            ;
            gs.set("heightMax", spinner.getValue());
        }
    });

    look.add(checks);
    look.add(size);

    JPanel bottom = new JPanel();
    bottom.setLayout(new BoxLayout(bottom, BoxLayout.LINE_AXIS));
    JButton music = new JButton("Ajouter de la musique");
    music.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            new MusicFrame((JFrame) SwingUtilities.windowForComponent(adress), gs);
        }

    });
    bottom.add(music);
    JButton icons = new JButton("Icnes");
    icons.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            new IconFrame((JFrame) SwingUtilities.windowForComponent(adress));
        }

    });
    bottom.add(icons);

    look.add(bottom);

    this.add(look);

    load();
}

From source file:edu.harvard.mcz.imagecapture.ui.ButtonEditor.java

@Override
public void actionPerformed(ActionEvent e) {

    // Action might not be event_button_pressed on all systems.
    log.debug("Button event actionCommand: " + e.getActionCommand());
    if (e.getActionCommand().equals(EVENT_PRESSED)) {
        // Event is a click on the cell
        // Identify the row that was clicked on.
        JTable table = (JTable) ((JButton) e.getSource()).getParent();
        log.debug(e.getSource());/*from   www.  j  av  a2  s .co  m*/
        log.debug(table);
        int row = table.getEditingRow();
        // Stop editing - note, we need to have gotten e.getSource.getParent and getEditingRow first.
        fireEditingStopped(); //Make the renderer reappear.
        Singleton.getSingletonInstance().getMainFrame()
                .setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        switch (formToOpen) {
        case OPEN_SPECIMEN_DETAILS:
            // Load the selected specimen record from its ID (the data value behind the button).
            //SpecimenLifeCycle sls = new SpecimenLifeCycle();
            //Specimen specimen = sls.findById((Long)targetId);
            //if (specimen!=null) {
            if (targetId != null) {
                // a specimen with this ID exists, bring up the details editor.
                try {
                    //SpecimenControler sc = new SpecimenControler(specimen);
                    if (((Specimen) targetId).getSpecimenId() != null) {
                        if (((Specimen) targetId).isStateDone()) {
                            // Specimens in state_done are no longer editable
                            JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                                    "This Specimen record has been migrated and can no longer be edited here ["
                                            + ((Specimen) targetId).getLoadFlags()
                                            + "].\nSee: http://mczbase.mcz.harvard.edu/guid/MCZ:Ent:"
                                            + ((Specimen) targetId).getCatNum(),
                                    "Migrated Specimen", JOptionPane.WARNING_MESSAGE);
                        } else {
                            // Specimen is still editable
                            if (table != null) {
                                // Pass the specimen object for the row, the table model, and the row number on to the specimen controler.
                                try {
                                    SpecimenControler sc = new SpecimenControler((Specimen) targetId,
                                            (SpecimenListTableModel) table.getModel(), table, row);
                                    if (table.getParent().getParent().getParent().getParent()
                                            .getClass() == SpecimenBrowser.class) {
                                        sc.addListener((DataChangeListener) table.getParent());
                                    } else {
                                        Component x = table;
                                        boolean done = false;
                                        while (!done) {
                                            log.debug(x.getParent());
                                            x = x.getParent();
                                            if (x.getClass() == SpecimenBrowser.class) {
                                                sc.addListener((DataChangeListener) x);
                                                done = true;
                                            }
                                        }
                                    }
                                    sc.displayInEditor();
                                } catch (java.lang.ClassCastException eNotSp) {
                                    // Request isn't coming from a SpecimenListTableModel
                                    // View just the specimen record.
                                    SpecimenControler sc = new SpecimenControler((Specimen) targetId);
                                    sc.displayInEditor();
                                }
                            } else {
                                log.debug(e.getSource());
                                //SpecimenControler sc = new SpecimenControler((Specimen)targetId);
                                //sc.displayInEditor();
                            }
                        }
                    } else {
                        log.debug("User clicked on table row containing a new Specimen()");
                        JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                                "No Specimen for this image", "Load Specimen Failed",
                                JOptionPane.WARNING_MESSAGE);
                    }
                } catch (NoSuchRecordException e1) {
                    log.error("Tested for specimen!=null, but SpecimenControler threw null specimen exception");
                    log.error(e1);
                }
            } else {
                log.debug("No matches found to specimen id=" + targetId);
                // TODO: Create new specimen record and bring up dialog
                JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                        "No specimen record.");
            }
            break;
        case OPEN_TEMPLATE:
            // Load the selected specimen record from its ID (the data value behind the button).
            try {
                // a template with this targetID exists, display it.
                ((PositionTemplateEditor) parentComponent).setTemplate((String) targetId);
            } catch (NoSuchTemplateException e1) {
                log.error("No such template on button press on a template in list.");
                log.error(e1);
                log.trace(e1);
            }

            break;
        case OPEN_USER:
            //TODO: tie to user
            log.debug("Open user");
            ((UserListBrowser) parentComponent).getEditUserPanel().setUser((Users) targetId);
            break;
        case OPEN_SPECIMEN_VERBATIM:
            log.debug("Open Verbatim Transcription");
            SpecimenLifeCycle sls = new SpecimenLifeCycle();
            List<Specimen> toTranscribe = sls.findForVerbatim(((GenusSpeciesCount) targetId).getGenus(),
                    ((GenusSpeciesCount) targetId).getSpecificEpithet(), WorkFlowStatus.STAGE_1);
            log.debug(toTranscribe.size());
            SpecimenListTableModel stm = new SpecimenListTableModel(toTranscribe);
            JTable stable = new JTable();
            stable.setModel(stm);
            SpecimenControler verbCont;
            try {
                verbCont = new SpecimenControler(toTranscribe.get(0), stm, stable, 0);
                VerbatimCaptureDialog dialog = new VerbatimCaptureDialog(toTranscribe.get(0), verbCont);
                dialog.setVisible(true);
            } catch (NoSuchRecordException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
            break;
        case OPEN_VERBATIM_CLASSIFY:
            log.debug("Open Verbatim Classify dialog");
            try {
                VerbatimClassifyDialog dialog = new VerbatimClassifyDialog(
                        (VerbatimCount) table.getModel().getValueAt(row, 0));
                dialog.setVisible(true);
            } catch (ClassCastException e1) {
                log.error(e1.getMessage(), e1);
            }
            break;
        case ACTION_CANCEL_JOB:
            log.debug("Action Cancel requested on job " + targetId);
            Singleton.getSingletonInstance().getJobList().getJobAt((Integer) targetId).cancel();
            break;
        case OPEN_SPECIMENPARTATTRIBUTES:
            SpecimenPartAttributeDialog attrDialog = new SpecimenPartAttributeDialog((SpecimenPart) targetId);
            attrDialog.setVisible(true);
            break;
        }
        Singleton.getSingletonInstance().getMainFrame()
                .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        System.gc();
    }
}

From source file:TexBug.java

public void actionPerformed(ActionEvent e) {
    String action = e.getActionCommand();
    Object source = e.getSource();
    if (action == texEnableString) {
        texEnable = texEnableCheckBox.isSelected();
        System.out.println("texture.setEnable(" + texEnable + ")");
        texture.setEnable(texEnable);/*from   w  w w. j av  a2s .  c om*/
    } else if (action == texBoundarySWrapString) {
        texBoundaryModeS = Texture.WRAP;
        setTexture();
    } else if (action == texBoundarySClampString) {
        texBoundaryModeS = Texture.CLAMP;
        setTexture();
    } else if (action == texBoundaryTWrapString) {
        texBoundaryModeT = Texture.WRAP;
        setTexture();
    } else if (action == texBoundaryTClampString) {
        texBoundaryModeT = Texture.CLAMP;
        setTexture();
    } else if (action == texMinFilterBasePointString) {
        texMinFilter = Texture.BASE_LEVEL_POINT;
        setTexture();
    } else if (action == texMinFilterBaseLinearString) {
        texMinFilter = Texture.BASE_LEVEL_LINEAR;
        setTexture();
    } else if (action == texMinFilterMultiPointString) {
        texMinFilter = Texture.MULTI_LEVEL_POINT;
        setTexture();
    } else if (action == texMinFilterMultiLinearString) {
        texMinFilter = Texture.MULTI_LEVEL_LINEAR;
        setTexture();
    } else if (action == texMinFilterFastestString) {
        texMinFilter = Texture.FASTEST;
        setTexture();
    } else if (action == texMinFilterNicestString) {
        texMinFilter = Texture.NICEST;
        setTexture();
    } else if (action == texMagFilterBasePointString) {
        texMagFilter = Texture.BASE_LEVEL_POINT;
        setTexture();
    } else if (action == texMagFilterBaseLinearString) {
        texMagFilter = Texture.BASE_LEVEL_LINEAR;
        setTexture();
    } else if (action == texMagFilterNicestString) {
        texMagFilter = Texture.NICEST;
        setTexture();
    } else if (action == texMagFilterFastestString) {
        texMagFilter = Texture.FASTEST;
        setTexture();
    } else if (action == texMipMapBaseString) {
        texMipMapMode = Texture.BASE_LEVEL;
        setTexture();
    } else if (action == texMipMapMultiString) {
        texMipMapMode = Texture.MULTI_LEVEL_MIPMAP;
        setTexture();
    }
}

From source file:com.sshtools.sshvnc.SshVncSessionPanel.java

/**
 *
 *
 * @param evt/*from   w  ww  .j  av  a 2s .  co  m*/
 */
public void actionPerformed(ActionEvent evt) {
    if (evt.getSource() == receiveTimer) {
        statusBar.setReceiving(false);
    } else if (evt.getSource() == sendTimer) {
        statusBar.setSending(false);
    }
}

From source file:com.emr.schemas.SchemerMapper.java

/**
 * Handles click event for the Next button
 * Opens {@link TableRelationsForm} for the user to define the relationships between the selected tables.
 * @param evt {@link ActionEvent}/*from   ww w  .ja v a 2 s.  c  om*/
 */
private void btnNextScreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNextScreenActionPerformed
    if (listOfTables.isEmpty()) {
        JOptionPane.showMessageDialog(this, "Please select source tables from thee list",
                "No selection was made", JOptionPane.ERROR_MESSAGE);
    } else {
        Container container = SwingUtilities.getAncestorOfClass(JDesktopPane.class,
                (Component) evt.getSource());

        if (container != null) {
            btnClearSel.setEnabled(false);
            btnNextScreen.setEnabled(false);
            JDesktopPane desktopPane = getDesktopPane();
            TableRelationsForm frm = new TableRelationsForm(listOfTables, this);
            desktopPane.add(frm);
            frm.setVisible(true);
            frm.setSize(800, 500);
            frm.setLocation(120, 60);
            frm.moveToFront();
            frm.addInternalFrameListener(new InternalFrameListener() {

                @Override
                public void internalFrameOpened(InternalFrameEvent e) {
                    //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                }

                @Override
                public void internalFrameClosing(InternalFrameEvent e) {
                    //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                }

                @Override
                public void internalFrameClosed(InternalFrameEvent e) {
                    btnClearSel.setEnabled(true);
                    btnNextScreen.setEnabled(true);
                }

                @Override
                public void internalFrameIconified(InternalFrameEvent e) {
                    //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                }

                @Override
                public void internalFrameDeiconified(InternalFrameEvent e) {
                    //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                }

                @Override
                public void internalFrameActivated(InternalFrameEvent e) {
                    //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                }

                @Override
                public void internalFrameDeactivated(InternalFrameEvent e) {
                    //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
                }
            });
        }
    }

}

From source file:edu.ku.brc.specify.ui.DBObjSearchPanel.java

/**
 * Common initializer./*from   ww w  . j a v  a 2s.  com*/
 * @param viewSetName the viewset name
 * @param viewName the form name from the viewset
 */
protected void init() {
    doQuery = new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            doStartQuery((JComponent) e.getSource());
        }
    };

    if (queryBuilder == null) {
        ExpressResultsTableInfo esTblInfo = ExpressSearchConfigCache.getTableInfoByName(searchName);
        if (esTblInfo != null) {
            esTableInfo = esTblInfo;
            esTableInfo.setViewSQLOverridden(true);

            tables.put(esTableInfo.getTableId(), esTableInfo);

            sqlStr = esTableInfo.getViewSql();

        } else {
            throw new RuntimeException(
                    "Couldn't find search name[" + searchName + "] in the search_config.xml");
        }
    }
}

From source file:com.floreantpos.ui.views.SwitchboardView.java

public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == btnEditTicket) {
        doEditTicket();//  w  w  w  . ja v a 2s  . c  om
    } else if (source == btnGroupSettle) {
        doGroupSettle();
    } else if (source == btnOrderInfo) {
        doShowOrderInfo();
    } else if (source == btnReopenTicket) {
        doReopenTicket();
    } else if (source == btnSettleTicket) {
        doSettleTicket();
    } else if (source == btnSplitTicket) {
        doSplitTicket();
    }
}

From source file:ch.algotrader.client.chart.ChartTab.java

private void initOHLCSeries(int datasetNumber, XYDataset dataset, SeriesDefinitionVO seriesDefinition) {

    BarDefinitionVO barDefinition = (BarDefinitionVO) seriesDefinition;
    OHLCSeriesCollection ohlcSeriesCollection = (OHLCSeriesCollection) dataset;
    ohlcSeriesCollection.setXPosition(TimePeriodAnchor.START);

    // create the TimeSeries
    OHLCSeries series = new OHLCSeries(barDefinition.getLabel());
    ohlcSeriesCollection.addSeries(series);
    this.bars.put(barDefinition.getSecurityId(), series);

    // get the seriesNumber & color
    final int seriesNumber = ohlcSeriesCollection.getSeriesCount() - 1;

    // configure the renderer
    final CandlestickRenderer renderer = (CandlestickRenderer) getPlot().getRenderer(datasetNumber);
    renderer.setSeriesPaint(seriesNumber, getColor(barDefinition.getColor()));
    renderer.setSeriesVisible(seriesNumber, seriesDefinition.isSelected());
    renderer.setAutoWidthMethod(HideableCandlestickRenderer.WIDTHMETHOD_SMALLEST);

    // add the menu item
    JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(seriesDefinition.getLabel());
    menuItem.setSelected(seriesDefinition.isSelected());
    menuItem.addActionListener(new ActionListener() {
        @Override//from   w  w  w .  j a va  2s. c  o m
        public void actionPerformed(ActionEvent e) {
            resetAxis();
            renderer.setSeriesVisible(seriesNumber, ((JCheckBoxMenuItem) e.getSource()).isSelected(), true);
            initAxis();
        }
    });
    this.getPopupMenu().add(menuItem);
}