Example usage for java.awt FlowLayout LEFT

List of usage examples for java.awt FlowLayout LEFT

Introduction

In this page you can find the example usage for java.awt FlowLayout LEFT.

Prototype

int LEFT

To view the source code for java.awt FlowLayout LEFT.

Click Source Link

Document

This value indicates that each row of components should be left-justified.

Usage

From source file:org.apache.jmeter.protocol.http.config.gui.UrlConfigGuiClassifier.java

protected JPanel getProtocolAndMethodPanel() {

    // Implementation

    if (showImplementation) {
        httpImplementation = new JLabeledChoice(JMeterUtils.getResString("http_implementation"), // $NON-NLS-1$
                HTTPSamplerFactory.getImplementations());
        httpImplementation.addValue("");
    }/*from  ww  w .j  a v a2s .  com*/
    // PROTOCOL
    protocol = new JTextField(4);
    JLabel protocolLabel = new JLabel(JMeterUtils.getResString("protocol")); // $NON-NLS-1$
    protocolLabel.setLabelFor(protocol);

    // CONTENT_ENCODING
    contentEncoding = new JTextField(10);
    JLabel contentEncodingLabel = new JLabel(JMeterUtils.getResString("content_encoding")); // $NON-NLS-1$
    contentEncodingLabel.setLabelFor(contentEncoding);

    if (notConfigOnly) {
        method = new JLabeledChoice(JMeterUtils.getResString("method"), // $NON-NLS-1$
                HTTPSamplerBase.getValidMethodsAsArray());
    }

    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));

    if (showImplementation) {
        panel.add(httpImplementation);
    }
    panel.add(protocolLabel);
    panel.add(protocol);
    panel.add(Box.createHorizontalStrut(5));

    if (notConfigOnly) {
        panel.add(method);
    }
    panel.setMinimumSize(panel.getPreferredSize());
    panel.add(Box.createHorizontalStrut(5));

    panel.add(contentEncodingLabel);
    panel.add(contentEncoding);
    panel.setMinimumSize(panel.getPreferredSize());
    return panel;
}

From source file:org.yccheok.jstock.gui.MainFrame.java

/** This method is called from within the constructor to
 * initialize the form.//from   w w w  . j a v  a  2 s . c  om
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    buttonGroup1 = new javax.swing.ButtonGroup();
    buttonGroup2 = new javax.swing.ButtonGroup();
    buttonGroup3 = new javax.swing.ButtonGroup();
    jComboBox1 = new AutoCompleteJComboBox();
    jPanel6 = new javax.swing.JPanel();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel8 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jPanel10 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jMenuBar2 = new javax.swing.JMenuBar();
    jMenu3 = new javax.swing.JMenu();
    jMenuItem2 = new javax.swing.JMenuItem();
    jMenuItem9 = new javax.swing.JMenuItem();
    jSeparator7 = new javax.swing.JPopupMenu.Separator();
    jMenuItem11 = new javax.swing.JMenuItem();
    jMenuItem10 = new javax.swing.JMenuItem();
    jSeparator8 = new javax.swing.JPopupMenu.Separator();
    jMenuItem1 = new javax.swing.JMenuItem();
    jMenu5 = new javax.swing.JMenu();
    jMenuItem4 = new javax.swing.JMenuItem();
    jMenuItem7 = new javax.swing.JMenuItem();
    jSeparator4 = new javax.swing.JPopupMenu.Separator();
    jMenuItem15 = new javax.swing.JMenuItem();
    jMenu6 = new javax.swing.JMenu();
    jMenu10 = new javax.swing.JMenu();
    jRadioButtonMenuItem1 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem2 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem4 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem6 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem3 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem5 = new javax.swing.JRadioButtonMenuItem();
    jMenu7 = new javax.swing.JMenu();
    jMenuItem8 = new javax.swing.JMenuItem();
    jMenu9 = new javax.swing.JMenu();
    jMenu8 = new javax.swing.JMenu();
    jMenu1 = new javax.swing.JMenu();
    jMenuItem6 = new javax.swing.JMenuItem();
    jMenu4 = new javax.swing.JMenu();
    jMenu2 = new javax.swing.JMenu();
    jMenuItem3 = new javax.swing.JMenuItem();
    jMenuItem16 = new javax.swing.JMenuItem();
    jMenuItem12 = new javax.swing.JMenuItem();
    jSeparator6 = new javax.swing.JPopupMenu.Separator();
    jMenuItem13 = new javax.swing.JMenuItem();
    jMenuItem14 = new javax.swing.JMenuItem();
    jSeparator5 = new javax.swing.JPopupMenu.Separator();
    jMenuItem5 = new javax.swing.JMenuItem();
    jMenu11 = new javax.swing.JMenu();
    jMenuItem17 = new javax.swing.JMenuItem();

    jComboBox1.setEditable(true);
    jComboBox1.setPreferredSize(new java.awt.Dimension(150, 24));
    ((AutoCompleteJComboBox) this.jComboBox1).attachStockInfoObserver(getStockInfoObserver());
    ((AutoCompleteJComboBox) this.jComboBox1).attachResultObserver(getResultObserver());
    ((AutoCompleteJComboBox) this.jComboBox1).attachMatchObserver(getMatchObserver());

    setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
    java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/yccheok/jstock/data/gui"); // NOI18N
    setTitle(bundle.getString("MainFrame_Application_Title")); // NOI18N
    setIconImage(getMyIconImage());
    addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            formMouseClicked(evt);
        }
    });
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosed(java.awt.event.WindowEvent evt) {
            formWindowClosed(evt);
        }

        public void windowClosing(java.awt.event.WindowEvent evt) {
            formWindowClosing(evt);
        }

        public void windowDeiconified(java.awt.event.WindowEvent evt) {
            formWindowDeiconified(evt);
        }

        public void windowIconified(java.awt.event.WindowEvent evt) {
            formWindowIconified(evt);
        }
    });
    getContentPane().setLayout(new java.awt.BorderLayout(5, 5));

    jPanel6.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    jPanel6.setLayout(new java.awt.BorderLayout(5, 5));
    this.jPanel6.add(statusBar, java.awt.BorderLayout.SOUTH);
    getContentPane().add(jPanel6, java.awt.BorderLayout.SOUTH);

    jTabbedPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            jTabbedPane1StateChanged(evt);
        }
    });

    jPanel8.setLayout(new java.awt.BorderLayout(5, 5));

    jTable1.setAutoCreateRowSorter(true);
    jTable1.setFont(jTable1.getFont().deriveFont(jTable1.getFont().getStyle() | java.awt.Font.BOLD,
            jTable1.getFont().getSize() + 1));
    jTable1.setModel(new StockTableModel());
    jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    this.jTable1.setDefaultRenderer(Number.class, new StockTableCellRenderer(SwingConstants.RIGHT));
    this.jTable1.setDefaultRenderer(Double.class, new StockTableCellRenderer(SwingConstants.RIGHT));
    this.jTable1.setDefaultRenderer(Object.class, new StockTableCellRenderer(SwingConstants.LEFT));

    this.jTable1.setDefaultEditor(Double.class, new NonNegativeDoubleEditor());

    this.jTable1.getModel().addTableModelListener(this.getTableModelListener());

    this.jTable1.getTableHeader().addMouseListener(new TableColumnSelectionPopupListener(1));
    this.jTable1.addMouseListener(new TableRowPopupListener());
    this.jTable1.addKeyListener(new TableKeyEventListener());
    jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyPressed(java.awt.event.KeyEvent evt) {
            jTable1KeyPressed(evt);
        }
    });
    jScrollPane1.setViewportView(jTable1);

    jPanel8.add(jScrollPane1, java.awt.BorderLayout.CENTER);

    jLabel1.setText(bundle.getString("MainFrame_Stock")); // NOI18N
    jPanel1.add(jLabel1);

    jPanel8.add(jPanel1, java.awt.BorderLayout.NORTH);

    jPanel10.setPreferredSize(new java.awt.Dimension(328, 170));
    jPanel10.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 10, 5));

    jPanel3.setBackground(new java.awt.Color(255, 255, 255));
    jPanel3.setPreferredSize(new java.awt.Dimension(170, 160));
    jPanel3.setBorder(new org.jdesktop.swingx.border.DropShadowBorder(true));
    jPanel3.setLayout(new java.awt.BorderLayout());
    jPanel10.add(jPanel3);
    EMPTY_DYNAMIC_CHART.getChartPanel().addMouseListener(dynamicChartMouseAdapter);
    jPanel3.add(EMPTY_DYNAMIC_CHART.getChartPanel(), java.awt.BorderLayout.CENTER);

    jPanel8.add(jPanel10, java.awt.BorderLayout.SOUTH);

    jTabbedPane1.addTab(bundle.getString("MainFrame_Title"), jPanel8); // NOI18N

    getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER);

    jPanel2.setLayout(new java.awt.GridLayout(2, 1));
    getContentPane().add(jPanel2, java.awt.BorderLayout.NORTH);

    jMenu3.setText(bundle.getString("MainFrame_File")); // NOI18N

    jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/project_open.png"))); // NOI18N
    jMenuItem2.setText(bundle.getString("MainFrame_Open...")); // NOI18N
    jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem2ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem2);

    jMenuItem9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/filesave.png"))); // NOI18N
    jMenuItem9.setText(bundle.getString("MainFrame_SaveAs...")); // NOI18N
    jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem9ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem9);
    jMenu3.add(jSeparator7);

    jMenuItem11.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/images/16x16/download_from_cloud.png"))); // NOI18N
    jMenuItem11.setText(bundle.getString("MainFrame_OpenFromCloud...")); // NOI18N
    jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem11ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem11);

    jMenuItem10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/upload_to_cloud.png"))); // NOI18N
    jMenuItem10.setText(bundle.getString("MainFrame_SaveToCloud...")); // NOI18N
    jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem10ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem10);
    jMenu3.add(jSeparator8);

    jMenuItem1.setText(bundle.getString("MainFrame_Exit")); // NOI18N
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem1);

    jMenuBar2.add(jMenu3);

    jMenu5.setText(bundle.getString("MainFrame_Edit")); // NOI18N

    jMenuItem4.setText(bundle.getString("MainFrame_AddStocks...")); // NOI18N
    jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem4ActionPerformed(evt);
        }
    });
    jMenu5.add(jMenuItem4);

    jMenuItem7.setText(bundle.getString("MainFrame_ClearAllStocks")); // NOI18N
    jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem7ActionPerformed(evt);
        }
    });
    jMenu5.add(jMenuItem7);
    jMenu5.add(jSeparator4);

    jMenuItem15.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem15.setText(bundle.getString("MainFrame_RefreshStockPrices")); // NOI18N
    jMenuItem15.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem15ActionPerformed(evt);
        }
    });
    jMenu5.add(jMenuItem15);

    jMenuBar2.add(jMenu5);

    jMenu6.setText(bundle.getString("MainFrame_Country")); // NOI18N
    jMenuBar2.add(jMenu6);

    jMenu10.setText(bundle.getString("MainFrame_Language")); // NOI18N

    buttonGroup3.add(jRadioButtonMenuItem1);
    jRadioButtonMenuItem1.setSelected(true);
    jRadioButtonMenuItem1.setText(Locale.ENGLISH.getDisplayLanguage(Locale.getDefault()));
    jRadioButtonMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem1ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem1);

    buttonGroup3.add(jRadioButtonMenuItem2);
    jRadioButtonMenuItem2.setText(Locale.SIMPLIFIED_CHINESE.getDisplayName(Locale.getDefault()));
    jRadioButtonMenuItem2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem2ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem2);

    buttonGroup3.add(jRadioButtonMenuItem4);
    jRadioButtonMenuItem4.setText(Locale.TRADITIONAL_CHINESE.getDisplayName(Locale.getDefault()));
    jRadioButtonMenuItem4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem4ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem4);

    buttonGroup3.add(jRadioButtonMenuItem6);
    jRadioButtonMenuItem6.setText(Locale.FRENCH.getDisplayLanguage(Locale.getDefault()));
    jRadioButtonMenuItem6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem6ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem6);

    buttonGroup3.add(jRadioButtonMenuItem3);
    jRadioButtonMenuItem3.setText(Locale.GERMAN.getDisplayLanguage(Locale.getDefault()));
    jRadioButtonMenuItem3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem3ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem3);

    buttonGroup3.add(jRadioButtonMenuItem5);
    jRadioButtonMenuItem5.setText(Locale.ITALIAN.getDisplayLanguage(Locale.getDefault()));
    jRadioButtonMenuItem5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem5ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem5);

    jMenuBar2.add(jMenu10);

    jMenu7.setText(bundle.getString("MainFrame_Database")); // NOI18N

    jMenuItem8.setText(bundle.getString("MainFrame_StockDatabase...")); // NOI18N
    jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem8ActionPerformed(evt);
        }
    });
    jMenu7.add(jMenuItem8);

    jMenuBar2.add(jMenu7);

    jMenu9.setText(bundle.getString("MainFrame_Watchlist")); // NOI18N
    jMenu9.addMenuListener(new javax.swing.event.MenuListener() {
        public void menuCanceled(javax.swing.event.MenuEvent evt) {
        }

        public void menuDeselected(javax.swing.event.MenuEvent evt) {
        }

        public void menuSelected(javax.swing.event.MenuEvent evt) {
            jMenu9MenuSelected(evt);
        }
    });
    jMenuBar2.add(jMenu9);

    jMenu8.setText(bundle.getString("MainFrame_Portfolio")); // NOI18N
    jMenu8.addMenuListener(new javax.swing.event.MenuListener() {
        public void menuCanceled(javax.swing.event.MenuEvent evt) {
        }

        public void menuDeselected(javax.swing.event.MenuEvent evt) {
        }

        public void menuSelected(javax.swing.event.MenuEvent evt) {
            jMenu8MenuSelected(evt);
        }
    });
    jMenuBar2.add(jMenu8);

    jMenu1.setText(bundle.getString("MainFrame_Options")); // NOI18N

    jMenuItem6.setText(bundle.getString("MainFrame_Options...")); // NOI18N
    jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem6ActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItem6);

    jMenuBar2.add(jMenu1);

    jMenu4.setText(bundle.getString("MainFrame_LooknFeel")); // NOI18N
    jMenuBar2.add(jMenu4);

    jMenu2.setText(bundle.getString("MainFrame_Help")); // NOI18N

    jMenuItem3.setText(bundle.getString("MainFrame_OnlineHelp")); // NOI18N
    jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem3ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem3);

    jMenuItem16.setText(bundle.getString("MainFrame_KeyboardShortcuts")); // NOI18N
    jMenuItem16.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem16ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem16);

    jMenuItem12.setText(bundle.getString("MainFrame_Calculator")); // NOI18N
    jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem12ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem12);
    jMenu2.add(jSeparator6);

    jMenuItem13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/smile2.png"))); // NOI18N
    jMenuItem13.setText(bundle.getString("MainFrame_DonateToJStock")); // NOI18N
    jMenuItem13.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem13ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem13);

    jMenuItem14.setText(bundle.getString("MainFrame_ContributeToJStock")); // NOI18N
    jMenuItem14.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem14ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem14);
    jMenu2.add(jSeparator5);

    jMenuItem5.setText(bundle.getString("MainFrame_About...")); // NOI18N
    jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem5ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem5);

    jMenuBar2.add(jMenu2);

    jMenu11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/android-small.png"))); // NOI18N
    jMenu11.setText(bundle.getString("MainFrame_Android")); // NOI18N
    jMenu11.setFont(jMenu11.getFont().deriveFont(jMenu11.getFont().getStyle() | java.awt.Font.BOLD));

    jMenuItem17.setText(bundle.getString("MainFrame_DownloadJStockAndroid")); // NOI18N
    jMenuItem17.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem17ActionPerformed(evt);
        }
    });
    jMenu11.add(jMenuItem17);

    jMenuBar2.add(jMenu11);

    setJMenuBar(jMenuBar2);

    setSize(new java.awt.Dimension(952, 478));
    setLocationRelativeTo(null);
}

From source file:org.yccheok.jstock.gui.JStock.java

/** This method is called from within the constructor to
 * initialize the form.//from   ww  w  .  j  av  a  2s .co  m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    buttonGroup1 = new javax.swing.ButtonGroup();
    buttonGroup2 = new javax.swing.ButtonGroup();
    buttonGroup3 = new javax.swing.ButtonGroup();
    buttonGroup4 = new javax.swing.ButtonGroup();
    jComboBox1 = new AutoCompleteJComboBox();
    jPanel6 = new javax.swing.JPanel();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel8 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jPanel10 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jMenuBar2 = new javax.swing.JMenuBar();
    jMenu3 = new javax.swing.JMenu();
    jMenuItem2 = new javax.swing.JMenuItem();
    jMenuItem9 = new javax.swing.JMenuItem();
    jSeparator7 = new javax.swing.JPopupMenu.Separator();
    jMenuItem11 = new javax.swing.JMenuItem();
    jMenuItem10 = new javax.swing.JMenuItem();
    jSeparator8 = new javax.swing.JPopupMenu.Separator();
    jMenuItem1 = new javax.swing.JMenuItem();
    jMenu5 = new javax.swing.JMenu();
    jMenuItem4 = new javax.swing.JMenuItem();
    jMenuItem7 = new javax.swing.JMenuItem();
    jSeparator4 = new javax.swing.JPopupMenu.Separator();
    jMenuItem15 = new javax.swing.JMenuItem();
    jMenu6 = new javax.swing.JMenu();
    jMenu10 = new javax.swing.JMenu();
    jRadioButtonMenuItem1 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem2 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem4 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem6 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem3 = new javax.swing.JRadioButtonMenuItem();
    jRadioButtonMenuItem5 = new javax.swing.JRadioButtonMenuItem();
    jMenu7 = new javax.swing.JMenu();
    jMenuItem8 = new javax.swing.JMenuItem();
    jMenu9 = new javax.swing.JMenu();
    jMenu8 = new javax.swing.JMenu();
    jMenu1 = new javax.swing.JMenu();
    jMenuItem6 = new javax.swing.JMenuItem();
    jMenu4 = new javax.swing.JMenu();
    jMenu2 = new javax.swing.JMenu();
    jMenuItem3 = new javax.swing.JMenuItem();
    jMenuItem16 = new javax.swing.JMenuItem();
    jMenuItem12 = new javax.swing.JMenuItem();
    jSeparator6 = new javax.swing.JPopupMenu.Separator();
    jMenuItem13 = new javax.swing.JMenuItem();
    jMenuItem14 = new javax.swing.JMenuItem();
    jSeparator5 = new javax.swing.JPopupMenu.Separator();
    jMenuItem5 = new javax.swing.JMenuItem();
    jMenu11 = new javax.swing.JMenu();
    jMenuItem17 = new javax.swing.JMenuItem();

    jComboBox1.setEditable(true);
    jComboBox1.setPreferredSize(new java.awt.Dimension(150, 24));
    ((AutoCompleteJComboBox) this.jComboBox1).attachStockInfoObserver(getStockInfoObserver());
    ((AutoCompleteJComboBox) this.jComboBox1).attachDispObserver(getDispObserver());

    setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
    java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/yccheok/jstock/data/gui"); // NOI18N
    setTitle(bundle.getString("MainFrame_Application_Title")); // NOI18N
    setIconImage(getMyIconImage());
    addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            formMouseClicked(evt);
        }
    });
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosed(java.awt.event.WindowEvent evt) {
            formWindowClosed(evt);
        }

        public void windowClosing(java.awt.event.WindowEvent evt) {
            formWindowClosing(evt);
        }

        public void windowDeiconified(java.awt.event.WindowEvent evt) {
            formWindowDeiconified(evt);
        }

        public void windowIconified(java.awt.event.WindowEvent evt) {
            formWindowIconified(evt);
        }
    });
    getContentPane().setLayout(new java.awt.BorderLayout(5, 5));

    jPanel6.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    jPanel6.setLayout(new java.awt.BorderLayout(5, 5));
    this.jPanel6.add(statusBar, java.awt.BorderLayout.SOUTH);
    getContentPane().add(jPanel6, java.awt.BorderLayout.SOUTH);

    jTabbedPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            jTabbedPane1StateChanged(evt);
        }
    });

    jPanel8.setLayout(new java.awt.BorderLayout(5, 5));

    jTable1.setAutoCreateRowSorter(true);
    jTable1.setFont(jTable1.getFont().deriveFont(jTable1.getFont().getStyle() | java.awt.Font.BOLD,
            jTable1.getFont().getSize() + 1));
    jTable1.setModel(new StockTableModel());
    jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    this.jTable1.setDefaultRenderer(Number.class, new StockTableCellRenderer(SwingConstants.RIGHT));
    this.jTable1.setDefaultRenderer(Double.class, new StockTableCellRenderer(SwingConstants.RIGHT));
    this.jTable1.setDefaultRenderer(Object.class, new StockTableCellRenderer(SwingConstants.LEFT));

    this.jTable1.setDefaultEditor(Double.class, new NonNegativeDoubleEditor());

    this.jTable1.getModel().addTableModelListener(this.getTableModelListener());

    this.jTable1.getTableHeader().addMouseListener(new TableColumnSelectionPopupListener(1));
    this.jTable1.addMouseListener(new TableMouseAdapter());
    this.jTable1.addKeyListener(new TableKeyEventListener());

    if (jStockOptions.useLargeFont()) {
        this.jTable1.setRowHeight((int) (this.jTable1.getRowHeight() * Constants.FONT_ENLARGE_FACTOR));
    }
    jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyPressed(java.awt.event.KeyEvent evt) {
            jTable1KeyPressed(evt);
        }
    });
    jScrollPane1.setViewportView(jTable1);

    jPanel8.add(jScrollPane1, java.awt.BorderLayout.CENTER);

    jLabel1.setText(bundle.getString("MainFrame_Stock")); // NOI18N
    jPanel1.add(jLabel1);

    jPanel8.add(jPanel1, java.awt.BorderLayout.NORTH);

    jPanel10.setPreferredSize(new java.awt.Dimension(328, 170));
    jPanel10.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 10, 5));

    jPanel3.setBackground(new java.awt.Color(255, 255, 255));
    jPanel3.setPreferredSize(new java.awt.Dimension(170, 160));
    jPanel3.setBorder(new org.jdesktop.swingx.border.DropShadowBorder(true));
    jPanel3.setLayout(new java.awt.BorderLayout());
    jPanel10.add(jPanel3);
    EMPTY_DYNAMIC_CHART.getChartPanel().addMouseListener(dynamicChartMouseAdapter);
    jPanel3.add(EMPTY_DYNAMIC_CHART.getChartPanel(), java.awt.BorderLayout.CENTER);

    jPanel8.add(jPanel10, java.awt.BorderLayout.SOUTH);

    jTabbedPane1.addTab(bundle.getString("MainFrame_Title"), jPanel8); // NOI18N

    getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER);

    jPanel2.setLayout(new java.awt.GridLayout(2, 1));
    getContentPane().add(jPanel2, java.awt.BorderLayout.NORTH);

    jMenu3.setText(bundle.getString("MainFrame_File")); // NOI18N

    jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/project_open.png"))); // NOI18N
    jMenuItem2.setText(bundle.getString("MainFrame_Open...")); // NOI18N
    jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem2ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem2);

    jMenuItem9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/filesave.png"))); // NOI18N
    jMenuItem9.setText(bundle.getString("MainFrame_SaveAs...")); // NOI18N
    jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem9ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem9);
    jMenu3.add(jSeparator7);

    jMenuItem11.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/images/16x16/download_from_cloud.png"))); // NOI18N
    jMenuItem11.setText(bundle.getString("MainFrame_OpenFromCloud...")); // NOI18N
    jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem11ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem11);

    jMenuItem10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/upload_to_cloud.png"))); // NOI18N
    jMenuItem10.setText(bundle.getString("MainFrame_SaveToCloud...")); // NOI18N
    jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem10ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem10);
    jMenu3.add(jSeparator8);

    jMenuItem1.setText(bundle.getString("MainFrame_Exit")); // NOI18N
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem1);

    jMenuBar2.add(jMenu3);

    jMenu5.setText(bundle.getString("MainFrame_Edit")); // NOI18N

    jMenuItem4.setText(bundle.getString("MainFrame_AddStocks...")); // NOI18N
    jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem4ActionPerformed(evt);
        }
    });
    jMenu5.add(jMenuItem4);

    jMenuItem7.setText(bundle.getString("MainFrame_ClearAllStocks")); // NOI18N
    jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem7ActionPerformed(evt);
        }
    });
    jMenu5.add(jMenuItem7);
    jMenu5.add(jSeparator4);

    jMenuItem15.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem15.setText(bundle.getString("MainFrame_RefreshStockPrices")); // NOI18N
    jMenuItem15.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem15ActionPerformed(evt);
        }
    });
    jMenu5.add(jMenuItem15);

    jMenuBar2.add(jMenu5);

    jMenu6.setText(bundle.getString("MainFrame_Country")); // NOI18N
    jMenu6.addMenuListener(new javax.swing.event.MenuListener() {
        public void menuCanceled(javax.swing.event.MenuEvent evt) {
        }

        public void menuDeselected(javax.swing.event.MenuEvent evt) {
        }

        public void menuSelected(javax.swing.event.MenuEvent evt) {
            jMenu6MenuSelected(evt);
        }
    });
    jMenuBar2.add(jMenu6);

    jMenu10.setText(bundle.getString("MainFrame_Language")); // NOI18N

    buttonGroup3.add(jRadioButtonMenuItem1);
    jRadioButtonMenuItem1.setSelected(true);
    jRadioButtonMenuItem1.setText(Locale.ENGLISH.getDisplayLanguage(Locale.getDefault()));
    jRadioButtonMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem1ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem1);

    buttonGroup3.add(jRadioButtonMenuItem2);
    jRadioButtonMenuItem2.setText(Locale.SIMPLIFIED_CHINESE.getDisplayName(Locale.getDefault()));
    jRadioButtonMenuItem2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem2ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem2);

    buttonGroup3.add(jRadioButtonMenuItem4);
    jRadioButtonMenuItem4.setText(Locale.TRADITIONAL_CHINESE.getDisplayName(Locale.getDefault()));
    jRadioButtonMenuItem4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem4ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem4);

    buttonGroup3.add(jRadioButtonMenuItem6);
    jRadioButtonMenuItem6.setText(Locale.FRENCH.getDisplayLanguage(Locale.getDefault()));
    jRadioButtonMenuItem6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem6ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem6);

    buttonGroup3.add(jRadioButtonMenuItem3);
    jRadioButtonMenuItem3.setText(Locale.GERMAN.getDisplayLanguage(Locale.getDefault()));
    jRadioButtonMenuItem3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem3ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem3);

    buttonGroup3.add(jRadioButtonMenuItem5);
    jRadioButtonMenuItem5.setText(Locale.ITALIAN.getDisplayLanguage(Locale.getDefault()));
    jRadioButtonMenuItem5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRadioButtonMenuItem5ActionPerformed(evt);
        }
    });
    jMenu10.add(jRadioButtonMenuItem5);

    jMenuBar2.add(jMenu10);

    jMenu7.setText(bundle.getString("MainFrame_Database")); // NOI18N

    jMenuItem8.setText(bundle.getString("MainFrame_StockDatabase...")); // NOI18N
    jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem8ActionPerformed(evt);
        }
    });
    jMenu7.add(jMenuItem8);

    jMenuBar2.add(jMenu7);

    jMenu9.setText(bundle.getString("MainFrame_Watchlist")); // NOI18N
    jMenu9.addMenuListener(new javax.swing.event.MenuListener() {
        public void menuCanceled(javax.swing.event.MenuEvent evt) {
        }

        public void menuDeselected(javax.swing.event.MenuEvent evt) {
        }

        public void menuSelected(javax.swing.event.MenuEvent evt) {
            jMenu9MenuSelected(evt);
        }
    });
    jMenuBar2.add(jMenu9);

    jMenu8.setText(bundle.getString("MainFrame_Portfolio")); // NOI18N
    jMenu8.addMenuListener(new javax.swing.event.MenuListener() {
        public void menuCanceled(javax.swing.event.MenuEvent evt) {
        }

        public void menuDeselected(javax.swing.event.MenuEvent evt) {
        }

        public void menuSelected(javax.swing.event.MenuEvent evt) {
            jMenu8MenuSelected(evt);
        }
    });
    jMenuBar2.add(jMenu8);

    jMenu1.setText(bundle.getString("MainFrame_Options")); // NOI18N

    jMenuItem6.setText(bundle.getString("MainFrame_Options...")); // NOI18N
    jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem6ActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItem6);

    jMenuBar2.add(jMenu1);

    jMenu4.setText(bundle.getString("MainFrame_LooknFeel")); // NOI18N
    jMenuBar2.add(jMenu4);

    jMenu2.setText(bundle.getString("MainFrame_Help")); // NOI18N

    jMenuItem3.setText(bundle.getString("MainFrame_OnlineHelp")); // NOI18N
    jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem3ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem3);

    jMenuItem16.setText(bundle.getString("MainFrame_KeyboardShortcuts")); // NOI18N
    jMenuItem16.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem16ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem16);

    jMenuItem12.setText(bundle.getString("MainFrame_Calculator")); // NOI18N
    jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem12ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem12);
    jMenu2.add(jSeparator6);

    jMenuItem13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/smile2.png"))); // NOI18N
    jMenuItem13.setText(bundle.getString("MainFrame_DonateToJStock")); // NOI18N
    jMenuItem13.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem13ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem13);

    jMenuItem14.setText(bundle.getString("MainFrame_ContributeToJStock")); // NOI18N
    jMenuItem14.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem14ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem14);
    jMenu2.add(jSeparator5);

    jMenuItem5.setText(bundle.getString("MainFrame_About...")); // NOI18N
    jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem5ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem5);

    jMenuBar2.add(jMenu2);

    jMenu11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/android-small.png"))); // NOI18N
    jMenu11.setText(bundle.getString("MainFrame_Android")); // NOI18N
    jMenu11.setFont(jMenu11.getFont().deriveFont(jMenu11.getFont().getStyle() | java.awt.Font.BOLD));

    jMenuItem17.setText(bundle.getString("MainFrame_DownloadJStockAndroid")); // NOI18N
    jMenuItem17.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem17ActionPerformed(evt);
        }
    });
    jMenu11.add(jMenuItem17);

    jMenuBar2.add(jMenu11);

    setJMenuBar(jMenuBar2);

    setSize(new java.awt.Dimension(952, 478));
    setLocationRelativeTo(null);
}

From source file:org.apache.jmeter.protocol.http.config.gui.UrlConfigGui.java

protected JPanel getProtocolAndMethodPanel() {

    // Implementation
    if (showImplementation) {
        httpImplementation = new JLabeledChoice(JMeterUtils.getResString("http_implementation"), // $NON-NLS-1$
                HTTPSamplerFactory.getImplementations());
        httpImplementation.addValue("");
    }/* www  . ja va 2 s .c  o  m*/

    // PROTOCOL
    protocol = new JTextField(4);
    JLabel protocolLabel = new JLabel(JMeterUtils.getResString("protocol")); // $NON-NLS-1$
    protocolLabel.setLabelFor(protocol);

    // CONTENT_ENCODING
    contentEncoding = new JTextField(10);
    JLabel contentEncodingLabel = new JLabel(JMeterUtils.getResString("content_encoding")); // $NON-NLS-1$
    contentEncodingLabel.setLabelFor(contentEncoding);

    if (notConfigOnly) {
        method = new JLabeledChoice(JMeterUtils.getResString("method"), // $NON-NLS-1$
                HTTPSamplerBase.getValidMethodsAsArray(), true, false);
        method.addChangeListener(this);
    }

    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));

    if (showImplementation) {
        panel.add(httpImplementation);
    }
    panel.add(protocolLabel);
    panel.add(protocol);
    panel.add(Box.createHorizontalStrut(5));

    if (notConfigOnly) {
        panel.add(method);
    }
    panel.setMinimumSize(panel.getPreferredSize());
    panel.add(Box.createHorizontalStrut(5));

    panel.add(contentEncodingLabel);
    panel.add(contentEncoding);
    panel.setMinimumSize(panel.getPreferredSize());
    return panel;
}

From source file:com.josue.tileset.editor.Editor.java

private void mountButtons(List<Tile> tiles, int cols, int rows) {

    imagePanel.removeAll();/*from www .j  ava2 s .  co  m*/
    if (animatedPerformer != null) {
        animatedPerformer.stop();
        animatedPerformer = null;
    }

    imagePanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
    Dimension dimension = new Dimension(cols * TILE_SIZE, rows * TILE_SIZE);

    for (Tile tile : tiles) {
        final JLabel tileLabel = new JLabel();

        tileLabel.setIcon(new ImageIcon(tile.getImage()));
        Dimension labelDimension = new Dimension(TILE_SIZE, TILE_SIZE);
        tileLabel.setMinimumSize(labelDimension);
        tileLabel.setMaximumSize(labelDimension);
        tileLabel.setPreferredSize(labelDimension);
        tileLabel.setSize(labelDimension);
        tileLabel.addMouseListener(new java.awt.event.MouseAdapter() {
            @Override
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                if (SwingUtilities.isRightMouseButton(evt)) {//select animated sequence

                    if (animatedAction.isSelected()) {
                        addAnimatedTile(tile);
                    } else {
                        addLightSourceTile(tile);
                    }

                } else {

                    if (animatedPerformer != null) {
                        animatedPerformer.stop();
                    }
                    Iterator<JLabel> iterator = tileLabels.values().iterator();
                    while (iterator.hasNext()) {
                        JLabel next = iterator.next();
                        next.revalidate();
                    }
                    imagePanel.repaint();
                    for (Map.Entry<Tile, JLabel> entry : tileLabels.entrySet()) {
                        Tile key = entry.getKey();
                        JLabel value = entry.getValue();
                        value.setBorder(null); //clear borders
                    }

                    selectedTile = tile;//this isolate for the next operations
                    tileLabel.setBorder(new LineBorder(Color.RED, 2));

                    previewLabel.setIcon(new ImageIcon(tile.getImage()));
                    animatedTb.setSelected(selectedTile.isAnimated());
                    lightTb.setSelected(selectedTile.isLight());
                    solidTb.setSelected(selectedTile.isSolid());

                    if (tile.isAnimated()) {

                        for (Integer animatesTileOffset : selectedTile.getAnimation().getAnimatedSequence()) { //display animated borders
                            for (Map.Entry<Tile, JLabel> entry : tileLabels.entrySet()) {
                                Tile key = entry.getKey();
                                JLabel value = entry.getValue();
                                if (key.getId() == selectedTile.getId() + animatesTileOffset) {
                                    value.setBorder(new LineBorder(Color.BLUE, 2));
                                }
                            }

                        }

                        animatedPerformer = new Timer(
                                (int) (selectedTile.getAnimation().getAnimationInterval()),
                                new TileAnimator(selectedTile, previewLabel, loadedTiles));
                        animatedPerformer.start();
                    }
                    if (selectedTile.isLight()) {//light color has preference
                        for (Tile tile : tiles) {
                            if (tile.getId() == selectedTile.getLightTileId()) {
                                JLabel found = tileLabels.get(tile);
                                found.setBorder(new LineBorder(Color.YELLOW, 2));
                                break;
                            }
                        }

                    }
                }
            }

            @Override
            public void mouseExited(MouseEvent e) {
                if (selectedTile != null && selectedTile.getAnimation() != null && selectedTile.getAnimation()
                        .getAnimatedSequence().contains(tile.getId() - selectedTile.getId())) {
                    tileLabel.setBorder(new LineBorder(Color.BLUE, 2));
                } else if (selectedTile != null && selectedTile.isLight()
                        && selectedTile.getLightTileId() == tile.getId()) {
                    tileLabel.setBorder(new LineBorder(Color.YELLOW, 2));
                } else if (selectedTile != null) {
                    JLabel get = tileLabels.get(selectedTile);
                    if (!get.equals(tileLabel)) { //keep the red border if is the selected
                        tileLabel.setBorder(null);
                    }
                } else {
                    tileLabel.setBorder(null);
                }
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                if (selectedTile != null && selectedTile.getAnimation() != null
                        && !selectedTile.getAnimation().getAnimatedSequence()
                                .contains(tile.getId() - selectedTile.getId())
                        && tile.getLight() != null && tile.getLight().getLightTileOffset() != 0) {
                    tileLabel.setBorder(new LineBorder(Color.RED, 2));
                } else if (selectedTile == null) {
                    tileLabel.setBorder(new LineBorder(Color.RED, 2));
                }
            }
        });
        tileLabels.put(tile, tileLabel);
        imagePanel.add(tileLabel);
    }

    imagePanel.setMaximumSize(dimension);
    imagePanel.setMinimumSize(dimension);
    imagePanel.setPreferredSize(dimension);
    imagePanel.revalidate();
    imagePanel.repaint();
    this.pack();
}

From source file:org.rdv.viz.chart.ChartViz.java

/**
 * Get the component to display the channels in the header of the data panel.
 * This overides the super class implementation to deal with x vs. y plots.
 * /*from  ww  w. j a va2s  .c o m*/
 * @return  the component displaying the channels for the data panel
 */
@Override
protected JComponent getChannelComponent() {
    if (xyMode) {
        int remoteSeries = dataCollection.getSeriesCount() - localSeries;

        if (channels.size() == 0 && localSeries == 0) {
            return null;
        }

        JPanel titleBar = new JPanel();
        titleBar.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
        titleBar.setOpaque(false);

        if (isShowChannelsInTitle()) {
            Iterator<String> i = channels.iterator();
            while (i.hasNext()) {
                String firstChannel = i.next();
                String series = firstChannel;
                if (i.hasNext()) {
                    series += " vs. " + i.next();
                }
                titleBar.add(new ChannelTitle(series, firstChannel));
            }

            for (int j = remoteSeries; j < remoteSeries + localSeries; j++) {
                String seriesName = (String) dataCollection.getSeriesKey(j);
                titleBar.add(new LocalChannelTitle(seriesName));
            }
        }

        return titleBar;
    } else {
        return super.getChannelComponent();
    }
}

From source file:org.apache.taverna.activities.rest.ui.config.RESTActivityConfigurationPanel.java

private JPanel createAdvancedTab() {
    JPanel jpAdvanced = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();

    c.gridx = 0;//from ww  w .j av  a2s.c om
    c.gridy = 0;
    c.anchor = GridBagConstraints.WEST;
    c.fill = GridBagConstraints.BOTH;
    c.insets = new Insets(8, 10, 2, 4);
    JLabel jlExpectHeaderInfoIcon = new JLabel(infoIcon);
    jlExpectHeaderInfoIcon
            .setToolTipText("<html>Ticking this checkbox may significantly improve performance when<br>"
                    + "large volumes of data are sent to the remote server and a redirect<br>"
                    + "from the original URL to the one specified by the server is likely.<br>" + "<br>"
                    + "However, this checkbox <b>must not</b> be ticked to allow this activity<br>"
                    + "to post updates to Twitter.</html>");
    jpAdvanced.add(jlExpectHeaderInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(8, 0, 2, 8);
    cbSendHTTPExpectHeader = new JCheckBox("Send HTTP Expect request-header field");
    jpAdvanced.add(cbSendHTTPExpectHeader, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlShowRedirectionOutputPortInfoIcon = new JLabel(infoIcon);
    jlShowRedirectionOutputPortInfoIcon
            .setToolTipText("<html>\"Redirection\" output port displays the URL of the final redirect<br>"
                    + "that has yielded the output data on the \"Response Body\" port.</html>");
    jpAdvanced.add(jlShowRedirectionOutputPortInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(2, 0, 5, 8);
    cbShowRedirectionOutputPort = new JCheckBox("Show \"Redirection\" output port");
    jpAdvanced.add(cbShowRedirectionOutputPort, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlShowActualUrlPortInfoIcon = new JLabel(infoIcon);
    jlShowActualUrlPortInfoIcon
            .setToolTipText("<html>\"Actual URL\" output port displays the URL used by the REST service<br>"
                    + "with the actual parameter values.</html>");
    jpAdvanced.add(jlShowActualUrlPortInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(2, 0, 5, 8);
    cbShowActualUrlPort = new JCheckBox("Show \"Actual URL\" output port");
    jpAdvanced.add(cbShowActualUrlPort, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlShowResponseHeadersPortInfoIcon = new JLabel(infoIcon);
    jlShowResponseHeadersPortInfoIcon
            .setToolTipText("<html>\"Response headers\" output port displays the HTTP headers<br>"
                    + "received from the final (after redirection) HTTP call.</html>");
    jpAdvanced.add(jlShowResponseHeadersPortInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(2, 0, 5, 8);
    cbShowResponseHeadersPort = new JCheckBox("Show \"Response headers\" output port");
    jpAdvanced.add(cbShowResponseHeadersPort, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlEscapeParametersInfoIcon = new JLabel(infoIcon);
    jlEscapeParametersInfoIcon.setToolTipText("<html>Determines if parameters you pass to form the full URL<br>"
            + " of the REST service will be URL-escaped.</html>");
    jpAdvanced.add(jlEscapeParametersInfoIcon, c);

    c.gridx++;
    c.weightx = 1.0;
    c.insets = new Insets(2, 0, 5, 8);
    cbEscapeParameters = new JCheckBox("Escape URL parameter values");
    jpAdvanced.add(cbEscapeParameters, c);

    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.anchor = GridBagConstraints.WEST;
    c.fill = GridBagConstraints.NONE;
    c.insets = new Insets(2, 10, 5, 4);
    JLabel jlHTTPHeadersInfoIcon = new JLabel(infoIcon);
    jlHTTPHeadersInfoIcon.setToolTipText("<html>Set additional HTTP headers</html>");
    jpAdvanced.add(jlHTTPHeadersInfoIcon, c);

    c.gridx = 1;
    c.weightx = 0;
    c.weighty = 0;
    c.anchor = GridBagConstraints.WEST;
    c.fill = GridBagConstraints.NONE;
    c.insets = new Insets(2, 10, 5, 4);
    addHeaderButton = new JButton("Add HTTP header");
    addHeaderButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            httpHeadersTableModel.addEmptyRow();
            httpHeadersTable.getSelectionModel().setSelectionInterval(httpHeadersTableModel.getRowCount() - 1,
                    httpHeadersTableModel.getRowCount() - 1);
        }
    });
    removeHeaderButton = new JButton("Remove HTTP header");
    removeHeaderButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int row = httpHeadersTable.getSelectedRow();
            httpHeadersTableModel.removeRow(row);
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(addHeaderButton, FlowLayout.LEFT);
    buttonPanel.add(removeHeaderButton);
    jpAdvanced.add(buttonPanel, c);

    c.gridx = 1;
    c.gridy++;
    c.weightx = 0;
    c.weighty = 1.0;
    c.fill = GridBagConstraints.BOTH;
    c.insets = new Insets(2, 10, 5, 4);
    httpHeadersTableModel = new HTTPHeadersTableModel();
    httpHeadersTable = new JTable(httpHeadersTableModel);
    httpHeadersTable.setGridColor(Color.GRAY);
    httpHeadersTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    setVisibleRowCount(httpHeadersTable, 3);
    JScrollPane headersTableScrollPane = new JScrollPane(httpHeadersTable);
    jpAdvanced.add(headersTableScrollPane, c);

    return (jpAdvanced);
}

From source file:us.paulevans.basicxslt.BasicXSLTFrame.java

/**
 * Builds the auto-save panel//from w  ww  .j a v a  2s . co  m
 * @return
 */
private JPanel buildAutosavePanel() {

    int row;
    JPanel buttons;
    JPanel autosavePanel;

    row = 0;
    buttons = new JPanel(new FlowLayout(FlowLayout.LEFT));
    buttons.add(addXslBtn = new JButton(stringFactory.getString(LabelStringFactory.MAIN_FRAME_ADD_XSL_BTN)));
    buttons.add(removeCheckedBtn = new JButton(
            stringFactory.getString(LabelStringFactory.MAIN_FRAME_REMOVE_CHECKED_BTN)));
    addXslBtn.addActionListener(this);
    removeCheckedBtn.addActionListener(this);
    autosavePanel = new JPanel(xslPanelLayout);
    GUIUtils.add(autosavePanel, buttons, xslPanelLayout, xslPanelConstraints, row++, 0, 1, 3,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(autosavePanel,
            new JLabel(stringFactory.getString(LabelStringFactory.MAIN_FRAME_AUTOSAVERESULT)), xslPanelLayout,
            xslPanelConstraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(autosavePanel, autosaveCb = new JCheckBox(), xslPanelLayout, xslPanelConstraints, row, 1, 1, 1,
            GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    autosaveCb.addActionListener(this);
    GUIUtils.add(autosavePanel, autosavePathTf = new JTextField(AppConstants.TF_LENGTH - 4), xslPanelLayout,
            xslPanelConstraints, row, 2, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(autosavePanel,
            browseAutosavePathBtn = new JButton(
                    stringFactory.getString(LabelStringFactory.MAIN_FRAME_BROWSE_BTN)),
            xslPanelLayout, xslPanelConstraints, row, 3, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(autosavePanel,
            validateAutosaveBtn = new JButton(
                    stringFactory.getString(LabelStringFactory.MAIN_FRAME_VALIDATE_BTN)),
            xslPanelLayout, xslPanelConstraints, row++, 4, 1, 1, GridBagConstraints.EAST,
            GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    validateAutosaveBtn.addActionListener(this);
    GUIUtils.add(autosavePanel,
            new JLabel(stringFactory.getString(LabelStringFactory.MAIN_FRAME_SUPRESS_OUTPUT_WINDOW)),
            xslPanelLayout, xslPanelConstraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(autosavePanel, suppressOutputWindowCb = new JCheckBox(), xslPanelLayout, xslPanelConstraints,
            row++, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    GUIUtils.add(autosavePanel,
            outputAsTextIfXmlLabel = new JLabel(
                    stringFactory.getString(LabelStringFactory.MAIN_FRAME_DISPLAY_OUTPUT_AS_TEXT_IF_XML)),
            xslPanelLayout, xslPanelConstraints, row, 0, 1, 1, GridBagConstraints.EAST, GridBagConstraints.NONE,
            GUIUtils.SMALL_INSETS);
    GUIUtils.add(autosavePanel, outputAsTextIfXml = new JCheckBox(), xslPanelLayout, xslPanelConstraints, row++,
            1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, GUIUtils.SMALL_INSETS);
    suppressOutputWindowCb.addActionListener(this);
    return autosavePanel;
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.DocComponent.java

/** Builds and lays out the UI. */
private void buildGUI() {
    setBackground(UIUtilities.BACKGROUND_COLOR);
    setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
    add(label);//w w  w  .j a v a2 s.c o m
    JToolBar bar = new JToolBar();
    bar.setBackground(UIUtilities.BACKGROUND_COLOR);
    bar.setFloatable(false);
    bar.setRollover(true);
    bar.setBorder(null);
    bar.setOpaque(true);
    boolean b = setControlsEnabled(data != null);
    int count = 0;
    if (editButton != null)
        count++;
    if (unlinkButton != null)
        count++;
    if (downloadButton != null)
        count++;
    if (infoButton != null)
        count++;
    if (openButton != null)
        count++;
    if (count > 0 && data != null) {
        menuButton.setEnabled(true);
        if (model.isAcrossGroups())
            menuButton.setEnabled(false);
        bar.add(menuButton);
        if (!b)
            bar.add(Box.createHorizontalStrut(8));
        add(bar);
    }
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.UserProfile.java

/** 
 * Builds the UI component hosting the UI component used to modify 
 * the password./*from   w w w. j  av  a 2  s .c  o m*/
 * 
 * @return See above.
 */
private JPanel buildPasswordPanel() {
    JPanel content = new JPanel();
    content.setBackground(UIUtilities.BACKGROUND_COLOR);
    Registry reg = MetadataViewerAgent.getRegistry();
    String ldap = (String) reg.lookup(LookupNames.USER_AUTHENTICATION);
    if (ldap != null && ldap.length() > 0) {
        content.setBorder(BorderFactory.createTitledBorder("LDAP Authentication"));
        content.setLayout(new FlowLayout(FlowLayout.LEFT));
        content.add(new JLabel(ldap));
        return content;
    }
    content.setBorder(BorderFactory.createTitledBorder("Change Password"));

    content.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.anchor = GridBagConstraints.WEST;
    c.insets = new Insets(0, 2, 2, 0);
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0.0;
    if (MetadataViewerAgent.isAdministrator()) {
        content.add(UIUtilities.setTextFont(PASSWORD_NEW), c);
        c.gridx++;
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        content.add(passwordNew, c);
    } else {
        content.add(UIUtilities.setTextFont(PASSWORD_OLD), c);
        c.gridx++;
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        content.add(oldPassword, c);
        c.gridy++;
        c.gridx = 0;
        c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
        c.fill = GridBagConstraints.NONE;
        c.weightx = 0.0;
        content.add(UIUtilities.setTextFont(PASSWORD_NEW), c);
        c.gridx++;
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        content.add(passwordNew, c);
        c.gridy++;
        c.gridx = 0;
        c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
        c.fill = GridBagConstraints.NONE;
        c.weightx = 0.0;
        content.add(UIUtilities.setTextFont(PASSWORD_CONFIRMATION), c);
        c.gridx++;
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        content.add(passwordConfirm, c);
        c.gridy++;
        c.gridx = 0;
    }

    JPanel p = new JPanel();
    p.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
    p.add(content);
    JPanel buttonPanel = UIUtilities.buildComponentPanel(passwordButton);
    buttonPanel.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.add(buttonPanel);
    return p;
}