Example usage for java.awt Cursor getPredefinedCursor

List of usage examples for java.awt Cursor getPredefinedCursor

Introduction

In this page you can find the example usage for java.awt Cursor getPredefinedCursor.

Prototype

public static Cursor getPredefinedCursor(int type) 

Source Link

Document

Returns a cursor object with the specified predefined type.

Usage

From source file:edu.scripps.fl.pubchem.xmltool.gui.PubChemXMLCreatorGUI.java

public void actionPerformed(ActionEvent e) {
    try {/* w w w  .  ja v  a 2s  .  c o  m*/
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        if (e.getSource() == jbnFileTemplate) {
            gc.fileChooser(jtfFileTemplate, ".xml", "open");
            jtfFileTemplate.setEnabled(true);
        } else if (e.getSource() == jbnFileExcel) {
            gc.fileChooser(jtfFileExcel, ".xlsx", "open");
        } else if (e.getSource() == jbnRunCreator) {
            String stringTemplate = jtfFileTemplate.getText();
            InputStream fileTemplate;
            if (stringTemplate.equals(template) | stringTemplate.equals("")) {
                URL url = getClass().getClassLoader().getResource("blank.xml");
                fileTemplate = url.openStream();
            } else
                fileTemplate = new FileInputStream(jtfFileTemplate.getText());
            File fileExcel = new File(jtfFileExcel.getText());
            File fileOutput = File.createTempFile("pubchem", ".xml");
            fileOutput.deleteOnExit();
            PubChemAssay assay = new PubChemXMLCreatorController().createPubChemXML(fileTemplate, fileExcel,
                    fileOutput);
            String message = assay.getMessage();
            if (!message.equals("")) {
                int nn = JOptionPane.showOptionDialog(this,
                        notError + message + "\nWould you like to edit your Excel Workbook?", SwingGUI.APP_NAME,
                        JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
                if (nn == JOptionPane.YES_OPTION) {
                    log.info("Opening Excel Workbook with Desktop: " + fileExcel);
                    Desktop.getDesktop().open(fileExcel);
                } else {
                    log.info("Opening XML file: " + fileOutput);
                    Desktop.getDesktop().open(fileOutput);
                }
            } else {
                log.info("Opening XML file: " + fileOutput);
                Desktop.getDesktop().open(fileOutput);
            }
        } else if (e.getSource() == jbnReportCreator) {
            File fileExcel = new File(jtfFileExcel.getText());
            File filePDFOutput = File.createTempFile("PubChem_PDF_Report", ".pdf");
            File fileWordOutput = File.createTempFile("PubChem_Word_Report", ".docx");
            filePDFOutput.deleteOnExit();
            fileWordOutput.deleteOnExit();
            ArrayList<PubChemAssay> assay = new ReportController().createReport(pcDep, fileExcel, filePDFOutput,
                    fileWordOutput, isInternal);
            String message = null;
            for (PubChemAssay xx : assay) {
                message = xx.getMessage();
                if (!message.equals("")) {
                    int nn = JOptionPane.showOptionDialog(this,
                            notError + message + "\nWould you like to edit your Excel Workbook?",
                            SwingGUI.APP_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
                            null, null);
                    if (nn == JOptionPane.YES_OPTION) {
                        log.info("Opening Excel Workbook with Desktop: " + fileExcel);
                        Desktop.getDesktop().open(fileExcel);
                    } else {
                        gc.openPDF(isInternal, filePDFOutput, this);
                        Desktop.getDesktop().open(fileWordOutput);
                    }
                } else {
                    gc.openPDF(isInternal, filePDFOutput, this);
                    Desktop.getDesktop().open(fileWordOutput);
                }
            }
        }
        setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    } catch (Throwable throwable) {
        SwingGUI.handleError(this, throwable);
    }
}

From source file:net.sf.mzmine.modules.visualization.tic.TICPlot.java

public TICPlot(final ActionListener listener) {

    super(null, true);

    // Initialize.
    visualizer = listener;/* w ww  . ja  v a  2 s  . c  o m*/
    labelsVisible = 1;
    havePeakLabels = false;
    numOfDataSets = 0;
    numOfPeaks = 0;
    showSpectrumRequest = false;

    // Set cursor.
    setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));

    // Y-axis label.
    final String yAxisLabel;
    if (listener instanceof TICVisualizerWindow) {

        yAxisLabel = ((TICVisualizerWindow) listener).getPlotType() == PlotType.BASEPEAK ? "Base peak intensity"
                : "Total ion intensity";
    } else {

        yAxisLabel = "Base peak intensity";
    }

    // Initialize the chart by default time series chart from factory.
    final JFreeChart chart = ChartFactory.createXYLineChart("", // title
            "Retention time", // x-axis label
            yAxisLabel, // y-axis label
            null, // data set
            PlotOrientation.VERTICAL, // orientation
            true, // create legend?
            true, // generate tooltips?
            false // generate URLs?
    );
    chart.setBackgroundPaint(Color.white);
    setChart(chart);

    // Title.
    chartTitle = chart.getTitle();
    chartTitle.setFont(TITLE_FONT);
    chartTitle.setMargin(TITLE_TOP_MARGIN, 0.0, 0.0, 0.0);

    // Subtitle.
    chartSubTitle = new TextTitle();
    chartSubTitle.setFont(SUBTITLE_FONT);
    chartSubTitle.setMargin(TITLE_TOP_MARGIN, 0.0, 0.0, 0.0);
    chart.addSubtitle(chartSubTitle);

    // Disable maximum size (we don't want scaling).
    setMaximumDrawWidth(Integer.MAX_VALUE);
    setMaximumDrawHeight(Integer.MAX_VALUE);

    // Legend constructed by ChartFactory.
    final LegendTitle legend = chart.getLegend();
    legend.setItemFont(LEGEND_FONT);
    legend.setFrame(BlockBorder.NONE);

    // Set the plot properties.
    plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setAxisOffset(AXIS_OFFSET);
    plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

    // Set grid properties.
    plot.setDomainGridlinePaint(GRID_COLOR);
    plot.setRangeGridlinePaint(GRID_COLOR);

    // Set cross-hair (selection) properties.
    if (listener instanceof TICVisualizerWindow) {

        plot.setDomainCrosshairVisible(true);
        plot.setRangeCrosshairVisible(true);
        plot.setDomainCrosshairPaint(CROSS_HAIR_COLOR);
        plot.setRangeCrosshairPaint(CROSS_HAIR_COLOR);
        plot.setDomainCrosshairStroke(CROSS_HAIR_STROKE);
        plot.setRangeCrosshairStroke(CROSS_HAIR_STROKE);
    }

    // Set the x-axis (retention time) properties.
    final NumberAxis xAxis = (NumberAxis) plot.getDomainAxis();
    xAxis.setNumberFormatOverride(MZmineCore.getConfiguration().getRTFormat());
    xAxis.setUpperMargin(AXIS_MARGINS);
    xAxis.setLowerMargin(AXIS_MARGINS);

    // Set the y-axis (intensity) properties.
    final NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
    yAxis.setNumberFormatOverride(MZmineCore.getConfiguration().getIntensityFormat());

    // Set default renderer properties.
    defaultRenderer = new TICPlotRenderer();
    defaultRenderer.setBaseShapesFilled(true);
    defaultRenderer.setDrawOutlines(false);
    defaultRenderer.setUseFillPaint(true);
    defaultRenderer.setBaseItemLabelPaint(LABEL_COLOR);

    // Set label generator
    final XYItemLabelGenerator labelGenerator = new TICItemLabelGenerator(this);
    defaultRenderer.setBaseItemLabelGenerator(labelGenerator);
    defaultRenderer.setBaseItemLabelsVisible(true);

    // Set toolTipGenerator
    final XYToolTipGenerator toolTipGenerator = new TICToolTipGenerator();
    defaultRenderer.setBaseToolTipGenerator(toolTipGenerator);

    // Set focus state to receive key events.
    setFocusable(true);

    // Register key handlers.
    GUIUtils.registerKeyHandler(this, KeyStroke.getKeyStroke("LEFT"), listener, "MOVE_CURSOR_LEFT");
    GUIUtils.registerKeyHandler(this, KeyStroke.getKeyStroke("RIGHT"), listener, "MOVE_CURSOR_RIGHT");
    GUIUtils.registerKeyHandler(this, KeyStroke.getKeyStroke("SPACE"), listener, "SHOW_SPECTRUM");
    GUIUtils.registerKeyHandler(this, KeyStroke.getKeyStroke('+'), this, "ZOOM_IN");
    GUIUtils.registerKeyHandler(this, KeyStroke.getKeyStroke('-'), this, "ZOOM_OUT");

    // Add items to popup menu.
    final JPopupMenu popupMenu = getPopupMenu();
    popupMenu.addSeparator();

    if (listener instanceof TICVisualizerWindow) {

        popupMenu.add(new ExportPopUpMenu((TICVisualizerWindow) listener));
        popupMenu.addSeparator();
        popupMenu.add(new AddFilePopupMenu((TICVisualizerWindow) listener));
        popupMenu.add(new RemoveFilePopupMenu((TICVisualizerWindow) listener));
        popupMenu.add(new ExportPopUpMenu((TICVisualizerWindow) listener));
        popupMenu.addSeparator();
    }

    GUIUtils.addMenuItem(popupMenu, "Toggle showing peak values", this, "SHOW_ANNOTATIONS");
    GUIUtils.addMenuItem(popupMenu, "Toggle showing data points", this, "SHOW_DATA_POINTS");

    if (listener instanceof TICVisualizerWindow) {
        popupMenu.addSeparator();
        GUIUtils.addMenuItem(popupMenu, "Show spectrum of selected scan", listener, "SHOW_SPECTRUM");
    }

    popupMenu.addSeparator();

    GUIUtils.addMenuItem(popupMenu, "Set axes range", this, "SETUP_AXES");

    if (listener instanceof TICVisualizerWindow) {

        GUIUtils.addMenuItem(popupMenu, "Set same range to all windows", this, "SET_SAME_RANGE");
    }
}

From source file:FTPApp.java

protected boolean connect() {
    monitorTextArea.setText("");
    setButtonStates(false);//from w  w  w.ja  v  a  2 s .  c  o  m
    closeButton.setText("Cancel");
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

    String user = userNameTextField.getText();
    if (user.length() == 0) {
        setMessage("Please enter user name");
        setButtonStates(true);
        return false;
    }
    String password = new String(passwordTextField.getPassword());
    String sUrl = urlTextField.getText();
    if (sUrl.length() == 0) {
        setMessage("Please enter URL");
        setButtonStates(true);
        return false;
    }
    localFileName = fileTextField.getText();

    // Parse URL
    int index = sUrl.indexOf("//");
    if (index >= 0)
        sUrl = sUrl.substring(index + 2);

    index = sUrl.indexOf("/");
    String host = sUrl.substring(0, index);
    sUrl = sUrl.substring(index + 1);

    String sDir = "";
    index = sUrl.lastIndexOf("/");
    if (index >= 0) {
        sDir = sUrl.substring(0, index);
        sUrl = sUrl.substring(index + 1);
    }
    remoteFileName = sUrl;

    try {
        setMessage("Connecting to host " + host);
        ftpClient = new FtpClient(host);
        ftpClient.login(user, password);
        setMessage("User " + user + " login OK");
        setMessage(ftpClient.welcomeMsg);
        ftpClient.cd(sDir);
        setMessage("Directory: " + sDir);
        ftpClient.binary();
        return true;
    } catch (Exception ex) {
        setMessage("Error: " + ex.toString());
        setButtonStates(true);
        return false;
    }
}

From source file:op.system.DlgLogin.java

/**
 * This method is called from within the constructor to
 * initialize the printerForm.//www  .  ja v  a  2  s .  c  o m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the PrinterForm Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    jPanel2 = new JPanel();
    lblOPDE = new JLabel();
    btnAbout = new JButton();
    lblUsernamePassword = new JLabel();
    txtUsername = new JTextField();
    txtPassword = new JPasswordField();
    panel1 = new JPanel();
    btnExit = new JButton();
    hSpacer1 = new JPanel(null);
    btnLogin = new JButton();

    //======== this ========
    setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
    setResizable(false);
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowActivated(WindowEvent e) {
            thisWindowActivated(e);
        }
    });
    Container contentPane = getContentPane();
    contentPane.setLayout(new FormLayout("13dlu, default, 13dlu",
            "13dlu, $lgap, fill:48dlu:grow, $lgap, default, $lgap, 13dlu"));

    //======== jPanel2 ========
    {
        jPanel2.setBorder(new EmptyBorder(5, 5, 5, 5));
        jPanel2.setOpaque(false);
        jPanel2.setLayout(new VerticalLayout(10));

        //---- lblOPDE ----
        lblOPDE.setText("Offene-Pflege.de");
        lblOPDE.setFont(new Font("Arial", Font.PLAIN, 24));
        lblOPDE.setHorizontalAlignment(SwingConstants.CENTER);
        jPanel2.add(lblOPDE);

        //---- btnAbout ----
        btnAbout.setIcon(new ImageIcon(getClass().getResource("/artwork/256x256/opde-logo.png")));
        btnAbout.setBorderPainted(false);
        btnAbout.setBorder(null);
        btnAbout.setOpaque(false);
        btnAbout.setContentAreaFilled(false);
        btnAbout.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        btnAbout.setToolTipText(null);
        btnAbout.addActionListener(e -> btnAboutActionPerformed(e));
        jPanel2.add(btnAbout);

        //---- lblUsernamePassword ----
        lblUsernamePassword.setText("text");
        lblUsernamePassword.setFont(new Font("Arial", Font.PLAIN, 18));
        jPanel2.add(lblUsernamePassword);

        //---- txtUsername ----
        txtUsername.setFont(new Font("Arial", Font.PLAIN, 18));
        txtUsername.addActionListener(e -> txtUsernameActionPerformed(e));
        txtUsername.addFocusListener(new FocusAdapter() {
            @Override
            public void focusGained(FocusEvent e) {
                txtUsernameFocusGained(e);
            }
        });
        jPanel2.add(txtUsername);

        //---- txtPassword ----
        txtPassword.setFont(new Font("Arial", Font.PLAIN, 18));
        txtPassword.addActionListener(e -> txtPasswordActionPerformed(e));
        txtPassword.addFocusListener(new FocusAdapter() {
            @Override
            public void focusGained(FocusEvent e) {
                txtPasswordFocusGained(e);
            }
        });
        jPanel2.add(txtPassword);
    }
    contentPane.add(jPanel2, CC.xy(2, 3, CC.FILL, CC.DEFAULT));

    //======== panel1 ========
    {
        panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));

        //---- btnExit ----
        btnExit.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/exit.png")));
        btnExit.addActionListener(e -> btnExitActionPerformed(e));
        panel1.add(btnExit);
        panel1.add(hSpacer1);

        //---- btnLogin ----
        btnLogin.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png")));
        btnLogin.setActionCommand("btnLogin");
        btnLogin.addActionListener(e -> DoLogin(e));
        panel1.add(btnLogin);
    }
    contentPane.add(panel1, CC.xy(2, 5, CC.RIGHT, CC.DEFAULT));
    setSize(320, 540);
    setLocationRelativeTo(getOwner());
}

From source file:EditorPaneExample11.java

public EditorPaneExample11() {
    super("JEditorPane Example 11");

    pane = new JEditorPane();
    pane.setEditable(false); // Read-only
    getContentPane().add(new JScrollPane(pane), "Center");

    // Build the panel of controls
    JPanel panel = new JPanel();

    panel.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.gridwidth = 1;/*from   w  ww  . j a v  a2s .  co m*/
    c.gridheight = 1;
    c.anchor = GridBagConstraints.EAST;
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0.0;
    c.weighty = 0.0;

    JLabel urlLabel = new JLabel("URL: ", JLabel.RIGHT);
    panel.add(urlLabel, c);
    JLabel loadingLabel = new JLabel("State: ", JLabel.RIGHT);
    c.gridy = 1;
    panel.add(loadingLabel, c);
    JLabel typeLabel = new JLabel("Type: ", JLabel.RIGHT);
    c.gridy = 2;
    panel.add(typeLabel, c);
    c.gridy = 3;
    panel.add(new JLabel(LOAD_TIME), c);

    c.gridy = 4;
    c.gridwidth = 2;
    c.weightx = 1.0;
    c.anchor = GridBagConstraints.WEST;
    onlineLoad = new JCheckBox("Online Load");
    panel.add(onlineLoad, c);
    onlineLoad.setSelected(true);
    onlineLoad.setForeground(typeLabel.getForeground());

    c.gridx = 1;
    c.gridy = 0;
    c.anchor = GridBagConstraints.EAST;
    c.fill = GridBagConstraints.HORIZONTAL;

    urlCombo = new JComboBox();
    panel.add(urlCombo, c);
    urlCombo.setEditable(true);
    loadingState = new JLabel(spaces, JLabel.LEFT);
    loadingState.setForeground(Color.black);
    c.gridy = 1;
    panel.add(loadingState, c);
    loadedType = new JLabel(spaces, JLabel.LEFT);
    loadedType.setForeground(Color.black);
    c.gridy = 2;
    panel.add(loadedType, c);
    timeLabel = new JLabel("");
    c.gridy = 3;
    panel.add(timeLabel, c);

    getContentPane().add(panel, "South");

    // Allocate the empty tree model
    DefaultMutableTreeNode emptyRootNode = new DefaultMutableTreeNode("Empty");
    emptyModel = new DefaultTreeModel(emptyRootNode);

    // Create and place the heading tree
    tree = new JTree(emptyModel);
    tree.setPreferredSize(new Dimension(200, 200));
    getContentPane().add(new JScrollPane(tree), "East");

    // Change page based on combo selection
    urlCombo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            if (populatingCombo == true) {
                return;
            }
            Object selection = urlCombo.getSelectedItem();
            try {
                // Check if the new page and the old
                // page are the same.
                URL url;
                if (selection instanceof URL) {
                    url = (URL) selection;
                } else {
                    url = new URL((String) selection);
                }

                URL loadedURL = pane.getPage();
                if (loadedURL != null && loadedURL.sameFile(url)) {
                    return;
                }

                // Try to display the page
                urlCombo.setEnabled(false); // Disable input
                urlCombo.paintImmediately(0, 0, urlCombo.getSize().width, urlCombo.getSize().height);
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                // Busy cursor
                loadingState.setText("Loading...");
                loadingState.paintImmediately(0, 0, loadingState.getSize().width,
                        loadingState.getSize().height);
                loadedType.setText("");
                loadedType.paintImmediately(0, 0, loadedType.getSize().width, loadedType.getSize().height);

                timeLabel.setText("");
                timeLabel.paintImmediately(0, 0, timeLabel.getSize().width, timeLabel.getSize().height);

                // Display an empty tree while loading
                tree.setModel(emptyModel);
                tree.paintImmediately(0, 0, tree.getSize().width, tree.getSize().height);

                startTime = System.currentTimeMillis();

                // Choose the loading method
                if (onlineLoad.isSelected()) {
                    // Usual load via setPage
                    pane.setPage(url);
                    loadedType.setText(pane.getContentType());
                } else {
                    pane.setContentType("text/html");
                    loadedType.setText(pane.getContentType());
                    if (loader == null) {
                        loader = new HTMLDocumentLoader();
                    }
                    HTMLDocument doc = loader.loadDocument(url);
                    loadComplete();
                    pane.setDocument(doc);
                    displayLoadTime();
                    populateCombo(findLinks(doc, null));
                    TreeNode node = buildHeadingTree(doc);
                    tree.setModel(new DefaultTreeModel(node));
                    enableInput();
                }
            } catch (Exception e) {
                System.out.println(e);
                JOptionPane.showMessageDialog(pane,
                        new String[] { "Unable to open file", selection.toString() }, "File Open Error",
                        JOptionPane.ERROR_MESSAGE);
                loadingState.setText("Failed");
                enableInput();
            }
        }
    });

    // Listen for page load to complete
    pane.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getPropertyName().equals("page")) {
                loadComplete();
                displayLoadTime();
                populateCombo(findLinks(pane.getDocument(), null));
                TreeNode node = buildHeadingTree(pane.getDocument());
                tree.setModel(new DefaultTreeModel(node));
                enableInput();
            }
        }
    });

    // Listener for tree selection
    tree.addTreeSelectionListener(new TreeSelectionListener() {
        public void valueChanged(TreeSelectionEvent evt) {
            TreePath path = evt.getNewLeadSelectionPath();
            if (path != null) {
                DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
                Object userObject = node.getUserObject();
                if (userObject instanceof Heading) {
                    Heading heading = (Heading) userObject;
                    try {
                        Rectangle textRect = pane.modelToView(heading.getOffset());
                        textRect.y += 3 * textRect.height;
                        pane.scrollRectToVisible(textRect);
                    } catch (BadLocationException e) {
                    }
                }
            }
        }
    });
}

From source file:org.tinymediamanager.ui.dialogs.RegisterDonatorVersionDialog.java

public RegisterDonatorVersionDialog() {
    super(BUNDLE.getString("tmm.registerdonator"), "registerDonator"); //$NON-NLS-1$
    setBounds(166, 5, 400, 300);// w  ww  .java2  s .co m
    boolean isDonator = Globals.isDonator();
    Properties props = null;
    if (isDonator) {
        props = License.decrypt();
    }

    {
        JPanel panelContent = new JPanel();
        getContentPane().add(panelContent, BorderLayout.CENTER);
        panelContent.setLayout(new FormLayout(
                new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                        FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("250px:grow"),
                        FormFactory.RELATED_GAP_COLSPEC, },
                new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"),
                        FormFactory.PARAGRAPH_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                        FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                        FormFactory.UNRELATED_GAP_ROWSPEC, }));

        {
            JTextArea textArea = new JTextArea();
            textArea.setOpaque(false);
            textArea.setLineWrap(true);
            textArea.setWrapStyleWord(true);
            textArea.setEditable(false);
            panelContent.add(textArea, "2, 2, 3, 1, default, center");
            if (isDonator) {
                textArea.setText(BUNDLE.getString("tmm.registerdonator.thanks")); //$NON-NLS-1$
            } else {
                textArea.setText(BUNDLE.getString("tmm.registerdonator.hint")); //$NON-NLS-1$
            }
        }
        {
            JLabel lblName = new JLabel(BUNDLE.getString("tmm.registerdonator.name")); //$NON-NLS-1$
            panelContent.add(lblName, "2, 4, right, default");
            tfName = new JTextField("");
            lblName.setLabelFor(tfName);
            panelContent.add(tfName, "4, 4, fill, default");
            tfName.setColumns(10);
            if (isDonator) {
                tfName.setText(props.getProperty("user"));
                tfName.setEnabled(false);
            }
        }
        {
            JLabel lblEmailAddress = new JLabel(BUNDLE.getString("tmm.registerdonator.email")); //$NON-NLS-1$
            panelContent.add(lblEmailAddress, "2, 6, right, default");
            tfEmailAddress = new JTextField("");
            lblEmailAddress.setLabelFor(tfEmailAddress);
            panelContent.add(tfEmailAddress, "4, 6, fill, default");
            tfEmailAddress.setColumns(10);
            if (isDonator) {
                tfEmailAddress.setText(props.getProperty("email"));
                tfEmailAddress.setEnabled(false);
            }
        }
    }
    {
        JPanel panelButtons = new JPanel();
        panelButtons.setBorder(new EmptyBorder(4, 4, 4, 4));
        getContentPane().add(panelButtons, BorderLayout.SOUTH);
        EqualsLayout layout = new EqualsLayout(5);
        layout.setMinWidth(100);
        panelButtons.setLayout(layout);
        {
            JButton btnRegister = new JButton(BUNDLE.getString("Button.register")); //$NON-NLS-1$
            btnRegister.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    try {
                        LOGGER.debug("registering for donator version: ", tfEmailAddress.getText());
                        Properties p = new Properties();
                        p.setProperty("user", tfName.getText());
                        p.setProperty("email", tfEmailAddress.getText());
                        p.setProperty("generated", String.valueOf(new Date().getTime()));
                        p.setProperty("uuid", FileUtils.readFileToString(new File("tmm.uuid")));

                        // get encrypted string and write tmm.lic
                        if (License.encrypt(p) && License.isValid()) {
                            JOptionPane.showMessageDialog(RegisterDonatorVersionDialog.this,
                                    BUNDLE.getString("tmm.registerdonator.success")); //$NON-NLS-1$
                            setVisible(false);
                        } else {
                            JOptionPane.showMessageDialog(RegisterDonatorVersionDialog.this,
                                    BUNDLE.getString("tmm.registerdonator.error")); //$NON-NLS-1$
                        }
                    } catch (Exception ex) {
                        LOGGER.error("Error registering donator version: " + ex.getMessage());
                    }
                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                }
            });
            if (isDonator) {
                btnRegister.setEnabled(false);
            }
            panelButtons.add(btnRegister);
        }
        {
            JButton btnClose = new JButton(BUNDLE.getString("Button.close")); //$NON-NLS-1$
            btnClose.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent arg0) {
                    setVisible(false);
                }
            });
            panelButtons.add(btnClose);
        }
    }
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowOpened(WindowEvent e) {
            tfName.requestFocus();
        }
    });
}

From source file:ste.travian.gui.WorldController.java

/**
 * Shows the map chart//  www . j ava 2  s. co  m
 */
public void showMap() {
    mainWindow.setCursor(new Cursor(Cursor.WAIT_CURSOR));
    executor.execute(new Runnable() {
        public void run() {
            try {
                load();
                mainWindow.showMap(getWorldPanel());
                //
                // do not move the line below, it needs to be here so
                // that all components will have the wait cursor set
                //
                mainWindow.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            } catch (Exception e) {
                mainWindow.setCursor(Cursor.getDefaultCursor());
                mainWindow.error("Error creating the map", e);
            }
        }
    });
}

From source file:org.tinymediamanager.ui.movies.dialogs.MovieBatchEditorDialog.java

/**
 * Instantiates a new movie batch editor.
 * /*w  w  w .j av  a 2  s . co  m*/
 * @param movies
 *          the movies
 */
public MovieBatchEditorDialog(final List<Movie> movies) {
    super(BUNDLE.getString("movie.edit"), "movieBatchEditor"); //$NON-NLS-1$
    setBounds(5, 5, 350, 230);
    getContentPane().setLayout(new BorderLayout(0, 0));

    {
        JPanel panelContent = new JPanel();
        getContentPane().add(panelContent, BorderLayout.CENTER);
        panelContent.setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC,
                FormSpecs.DEFAULT_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC,
                ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, },
                new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                        FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC,
                        FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                        FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC,
                        FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                        FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC,
                        FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC,
                        FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, }));

        JLabel lblGenres = new JLabel(BUNDLE.getString("metatag.genre")); //$NON-NLS-1$
        panelContent.add(lblGenres, "2, 2, 2, 1, right, default");

        // cbGenres = new JComboBox(MediaGenres2.values());
        cbGenres = new AutocompleteComboBox(MediaGenres.values());
        cbGenres.setEditable(true);
        panelContent.add(cbGenres, "5, 2, fill, default");

        JButton btnAddGenre = new JButton("");
        btnAddGenre.setIcon(IconManager.LIST_ADD);
        btnAddGenre.setMargin(new Insets(2, 2, 2, 2));
        btnAddGenre.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                MediaGenres genre = null;
                Object item = cbGenres.getSelectedItem();

                // genre
                if (item instanceof MediaGenres) {
                    genre = (MediaGenres) item;
                }

                // newly created genre?
                if (item instanceof String) {
                    genre = MediaGenres.getGenre((String) item);
                }
                // MediaGenres2 genre = (MediaGenres2) cbGenres.getSelectedItem();
                if (genre != null) {
                    for (Movie movie : moviesToEdit) {
                        movie.addGenre(genre);
                    }
                }
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
        });
        panelContent.add(btnAddGenre, "7, 2");

        JButton btnRemoveGenre = new JButton("");
        btnRemoveGenre.setIcon(IconManager.LIST_REMOVE);
        btnRemoveGenre.setMargin(new Insets(2, 2, 2, 2));
        btnRemoveGenre.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                MediaGenres genre = (MediaGenres) cbGenres.getSelectedItem();
                for (Movie movie : moviesToEdit) {
                    movie.removeGenre(genre);
                }
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
        });
        panelContent.add(btnRemoveGenre, "9, 2");

        JLabel lblTags = new JLabel(BUNDLE.getString("metatag.tags")); //$NON-NLS-1$
        panelContent.add(lblTags, "2, 4, 2, 1, right, default");

        cbTags = new AutocompleteComboBox(movieList.getTagsInMovies().toArray());
        cbTags.setEditable(true);
        panelContent.add(cbTags, "5, 4, fill, default");

        JButton btnAddTag = new JButton("");
        btnAddTag.setIcon(IconManager.LIST_ADD);
        btnAddTag.setMargin(new Insets(2, 2, 2, 2));
        btnAddTag.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                String tag = (String) cbTags.getSelectedItem();
                if (StringUtils.isBlank(tag)) {
                    return;
                }

                for (Movie movie : moviesToEdit) {
                    movie.addToTags(tag);
                }
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
        });
        panelContent.add(btnAddTag, "7, 4");

        JButton btnRemoveTag = new JButton("");
        btnRemoveTag.setIcon(IconManager.LIST_REMOVE);
        btnRemoveTag.setMargin(new Insets(2, 2, 2, 2));
        btnRemoveTag.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                String tag = (String) cbTags.getSelectedItem();
                for (Movie movie : moviesToEdit) {
                    movie.removeFromTags(tag);
                }
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
        });
        panelContent.add(btnRemoveTag, "9, 4");

        JLabel lblCertification = new JLabel(BUNDLE.getString("metatag.certification")); //$NON-NLS-1$
        panelContent.add(lblCertification, "2, 6, 2, 1, right, default");

        final JComboBox cbCertification = new JComboBox();
        for (Certification cert : Certification
                .getCertificationsforCountry(MovieModuleManager.MOVIE_SETTINGS.getCertificationCountry())) {
            cbCertification.addItem(cert);
        }
        panelContent.add(cbCertification, "5, 6, fill, default");

        JButton btnCertification = new JButton("");
        btnCertification.setMargin(new Insets(2, 2, 2, 2));
        btnCertification.setIcon(IconManager.APPLY);
        btnCertification.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                Certification cert = (Certification) cbCertification.getSelectedItem();
                for (Movie movie : moviesToEdit) {
                    movie.setCertification(cert);
                    ;
                }
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
        });
        panelContent.add(btnCertification, "7, 6");

        JLabel lblMovieSet = new JLabel(BUNDLE.getString("metatag.movieset")); //$NON-NLS-1$
        panelContent.add(lblMovieSet, "2, 8, 2, 1, right, default");

        cbMovieSet = new JComboBox();
        panelContent.add(cbMovieSet, "5, 8, fill, default");

        JButton btnSetMovieSet = new JButton("");
        btnSetMovieSet.setMargin(new Insets(2, 2, 2, 2));
        btnSetMovieSet.setIcon(IconManager.APPLY);
        btnSetMovieSet.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                // movie set
                Object obj = cbMovieSet.getSelectedItem();
                for (Movie movie : moviesToEdit) {
                    if (obj instanceof String) {
                        movie.removeFromMovieSet();
                    }
                    if (obj instanceof MovieSet) {
                        MovieSet movieSet = (MovieSet) obj;

                        if (movie.getMovieSet() != movieSet) {
                            movie.removeFromMovieSet();
                            movie.setMovieSet(movieSet);
                            movieSet.insertMovie(movie);
                        }
                    }
                }
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
        });
        panelContent.add(btnSetMovieSet, "7, 8");

        JButton btnNewMovieset = new JButton("");
        btnNewMovieset.setMargin(new Insets(2, 2, 2, 2));
        btnNewMovieset.setAction(new MovieSetAddAction(false));
        panelContent.add(btnNewMovieset, "9, 8");

        JLabel lblWatched = new JLabel(BUNDLE.getString("metatag.watched")); //$NON-NLS-1$
        panelContent.add(lblWatched, "2, 10, 2, 1, right, default");

        chckbxWatched = new JCheckBox("");
        panelContent.add(chckbxWatched, "5, 10");

        JButton btnWatched = new JButton("");
        btnWatched.setMargin(new Insets(2, 2, 2, 2));
        btnWatched.setIcon(IconManager.APPLY);
        btnWatched.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                for (Movie movie : moviesToEdit) {
                    movie.setWatched(chckbxWatched.isSelected());
                }
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
        });
        panelContent.add(btnWatched, "7, 10");

        JLabel lblVideo3D = new JLabel(BUNDLE.getString("metatag.3d")); //$NON-NLS-1$
        panelContent.add(lblVideo3D, "2, 12, 2, 1, right, default");

        final JCheckBox chckbxVideo3D = new JCheckBox("");
        panelContent.add(chckbxVideo3D, "5, 12");

        JButton btnVideo3D = new JButton("");
        btnVideo3D.setMargin(new Insets(2, 2, 2, 2));
        btnVideo3D.setIcon(IconManager.APPLY);
        btnVideo3D.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                for (Movie movie : moviesToEdit) {
                    movie.setVideoIn3D(chckbxVideo3D.isSelected());
                }
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
        });
        panelContent.add(btnVideo3D, "7, 12");

        JLabel lblMediasource = new JLabel(BUNDLE.getString("metatag.source")); //$NON-NLS-1$
        panelContent.add(lblMediasource, "2, 14, 2, 1, right, default");

        final JComboBox cbMediaSource = new JComboBox(MediaSource.values());
        panelContent.add(cbMediaSource, "5, 14, fill, default");

        JButton btnMediaSource = new JButton("");
        btnMediaSource.setMargin(new Insets(2, 2, 2, 2));
        btnMediaSource.setIcon(IconManager.APPLY);
        btnMediaSource.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                Object obj = cbMediaSource.getSelectedItem();
                if (obj instanceof MediaSource) {
                    MediaSource mediaSource = (MediaSource) obj;
                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    for (Movie movie : moviesToEdit) {
                        movie.setMediaSource(mediaSource);
                    }
                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                }
            }
        });
        panelContent.add(btnMediaSource, "7, 14");

        JLabel lblLanguage = new JLabel(BUNDLE.getString("metatag.language")); //$NON-NLS-1$
        panelContent.add(lblLanguage, "2, 16, 2, 1, right, default");

        tfLanguage = new JTextField();
        panelContent.add(tfLanguage, "5, 16, fill, default");
        tfLanguage.setColumns(10);

        JButton btnLanguage = new JButton("");
        btnLanguage.setMargin(new Insets(2, 2, 2, 2));
        btnLanguage.setIcon(IconManager.APPLY);
        btnLanguage.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                changed = true;
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                for (Movie movie : moviesToEdit) {
                    movie.setSpokenLanguages(tfLanguage.getText());
                }
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            }
        });
        panelContent.add(btnLanguage, "7, 16");
        {

            JLabel lblSorttitleT = new JLabel(BUNDLE.getString("metatag.sorttitle")); //$NON-NLS-1$
            panelContent.add(lblSorttitleT, "2, 18, right, default");

            JButton btnSetSorttitle = new JButton(BUNDLE.getString("edit.setsorttitle")); //$NON-NLS-1$
            btnSetSorttitle.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    changed = true;
                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    for (Movie movie : moviesToEdit) {
                        movie.setSortTitle(movie.getTitleSortable());
                    }
                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                }
            });

            JLabel lblSorttitleInfo = new JLabel(IconManager.HINT);
            lblSorttitleInfo.setToolTipText(BUNDLE.getString("edit.setsorttitle.desc")); //$NON-NLS-1$
            panelContent.add(lblSorttitleInfo, "3, 18");
            panelContent.add(btnSetSorttitle, "5, 18");

            JButton btnClearSorttitle = new JButton(BUNDLE.getString("edit.clearsorttitle")); //$NON-NLS-1$
            btnClearSorttitle.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    changed = true;
                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    for (Movie movie : moviesToEdit) {
                        movie.setSortTitle("");
                    }
                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                }
            });
            panelContent.add(btnClearSorttitle, "5, 20");
        }
    }

    {
        JPanel panelButtons = new JPanel();
        FlowLayout flowLayout = (FlowLayout) panelButtons.getLayout();
        flowLayout.setAlignment(FlowLayout.RIGHT);
        getContentPane().add(panelButtons, BorderLayout.SOUTH);

        JButton btnClose = new JButton(BUNDLE.getString("Button.close")); //$NON-NLS-1$
        btnClose.setIcon(IconManager.APPLY);
        btnClose.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                // rewrite movies, if anything changed
                if (changed) {
                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    for (Movie movie : moviesToEdit) {
                        movie.writeNFO();
                        movie.saveToDb();
                    }
                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                }
                setVisible(false);
            }
        });
        panelButtons.add(btnClose);

        // add window listener to write changes (if the window close button "X" is
        // pressed)
        addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                // rewrite movies, if anything changed
                if (changed) {
                    for (Movie movie : moviesToEdit) {
                        movie.writeNFO();
                        movie.saveToDb();
                    }
                    // if configured - sync with trakt.tv
                    if (MovieModuleManager.MOVIE_SETTINGS.getSyncTrakt()) {
                        TmmTask task = new SyncTraktTvTask(moviesToEdit, null);
                        TmmTaskManager.getInstance().addUnnamedTask(task);
                    }
                }
            }
        });
    }

    {
        setMovieSets();
        moviesToEdit = movies;

        PropertyChangeListener listener = new PropertyChangeListener() {
            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                if ("addedMovieSet".equals(evt.getPropertyName())) {
                    setMovieSets();
                }
            }
        };
        movieList.addPropertyChangeListener(listener);
    }
}

From source file:org.jax.maanova.fit.gui.ResidualPlotPanel.java

/**
 * Constructor/*w w w.  j  a va2s  . c o m*/
 * @param parent
 *          the parent frame
 * @param fitMaanovaResult
 *          the fitmaanova result that we'll plot residuals for
 */
public ResidualPlotPanel(JFrame parent, FitMaanovaResult fitMaanovaResult) {
    this.chartConfigurationDialog = new SimpleChartConfigurationDialog(parent);
    this.chartConfigurationDialog.addOkActionListener(new ActionListener() {
        /**
         * {@inheritDoc}
         */
        public void actionPerformed(ActionEvent e) {
            ResidualPlotPanel.this.updateDataPoints();
        }
    });

    this.fitMaanovaResult = fitMaanovaResult;
    this.dyeCount = this.fitMaanovaResult.getParentExperiment().getDyeCount();
    this.arrayCount = this.fitMaanovaResult.getParentExperiment().getMicroarrayCount();

    this.setLayout(new BorderLayout());

    JPanel chartAndControlPanel = new JPanel(new BorderLayout());
    this.add(chartAndControlPanel, BorderLayout.CENTER);

    this.chartPanel = new MaanovaChartPanel();
    this.chartPanel.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    this.chartPanel.addComponentListener(this.chartComponentListener);
    this.chartPanel.addAreaSelectionListener(this.areaSelectionListener);
    this.chartPanel.addMouseListener(this.chartMouseListener);
    this.chartPanel.addMouseMotionListener(this.myMouseMotionListener);
    this.chartPanel.setLayout(null);
    chartAndControlPanel.add(this.chartPanel, BorderLayout.CENTER);

    ItemListener updateDataItemListener = new ItemListener() {
        /**
         * {@inheritDoc}
         */
        public void itemStateChanged(ItemEvent e) {
            ResidualPlotPanel.this.forgetGraphState();
            ResidualPlotPanel.this.updateDataPoints();
        }
    };

    if (this.dyeCount <= 1) {
        this.controlPanel = null;
        this.dyeComboBox = null;
    } else {
        this.dyeComboBox = new JComboBox();
        for (int i = 0; i < this.dyeCount; i++) {
            this.dyeComboBox.addItem("Dye #" + (i + 1));
        }
        this.dyeComboBox.addItemListener(updateDataItemListener);

        this.controlPanel = new JPanel(new FlowLayout());
        this.controlPanel.add(this.dyeComboBox);
        chartAndControlPanel.add(this.controlPanel, BorderLayout.NORTH);
    }

    this.add(this.createMenu(), BorderLayout.NORTH);

    this.forgetGraphState();
    this.updateDataPoints();

    this.toolTip = new JToolTip();
}

From source file:org.jax.maanova.madata.gui.ArrayScatterPlotPanel.java

/**
 * Constructor//from   w w  w.j av a 2  s.  c  o  m
 * @param parent
 *          the parent frame
 * @param experiment
 *          the microarray experiment that we're going to be plotting data
 *          for
 */
public ArrayScatterPlotPanel(JFrame parent, MicroarrayExperiment experiment) {
    this.chartConfigurationDialog = new SimpleChartConfigurationDialog(parent);
    this.chartConfigurationDialog.addOkActionListener(new ActionListener() {
        /**
         * {@inheritDoc}
         */
        public void actionPerformed(ActionEvent e) {
            ArrayScatterPlotPanel.this.updateDataPoints();
        }
    });

    this.experiment = experiment;
    this.dyeCount = experiment.getDyeCount();

    this.setLayout(new BorderLayout());

    JPanel chartAndControlPanel = new JPanel(new BorderLayout());
    this.add(chartAndControlPanel, BorderLayout.CENTER);

    this.chartPanel = new MaanovaChartPanel();
    this.chartPanel.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    this.chartPanel.addMouseMotionListener(this.myMouseMotionListener);
    this.chartPanel.addMouseListener(this.chartMouseListener);
    this.chartPanel.addComponentListener(this.chartComponentListener);
    this.chartPanel.addAreaSelectionListener(this.areaSelectionListener);
    this.chartPanel.setLayout(null);
    chartAndControlPanel.add(this.chartPanel, BorderLayout.CENTER);

    ItemListener updateDataItemListener = new ItemListener() {
        /**
         * {@inheritDoc}
         */
        public void itemStateChanged(ItemEvent e) {
            ArrayScatterPlotPanel.this.forgetGraphState();
            ArrayScatterPlotPanel.this.updateDataPoints();
        }
    };

    this.array1ComboBox = this.initializeArrayComboBox(this.dyeCount);
    this.array1ComboBox.addItemListener(updateDataItemListener);
    this.array2ComboBox = this.initializeArrayComboBox(this.dyeCount);
    this.array2ComboBox.setSelectedIndex(1);
    this.array2ComboBox.addItemListener(updateDataItemListener);

    this.controlPanel = new JPanel(new FlowLayout());
    this.controlPanel.add(this.array1ComboBox);
    this.controlPanel.add(new JLabel("vs."));
    this.controlPanel.add(this.array2ComboBox);
    chartAndControlPanel.add(this.controlPanel, BorderLayout.NORTH);

    this.add(this.createMenu(), BorderLayout.NORTH);

    this.forgetGraphState();
    this.updateDataPoints();

    this.toolTip = new JToolTip();
}