List of usage examples for java.awt BorderLayout PAGE_END
String PAGE_END
To view the source code for java.awt BorderLayout PAGE_END.
Click Source Link
From source file:de.cebitec.readXplorer.differentialExpression.plot.DeSeq2GraphicsTopComponent.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from w w w . j a v a 2 s. com */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jSplitPane1 = new javax.swing.JSplitPane(); optionsPanel = new javax.swing.JPanel(); iSymbol = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); messages = new javax.swing.JTextArea(); saveButton = new javax.swing.JButton(); plotButton = new javax.swing.JButton(); plotType = new javax.swing.JComboBox(); jLabel1 = new javax.swing.JLabel(); plotPanel = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); plotDescriptionArea = new javax.swing.JTextArea(); iSymbol.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); iSymbol.setIcon(new javax.swing.ImageIcon( getClass().getResource("/de/cebitec/readXplorer/differentialExpression/plot/i.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(iSymbol, org.openide.util.NbBundle .getMessage(DeSeq2GraphicsTopComponent.class, "DeSeq2GraphicsTopComponent.iSymbol.text")); // NOI18N jScrollPane1.setBorder(null); messages.setEditable(false); messages.setBackground(new java.awt.Color(240, 240, 240)); messages.setColumns(20); messages.setLineWrap(true); messages.setRows(5); messages.setWrapStyleWord(true); messages.setBorder(null); jScrollPane1.setViewportView(messages); org.openide.awt.Mnemonics.setLocalizedText(saveButton, org.openide.util.NbBundle .getMessage(DeSeq2GraphicsTopComponent.class, "DeSeq2GraphicsTopComponent.saveButton.text")); // NOI18N saveButton.setEnabled(false); saveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveButtonActionPerformed(evt); } }); org.openide.awt.Mnemonics.setLocalizedText(plotButton, org.openide.util.NbBundle .getMessage(DeSeq2GraphicsTopComponent.class, "DeSeq2GraphicsTopComponent.plotButton.text")); // NOI18N plotButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { plotButtonActionPerformed(evt); } }); plotType.setModel(cbm); plotType.addItemListener(this); org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle .getMessage(DeSeq2GraphicsTopComponent.class, "DeSeq2GraphicsTopComponent.jLabel1.text")); // NOI18N javax.swing.GroupLayout optionsPanelLayout = new javax.swing.GroupLayout(optionsPanel); optionsPanel.setLayout(optionsPanelLayout); optionsPanelLayout.setHorizontalGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap() .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup().addComponent(jLabel1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(plotType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(plotButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(saveButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, optionsPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(iSymbol).addContainerGap())); optionsPanelLayout.setVerticalGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap().addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(plotType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(plotButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(saveButton).addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 261, Short.MAX_VALUE) .addComponent(iSymbol).addContainerGap())); jSplitPane1.setLeftComponent(optionsPanel); plotPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); plotPanel.setLayout(new java.awt.BorderLayout()); plotDescriptionArea.setEditable(false); plotDescriptionArea.setBackground(new java.awt.Color(240, 240, 240)); plotDescriptionArea.setColumns(3); plotDescriptionArea.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N plotDescriptionArea.setLineWrap(true); plotDescriptionArea.setRows(3); plotDescriptionArea.setWrapStyleWord(true); plotDescriptionArea.setMaximumSize(new java.awt.Dimension(2147483647, 42)); plotDescriptionArea.setMinimumSize(new java.awt.Dimension(164, 42)); plotDescriptionArea.setPreferredSize(new java.awt.Dimension(164, 42)); jScrollPane2.setViewportView(plotDescriptionArea); plotPanel.add(jScrollPane2, java.awt.BorderLayout.PAGE_END); jSplitPane1.setRightComponent(plotPanel); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 653, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING)); }
From source file:de.cebitec.readXplorer.differentialExpression.plot.DeSeqGraphicsTopComponent.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./* www . j a v a 2 s. c om*/ */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jSplitPane1 = new javax.swing.JSplitPane(); optionsPanel = new javax.swing.JPanel(); iSymbol = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); messages = new javax.swing.JTextArea(); saveButton = new javax.swing.JButton(); plotButton = new javax.swing.JButton(); plotType = new javax.swing.JComboBox(); jLabel1 = new javax.swing.JLabel(); plotPanel = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); plotDescriptionArea = new javax.swing.JTextArea(); iSymbol.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); iSymbol.setIcon(new javax.swing.ImageIcon( getClass().getResource("/de/cebitec/readXplorer/differentialExpression/plot/i.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(iSymbol, org.openide.util.NbBundle .getMessage(DeSeqGraphicsTopComponent.class, "DeSeqGraphicsTopComponent.iSymbol.text_1")); // NOI18N jScrollPane1.setBorder(null); messages.setEditable(false); messages.setBackground(new java.awt.Color(240, 240, 240)); messages.setColumns(20); messages.setLineWrap(true); messages.setRows(5); messages.setWrapStyleWord(true); messages.setBorder(null); jScrollPane1.setViewportView(messages); org.openide.awt.Mnemonics.setLocalizedText(saveButton, org.openide.util.NbBundle .getMessage(DeSeqGraphicsTopComponent.class, "DeSeqGraphicsTopComponent.saveButton.text_1")); // NOI18N saveButton.setEnabled(false); saveButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveButtonActionPerformed(evt); } }); org.openide.awt.Mnemonics.setLocalizedText(plotButton, org.openide.util.NbBundle .getMessage(DeSeqGraphicsTopComponent.class, "DeSeqGraphicsTopComponent.plotButton.text_1")); // NOI18N plotButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { plotButtonActionPerformed(evt); } }); plotType.setModel(cbm); plotType.addItemListener(this); org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle .getMessage(DeSeqGraphicsTopComponent.class, "DeSeqGraphicsTopComponent.jLabel1.text_1")); // NOI18N javax.swing.GroupLayout optionsPanelLayout = new javax.swing.GroupLayout(optionsPanel); optionsPanel.setLayout(optionsPanelLayout); optionsPanelLayout.setHorizontalGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap() .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup().addComponent(jLabel1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(plotType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(plotButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(saveButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, optionsPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(iSymbol).addContainerGap())); optionsPanelLayout.setVerticalGroup(optionsPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap().addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(plotType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(plotButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(saveButton).addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 261, Short.MAX_VALUE) .addComponent(iSymbol).addContainerGap())); jSplitPane1.setLeftComponent(optionsPanel); plotPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); plotPanel.setLayout(new java.awt.BorderLayout()); plotDescriptionArea.setEditable(false); plotDescriptionArea.setBackground(new java.awt.Color(240, 240, 240)); plotDescriptionArea.setColumns(3); plotDescriptionArea.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N plotDescriptionArea.setLineWrap(true); plotDescriptionArea.setRows(3); plotDescriptionArea.setWrapStyleWord(true); plotDescriptionArea.setMaximumSize(new java.awt.Dimension(2147483647, 42)); plotDescriptionArea.setMinimumSize(new java.awt.Dimension(164, 42)); plotDescriptionArea.setPreferredSize(new java.awt.Dimension(164, 42)); jScrollPane2.setViewportView(plotDescriptionArea); plotPanel.add(jScrollPane2, java.awt.BorderLayout.PAGE_END); jSplitPane1.setRightComponent(plotPanel); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 653, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING)); }
From source file:caarray.client.test.gui.GuiMain.java
public GuiMain() throws Exception { JFrame frame = new JFrame("API Test Suite"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(new BorderLayout(6, 6)); JPanel topPanel = new JPanel(); /* ###### Text fields for modifiable parameters ##### */ final JTextField javaHostText = new JTextField(TestProperties.getJavaServerHostname(), 20); JLabel javaHostLabel = new JLabel("Java Service Host"); JButton save = new JButton("Save"); save.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { TestProperties.setJavaServerHostname(javaHostText.getText()); }/* ww w . jav a 2 s.co m*/ }); JLabel javaPortLabel = new JLabel("Java Port"); final JTextField javaPortText = new JTextField(Integer.toString(TestProperties.getJavaServerJndiPort()), 5); JButton save2 = new JButton("Save"); save2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { int port = Integer.parseInt(javaPortText.getText()); TestProperties.setJavaServerJndiPort(port); } catch (NumberFormatException e) { System.out.println(javaPortText.getText() + " is not a valid port number."); } } }); JLabel gridHostLabel = new JLabel("Grid Service Host"); final JTextField gridHostText = new JTextField(TestProperties.getGridServerHostname(), 20); JButton save3 = new JButton("Save"); save3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { TestProperties.setGridServerHostname(gridHostText.getText()); } }); JLabel gridPortLabel = new JLabel("Grid Service Port"); final JTextField gridPortText = new JTextField(Integer.toString(TestProperties.getGridServerPort()), 5); JButton save4 = new JButton("Save"); save4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { int port = Integer.parseInt(gridPortText.getText()); TestProperties.setGridServerPort(port); } catch (NumberFormatException e) { System.out.println(gridPortText.getText() + " is not a valid port number."); } } }); JLabel excludeLabel = new JLabel("Exclude test cases (comma-separated list):"); final JTextField excludeText = new JTextField("", 30); JButton save5 = new JButton("Save"); save5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { String testString = excludeText.getText(); if (testString != null) { String[] testCases = testString.split(","); if (testCases != null && testCases.length > 0) { List<Float> tests = new ArrayList<Float>(); for (String test : testCases) { try { tests.add(Float.parseFloat(test)); } catch (NumberFormatException e) { System.out.println(test + " is not a valid test case."); } } TestProperties.setExcludedTests(tests); } } } }); JLabel includeLabel = new JLabel("Include only (comma-separated list):"); final JTextField includeText = new JTextField("", 30); JButton save6 = new JButton("Save"); save6.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { String testString = includeText.getText(); if (testString != null) { String[] testCases = testString.split(","); if (testCases != null && testCases.length > 0) { List<Float> tests = new ArrayList<Float>(); for (String test : testCases) { try { tests.add(Float.parseFloat(test)); } catch (NumberFormatException e) { System.out.println(test + " is not a valid test case."); } } TestProperties.setIncludeOnlyTests(tests); } } } }); JLabel threadLabel = new JLabel("Number of threads:"); final JTextField threadText = new JTextField(Integer.toString(TestProperties.getNumThreads()), 5); JButton save7 = new JButton("Save"); save7.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { int threads = Integer.parseInt(threadText.getText()); TestProperties.setNumThreads(threads); } catch (NumberFormatException e) { System.out.println(threadText.getText() + " is not a valid thread number."); } } }); GridBagLayout topLayout = new GridBagLayout(); topPanel.setLayout(topLayout); JLabel[] labels = new JLabel[] { javaHostLabel, javaPortLabel, gridHostLabel, gridPortLabel, excludeLabel, includeLabel, threadLabel }; JTextField[] textFields = new JTextField[] { javaHostText, javaPortText, gridHostText, gridPortText, excludeText, includeText, threadText }; JButton[] buttons = new JButton[] { save, save2, save3, save4, save5, save6, save7 }; for (int i = 0; i < labels.length; i++) { GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.NONE; c.gridx = 0; c.gridy = i; topPanel.add(labels[i], c); c.gridx = 1; topPanel.add(textFields[i], c); c.gridx = 2; topPanel.add(buttons[i], c); } frame.getContentPane().add(topPanel, BorderLayout.PAGE_START); GridLayout bottomLayout = new GridLayout(0, 4); selectionPanel.setLayout(bottomLayout); JCheckBox selectAll = new JCheckBox("Select/Deselect All"); selectAll.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JCheckBox box = (JCheckBox) e.getSource(); selectAll(box.isSelected()); } }); selectionPanel.add(selectAll); JCheckBox excludeLongTests = new JCheckBox("Exclude Long Tests"); excludeLongTests.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JCheckBox box = (JCheckBox) e.getSource(); if (box.isSelected()) { TestProperties.excludeLongTests(); } else { TestProperties.removeExcludedLongTests(); } } }); TestProperties.excludeLongTests(); excludeLongTests.setSelected(true); selectionPanel.add(excludeLongTests); //Initialize check boxes corresponding to test categories initializeTests(); centerPanel.setLayout(new GridLayout(0, 1)); centerPanel.add(selectionPanel); //Redirect System messages to gui JScrollPane textScroll = new JScrollPane(); textScroll.setViewportView(textDisplay); System.setOut(new PrintStream(new JTextAreaOutputStream(textDisplay))); System.setErr(new PrintStream(new JTextAreaOutputStream(textDisplay))); centerPanel.add(textScroll); JScrollPane scroll = new JScrollPane(centerPanel); frame.getContentPane().add(scroll, BorderLayout.CENTER); JButton runButton = new JButton("Run Tests"); runButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { runTests(); } catch (Exception e) { System.out.println("An error occured executing the tests: " + e.getClass() + ". Check error log for details."); log.error("Exception encountered:", e); } } }); JPanel bottomPanel = new JPanel(); bottomPanel.add(runButton); frame.getContentPane().add(bottomPanel, BorderLayout.PAGE_END); frame.pack(); frame.setVisible(true); }
From source file:project16.Home16.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from www . ja va2s.co m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { pnl_sidebar = new javax.swing.JPanel(); lbl_west = new javax.swing.JLabel(); lbl_north = new javax.swing.JLabel(); lbl_south = new javax.swing.JLabel(); lbl_east = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); pnl_chart = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); pnl_table = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setBackground(new java.awt.Color(255, 255, 255)); setLocationByPlatform(true); setUndecorated(true); pnl_sidebar.setBackground(new java.awt.Color(34, 41, 50)); pnl_sidebar.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnl_sidebarMouseDragged(evt); } }); pnl_sidebar.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnl_sidebarMousePressed(evt); } }); lbl_west.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N lbl_west.setForeground(new java.awt.Color(166, 166, 166)); lbl_west.setIcon(new javax.swing.ImageIcon(getClass().getResource("/project16/Icons/plus_18px_1.png"))); // NOI18N lbl_west.setText("Western Field"); lbl_west.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { lbl_westMousePressed(evt); } }); lbl_north.setBackground(new java.awt.Color(48, 201, 235)); lbl_north.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N lbl_north.setForeground(new java.awt.Color(48, 201, 235)); lbl_north.setIcon(new javax.swing.ImageIcon(getClass().getResource("/project16/Icons/home_18px.png"))); // NOI18N lbl_north.setText("Northern Field"); lbl_north.setToolTipText(""); lbl_north.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { lbl_northMousePressed(evt); } }); lbl_south.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N lbl_south.setForeground(new java.awt.Color(166, 166, 166)); lbl_south.setIcon(new javax.swing.ImageIcon(getClass().getResource("/project16/Icons/clock_18px.png"))); // NOI18N lbl_south.setText("Southern Field"); lbl_south.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { lbl_southMousePressed(evt); } }); lbl_east.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N lbl_east.setForeground(new java.awt.Color(166, 166, 166)); lbl_east.setIcon(new javax.swing.ImageIcon(getClass().getResource("/project16/Icons/search_18px_2.png"))); // NOI18N lbl_east.setText("Eastern Field"); lbl_east.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { lbl_eastMousePressed(evt); } }); jPanel1.setBackground(new java.awt.Color(22, 27, 33)); jLabel2.setFont(new java.awt.Font("Segoe UI", 0, 12)); // NOI18N jLabel2.setForeground(new java.awt.Color(153, 153, 153)); jLabel2.setText("(c) KeepToo 2017"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout .setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(75, 75, 75).addComponent(jLabel2) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(30, Short.MAX_VALUE).addComponent(jLabel2).addGap(21, 21, 21))); jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel3.setIcon( new javax.swing.ImageIcon(getClass().getResource("/project16/Icons/speech_bubble_25px.png"))); // NOI18N javax.swing.GroupLayout pnl_sidebarLayout = new javax.swing.GroupLayout(pnl_sidebar); pnl_sidebar.setLayout(pnl_sidebarLayout); pnl_sidebarLayout.setHorizontalGroup(pnl_sidebarLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnl_sidebarLayout.createSequentialGroup() .addContainerGap(53, Short.MAX_VALUE) .addGroup(pnl_sidebarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnl_sidebarLayout.createSequentialGroup().addGroup(pnl_sidebarLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lbl_north, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_south, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_west, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_east, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(24, 24, 24)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnl_sidebarLayout.createSequentialGroup() .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(92, 92, 92))))); pnl_sidebarLayout.setVerticalGroup(pnl_sidebarLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnl_sidebarLayout.createSequentialGroup().addGap(56, 56, 56) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(50, 50, 50) .addComponent(lbl_north, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lbl_south, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lbl_west, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lbl_east, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))); pnl_chart.setBackground(new java.awt.Color(54, 63, 73)); pnl_chart.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { pnl_chartMouseDragged(evt); } }); pnl_chart.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { pnl_chartMousePressed(evt); } }); pnl_chart.setLayout(new java.awt.BorderLayout()); jLabel1.setBackground(new java.awt.Color(34, 41, 50)); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel1.setText("X "); jLabel1.setOpaque(true); jLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jLabel1MousePressed(evt); } }); pnl_chart.add(jLabel1, java.awt.BorderLayout.PAGE_START); jTextField1.setBackground(new java.awt.Color(54, 63, 73)); jTextField1.setForeground(new java.awt.Color(255, 255, 255)); jTextField1.setText(" Search"); jTextField1.setToolTipText(""); jTextField1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 2, 0)); jTextField1.addFocusListener(new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { jTextField1FocusGained(evt); } }); jTextField1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jTextField1MouseEntered(evt); } }); pnl_chart.add(jTextField1, java.awt.BorderLayout.PAGE_END); pnl_table.setBackground(new java.awt.Color(255, 255, 255)); pnl_table.setLayout(new javax.swing.BoxLayout(pnl_table, javax.swing.BoxLayout.LINE_AXIS)); jScrollPane1.setBackground(new java.awt.Color(255, 255, 255)); jScrollPane1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(240, 240, 240), 1, true)); jScrollPane1.setOpaque(false); jTable1.setFont(new java.awt.Font("Segoe UI", 0, 12)); // NOI18N jTable1.setForeground(new java.awt.Color(51, 51, 51)); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { "1", "Lex Fontier", "EA", "TY" }, { "2", "Ryan Reynold", "US", "NY" }, { "3", "Jackie Wuan", "CH", "HK" }, { "4", "Monty Rattler", "UK", "LD" } }, new String[] { "ID", "NAME", "COUNTRY", "STATE" }) { Class[] types = new Class[] { java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } }); jTable1.setGridColor(new java.awt.Color(255, 255, 255)); jTable1.setRowHeight(20); jTable1.setSelectionBackground(new java.awt.Color(62, 226, 141)); jTable1.setShowHorizontalLines(false); jTable1.setShowVerticalLines(false); jScrollPane1.setViewportView(jTable1); pnl_table.add(jScrollPane1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(pnl_sidebar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pnl_chart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pnl_table, javax.swing.GroupLayout.DEFAULT_SIZE, 703, Short.MAX_VALUE)))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pnl_sidebar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(pnl_chart, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(pnl_table, javax.swing.GroupLayout.PREFERRED_SIZE, 396, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); pack(); }
From source file:ch.fork.AdHocRailway.ui.AdHocRailway.java
private void initGUI() { setFont(new Font("Verdana", Font.PLAIN, 19)); setLayout(new BorderLayout(0, 0)); initMenu();/* w w w. j av a2 s .co m*/ initToolbar(); statusBarPanel = initStatusBar(); mainPanel = new JPanel(); mainPanel = new JPanel(new MigLayout("", "[][grow]", "[grow][]")); final JPanel segmentPanel = new KeyControl(appContext); trackControlPanel = new TrackControlPanel(appContext); locomotiveControlPanel = new LocomotiveControlPanel(appContext); powerControlPanel = new PowerControlPanel(appContext); mainPanel.add(segmentPanel, "grow"); mainPanel.add(trackControlPanel, "grow, wrap"); mainPanel.add(powerControlPanel, "grow"); mainPanel.add(locomotiveControlPanel, "shrink 0, wrap"); add(mainPanel, BorderLayout.CENTER); add(statusBarPanel, BorderLayout.PAGE_END); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosing(final WindowEvent e) { new ExitAction().actionPerformed(null); } }); setRailwayDeviceLabelText(); initShortcuts(); appContext.getMainBus().register(this); appContext.getMainBus().post(new EditingModeEvent(appContext.isEditingMode())); }
From source file:com.igormaznitsa.nbmindmap.nb.swing.PlainTextEditor.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.// ww w . j ava 2 s . c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { mainToolBar = new javax.swing.JToolBar(); buttonLoad = new javax.swing.JButton(); buttonSave = new javax.swing.JButton(); buttonCopy = new javax.swing.JButton(); buttonPaste = new javax.swing.JButton(); buttonClearAll = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); labelCursorPos = new javax.swing.JLabel(); jSeparator2 = new javax.swing.JSeparator(); labelWrapMode = new javax.swing.JLabel(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(16, 0), new java.awt.Dimension(16, 0), new java.awt.Dimension(16, 32767)); setLayout(new java.awt.BorderLayout()); mainToolBar.setFloatable(false); mainToolBar.setRollover(true); buttonLoad.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/nbmindmap/icons/disk16.png"))); // NOI18N java.util.ResourceBundle bundle = java.util.ResourceBundle .getBundle("com/igormaznitsa/nbmindmap/i18n/Bundle"); // NOI18N buttonLoad.setText(bundle.getString("PlainTextEditor.buttonImport")); // NOI18N buttonLoad.setToolTipText(bundle.getString("PlainTextEditor.buttonLoad.toolTipText")); // NOI18N buttonLoad.setFocusable(false); buttonLoad.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); buttonLoad.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); buttonLoad.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonLoadActionPerformed(evt); } }); mainToolBar.add(buttonLoad); buttonSave.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/nbmindmap/icons/file_save16.png"))); // NOI18N buttonSave.setText(bundle.getString("PlaintextEditor.buttonExport")); // NOI18N buttonSave.setToolTipText(bundle.getString("PlainTextEditor.buttonSave.toolTipText")); // NOI18N buttonSave.setFocusable(false); buttonSave.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); buttonSave.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); buttonSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonSaveActionPerformed(evt); } }); mainToolBar.add(buttonSave); buttonCopy.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/nbmindmap/icons/page_copy16.png"))); // NOI18N buttonCopy.setText(bundle.getString("PlainTextEditor.buttonCopy.text")); // NOI18N buttonCopy.setToolTipText(bundle.getString("PlainTextEditor.buttonCopy.toolTipText")); // NOI18N buttonCopy.setFocusable(false); buttonCopy.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); buttonCopy.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); buttonCopy.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonCopyActionPerformed(evt); } }); mainToolBar.add(buttonCopy); buttonPaste.setIcon(new javax.swing.ImageIcon( getClass().getResource("/com/igormaznitsa/nbmindmap/icons/paste_plain16.png"))); // NOI18N buttonPaste.setText(bundle.getString("PlainTextEditor.buttonPaste.text")); // NOI18N buttonPaste.setToolTipText(bundle.getString("PlainTextEditor.buttonPaste.toolTipText")); // NOI18N buttonPaste.setFocusable(false); buttonPaste.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); buttonPaste.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); buttonPaste.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonPasteActionPerformed(evt); } }); mainToolBar.add(buttonPaste); buttonClearAll.setIcon( new javax.swing.ImageIcon(getClass().getResource("/com/igormaznitsa/nbmindmap/icons/cross16.png"))); // NOI18N buttonClearAll.setText(bundle.getString("PlainTextEditor.buttonClearAll.text")); // NOI18N buttonClearAll.setToolTipText(bundle.getString("PlainTextEditor.buttonClearAll.toolTipText")); // NOI18N buttonClearAll.setFocusable(false); buttonClearAll.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); buttonClearAll.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); buttonClearAll.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonClearAllActionPerformed(evt); } }); mainToolBar.add(buttonClearAll); add(mainToolBar, java.awt.BorderLayout.PAGE_START); jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT)); labelCursorPos.setText("...:..."); // NOI18N jPanel1.add(labelCursorPos); jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL); jSeparator2.setPreferredSize(new java.awt.Dimension(8, 16)); jPanel1.add(jSeparator2); labelWrapMode.setText("..."); // NOI18N labelWrapMode.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); labelWrapMode.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { labelWrapModeMouseClicked(evt); } }); jPanel1.add(labelWrapMode); jPanel1.add(filler1); add(jPanel1, java.awt.BorderLayout.PAGE_END); }
From source file:org.domainmath.gui.MainFrame.java
/** * Creates new form MainFrame./* www. j a va 2 s. c om*/ * @param args */ public MainFrame(String args[]) { // create folders called cache and log. cache = new File(System.getProperty("user.dir") + File.separator + "cache"); logDir = new File(System.getProperty("user.dir") + File.separator + "log"); worksDir = new File(System.getProperty("user.dir") + File.separator + "works"); cache.mkdir(); logDir.mkdir(); if (!worksDir.exists()) { worksDir.mkdir(); } parent_root = cache.getAbsolutePath() + File.separator; log_root = logDir.getAbsolutePath() + File.separator; preferencesDlg = new PreferencesDlg(this, true); layout_file = new File(System.getProperty("user.dir") + File.separator + "layout.ini"); initComponents(); new PackageLoader(this); new ToolsLoader(this); makeMenu(); setIconImage(icon); Preferences pr2 = Preferences.userNodeForPackage(this.getClass()); setSize(pr2.getInt("Frame_width", 800), pr2.getInt("Frame_height", 600)); setLocationRelativeTo(null); FILE_TAB_INDEX = 0; //create octavepanel. octavePanel = new OctavePanel(this); commandArea = octavePanel.commandArea; octavePath = preferencesDlg.getPath(); startupCmd = preferencesDlg.getStartupCmd(); wantedToClearText = preferencesDlg.wantedToClearText(); cmdLineOptions = preferencesDlg.getCmdLineOptions(); // set up histroy widget. histArea = new RSyntaxTextArea(); histArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_OCTAVE); histScrollPane = new RTextScrollPane(histArea); histScrollPane.setWheelScrollingEnabled(true); workspace = new WorkspacePanel(parent_root + "DomainMath_OctaveVariables.dat", this); dbstackPanel = new DbstackPanel(parent_root + "DomainMath_OctaveDbStack.dat", this); // create recent files menu. recentFileMenu = new RecentFileMenu("RecentFiles", MAX_NUM_RECENT_FILES) { @Override public void onSelectFile(String filePath, ActionEvent action_event) { onRecentFile(filePath, action_event); } }; this.fileMenu.add(recentFileMenu, MainFrame.RECENT_MENU_ORDER); statusPanel = new StatusPanel(); fileTab.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); fileTreePanel = new FileTreePanel(this); quickHelpPanel = new QuickHelpPanel(); pathPanel = new PathsPanel(parent_root + "DomainMath_OctavePaths.dat"); pkgViewPanel = new PkgViewPanel(parent_root + "DomainMath_OctavePackages.dat", this); histPanel(); this.popupTab(); dir = pr2.get("DomainMath_StartUpDir", System.getProperty("user.dir")); if (dir.equals(worksDir.getAbsolutePath())) { startupDir = dir; } else { startupDir = worksDir.getAbsolutePath(); } currentDirFileTab = null; fileTabView = new View("Code Editor", null, fileTab); pathsView = new View("Set Paths", null, pathPanel); pkgView = new View("Packages", null, pkgViewPanel); consoleScrollPane = new JScrollPane(); consoleScrollPane.getVerticalScrollBar().setUnitIncrement(16); consoleScrollPane.setViewportView(octavePanel); consoleView = new View("Console", null, consoleScrollPane); arrayEditorView = new View("Array Editor", null, new ArrayEditorPanel()); workspaceView = new View("Workspace", null, workspace); debuggerView = new View("Debugger", null, this.dbstackPanel); filesView = new View("Files", null, fileTreePanel); quickHelpView = new View("Quick Help", null, quickHelpPanel); createRootWindow(); setDefaultLayout(); add(rootWindow, BorderLayout.CENTER); add(statusPanel, BorderLayout.PAGE_END); dragNDrop(); debugMarksList = new ArrayList<>(); breakPointMarksList = new ArrayList<>(); breakPointList = new ArrayList<>(); fileTab2 = fileTab; if (args != null) { openStartUpFiles(args); } }
From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.panel.Chromatogram1DHeatmapViewerPanel.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//ww w. j a va2 s . c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jToolBar2 = new javax.swing.JToolBar(); settingsButton = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jSlider1 = new RangeSlider(0, 1000); jCheckBox1 = new javax.swing.JCheckBox(); jCheckBox2 = new javax.swing.JCheckBox(); jSeparator1 = new javax.swing.JToolBar.Separator(); jLabel2 = new javax.swing.JLabel(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 32767)); modeSpinner = new javax.swing.JSpinner(); jSeparator2 = new javax.swing.JToolBar.Separator(); jLabel3 = new javax.swing.JLabel(); filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 32767)); boxWidthSpinner = new javax.swing.JSpinner(); filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 32767)); jLabel4 = new javax.swing.JLabel(); filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 32767)); boxHeightSpinner = new javax.swing.JSpinner(); jPanel2 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jSlider2 = new javax.swing.JSlider(); jPanel1.setLayout(new java.awt.BorderLayout()); jToolBar2.setFloatable(false); jToolBar2.setRollover(true); settingsButton.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class, "Chromatogram1DHeatmapViewerPanel.settingsButton.text")); // NOI18N settingsButton.setFocusable(false); settingsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); settingsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); settingsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { settingsButtonActionPerformed(evt); } }); jToolBar2.add(settingsButton); java.util.ResourceBundle bundle = java.util.ResourceBundle .getBundle("net/sf/maltcms/chromaui/chromatogram1Dviewer/ui/panel/Bundle"); // NOI18N jButton1.setText(bundle.getString("Chromatogram1DHeatmapViewerPanel.jButton1.text")); // NOI18N jButton1.setFocusable(false); jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jToolBar2.add(jButton1); jLabel1.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class, "Chromatogram1DHeatmapViewerPanel.jLabel1.text")); // NOI18N jToolBar2.add(jLabel1); jSlider1.setMajorTickSpacing(10); jSlider1.setMaximum(1000); jSlider1.setMinorTickSpacing(1); jSlider1.setValue(0); jSlider1.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jSlider1StateChanged(evt); } }); jToolBar2.add(jSlider1); jCheckBox1.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class, "Chromatogram1DHeatmapViewerPanel.jCheckBox1.text")); // NOI18N jCheckBox1.setFocusable(false); jCheckBox1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jCheckBox1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jCheckBox1ActionPerformed(evt); } }); jToolBar2.add(jCheckBox1); jCheckBox2.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class, "Chromatogram1DHeatmapViewerPanel.jCheckBox2.text")); // NOI18N jCheckBox2.setFocusable(false); jCheckBox2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jCheckBox2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jCheckBox2ActionPerformed(evt); } }); jToolBar2.add(jCheckBox2); jToolBar2.add(jSeparator1); jLabel2.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class, "Chromatogram1DHeatmapViewerPanel.jLabel2.text")); // NOI18N jToolBar2.add(jLabel2); jToolBar2.add(filler1); modeSpinner.setModel(new javax.swing.SpinnerListModel(new String[] { "ON_CLICK", "ON_HOVER" })); modeSpinner.setToolTipText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class, "Chromatogram1DHeatmapViewerPanel.modeSpinner.toolTipText")); // NOI18N modeSpinner.setMinimumSize(new java.awt.Dimension(120, 28)); modeSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { modeSpinnerStateChanged(evt); } }); jToolBar2.add(modeSpinner); jToolBar2.add(jSeparator2); jLabel3.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class, "Chromatogram1DHeatmapViewerPanel.jLabel3.text")); // NOI18N jToolBar2.add(jLabel3); jToolBar2.add(filler2); boxWidthSpinner.setModel( new javax.swing.SpinnerNumberModel(1.0d, 9.999999747378752E-5d, 1000.0d, 0.009999999776482582d)); boxWidthSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { boxWidthSpinnerStateChanged(evt); } }); jToolBar2.add(boxWidthSpinner); jToolBar2.add(filler3); jLabel4.setText(org.openide.util.NbBundle.getMessage(Chromatogram1DHeatmapViewerPanel.class, "Chromatogram1DHeatmapViewerPanel.jLabel4.text")); // NOI18N jToolBar2.add(jLabel4); jToolBar2.add(filler4); boxHeightSpinner.setModel( new javax.swing.SpinnerNumberModel(1.0d, 9.999999747378752E-5d, 1000.0d, 0.009999999776482582d)); boxHeightSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { boxHeightSpinnerStateChanged(evt); } }); jToolBar2.add(boxHeightSpinner); jPanel1.add(jToolBar2, java.awt.BorderLayout.PAGE_START); jPanel2.setLayout(new java.awt.BorderLayout()); jPanel1.add(jPanel2, java.awt.BorderLayout.CENTER); jSlider2.setMajorTickSpacing(25); jSlider2.setMaximum(99); jSlider2.setMinorTickSpacing(10); jSlider2.setPaintLabels(true); jSlider2.setPaintTicks(true); jSlider2.setSnapToTicks(true); jSlider2.setValue(0); jSlider2.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jSlider2StateChanged(evt); } }); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout .setHorizontalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE, 1183, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addContainerGap(31, Short.MAX_VALUE) .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(17, 17, 17))); jPanel1.add(jPanel3, java.awt.BorderLayout.PAGE_END); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)); }
From source file:be.ac.ua.comp.scarletnebula.gui.InteractiveFirewallPanel.java
public InteractiveFirewallPanel(final CloudProvider provider) { super(new BorderLayout()); this.provider = provider; ruleList = new RuleList(provider); final JPanel mainPanel = new JPanel(new GridBagLayout()); final GridBagConstraints c = new GridBagConstraints(); c.weightx = 0.25;/*from w w w .j a v a2 s .c o m*/ c.weighty = 1.0; c.fill = GridBagConstraints.BOTH; c.gridx = 0; c.gridy = 0; c.insets = new Insets(10, 10, 10, 5); final JPanel firewallPanel = new JPanel(new BorderLayout()); firewallPanel.add(firewallList, BorderLayout.CENTER); final JPanel firewallButtonPanel = new JPanel(); firewallButtonPanel.setLayout(new BoxLayout(firewallButtonPanel, BoxLayout.PAGE_AXIS)); firewallButtonPanel.setOpaque(true); firewallButtonPanel.setBackground(Color.white); addFirewallButton.setMaximumSize(new Dimension(500, 500)); addFirewallButton.addActionListener(new AddFirewallActionListener(provider)); firewallButtonPanel.add(addFirewallButton); deleteFirewallButton.setMaximumSize(new Dimension(500, 500)); deleteFirewallButton.addActionListener(new DeleteFirewallActionListener(provider)); firewallButtonPanel.add(deleteFirewallButton); firewallPanel.add(firewallButtonPanel, BorderLayout.PAGE_END); final JScrollPane firewallListScroller = new JScrollPane(firewallPanel); firewallPanel.setPreferredSize(new Dimension(10, 10)); mainPanel.add(firewallListScroller, c); c.weightx = 0.75; c.gridx = 1; c.insets = new Insets(10, 5, 10, 10); ruleList.setFillsViewportHeight(true); ruleList.setEnabled(false); firewallList.getSelectionModel().addListSelectionListener( new FirewallListSelectionListener(ruleList, addRulebutton, deleteRuleButton, deleteFirewallButton)); final JScrollPane ruleListScroller = new JScrollPane(ruleList); final JPanel ruleListPanel = new JPanel(new BorderLayout()); ruleListPanel.add(ruleListScroller, BorderLayout.CENTER); final JPanel ruleListButtonPanel = new JPanel(); addRulebutton.addActionListener(new AddRuleActionListener(provider)); deleteRuleButton.addActionListener(new DeleteRuleActionListener()); ruleListButtonPanel.add(addRulebutton); ruleListButtonPanel.add(deleteRuleButton); addRulebutton.setEnabled(false); deleteRuleButton.setEnabled(false); deleteFirewallButton.setEnabled(false); ruleListPanel.add(ruleListButtonPanel, BorderLayout.SOUTH); ruleListPanel.setPreferredSize(new Dimension(10, 10)); mainPanel.add(ruleListPanel, c); add(mainPanel, BorderLayout.CENTER); final JPanel allThrobbersPanel = getThrobbersPanel(); add(allThrobbersPanel, BorderLayout.NORTH); loadInitialFirewalls(); }
From source file:components.DialogDemo.java
/** Creates the panel shown by the second tab. */ private JPanel createFeatureDialogBox() { final int numButtons = 5; JRadioButton[] radioButtons = new JRadioButton[numButtons]; final ButtonGroup group = new ButtonGroup(); JButton showItButton = null;//from w w w . j av a 2s .co m final String pickOneCommand = "pickone"; final String textEnteredCommand = "textfield"; final String nonAutoCommand = "nonautooption"; final String customOptionCommand = "customoption"; final String nonModalCommand = "nonmodal"; radioButtons[0] = new JRadioButton("Pick one of several choices"); radioButtons[0].setActionCommand(pickOneCommand); radioButtons[1] = new JRadioButton("Enter some text"); radioButtons[1].setActionCommand(textEnteredCommand); radioButtons[2] = new JRadioButton("Non-auto-closing dialog"); radioButtons[2].setActionCommand(nonAutoCommand); radioButtons[3] = new JRadioButton("Input-validating dialog " + "(with custom message area)"); radioButtons[3].setActionCommand(customOptionCommand); radioButtons[4] = new JRadioButton("Non-modal dialog"); radioButtons[4].setActionCommand(nonModalCommand); for (int i = 0; i < numButtons; i++) { group.add(radioButtons[i]); } radioButtons[0].setSelected(true); showItButton = new JButton("Show it!"); showItButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String command = group.getSelection().getActionCommand(); //pick one of many if (command == pickOneCommand) { Object[] possibilities = { "ham", "spam", "yam" }; String s = (String) JOptionPane.showInputDialog(frame, "Complete the sentence:\n" + "\"Green eggs and...\"", "Customized Dialog", JOptionPane.PLAIN_MESSAGE, icon, possibilities, "ham"); //If a string was returned, say so. if ((s != null) && (s.length() > 0)) { setLabel("Green eggs and... " + s + "!"); return; } //If you're here, the return value was null/empty. setLabel("Come on, finish the sentence!"); //text input } else if (command == textEnteredCommand) { String s = (String) JOptionPane.showInputDialog(frame, "Complete the sentence:\n" + "\"Green eggs and...\"", "Customized Dialog", JOptionPane.PLAIN_MESSAGE, icon, null, "ham"); //If a string was returned, say so. if ((s != null) && (s.length() > 0)) { setLabel("Green eggs and... " + s + "!"); return; } //If you're here, the return value was null/empty. setLabel("Come on, finish the sentence!"); //non-auto-closing dialog } else if (command == nonAutoCommand) { final JOptionPane optionPane = new JOptionPane( "The only way to close this dialog is by\n" + "pressing one of the following buttons.\n" + "Do you understand?", JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION); //You can't use pane.createDialog() because that //method sets up the JDialog with a property change //listener that automatically closes the window //when a button is clicked. final JDialog dialog = new JDialog(frame, "Click a button", true); dialog.setContentPane(optionPane); dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); dialog.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { setLabel("Thwarted user attempt to close window."); } }); optionPane.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (dialog.isVisible() && (e.getSource() == optionPane) && (JOptionPane.VALUE_PROPERTY.equals(prop))) { //If you were going to check something //before closing the window, you'd do //it here. dialog.setVisible(false); } } }); dialog.pack(); dialog.setLocationRelativeTo(frame); dialog.setVisible(true); int value = ((Integer) optionPane.getValue()).intValue(); if (value == JOptionPane.YES_OPTION) { setLabel("Good."); } else if (value == JOptionPane.NO_OPTION) { setLabel("Try using the window decorations " + "to close the non-auto-closing dialog. " + "You can't!"); } else { setLabel("Window unavoidably closed (ESC?)."); } //non-auto-closing dialog with custom message area //NOTE: if you don't intend to check the input, //then just use showInputDialog instead. } else if (command == customOptionCommand) { customDialog.setLocationRelativeTo(frame); customDialog.setVisible(true); String s = customDialog.getValidatedText(); if (s != null) { //The text is valid. setLabel("Congratulations! " + "You entered \"" + s + "\"."); } //non-modal dialog } else if (command == nonModalCommand) { //Create the dialog. final JDialog dialog = new JDialog(frame, "A Non-Modal Dialog"); //Add contents to it. It must have a close button, //since some L&Fs (notably Java/Metal) don't provide one //in the window decorations for dialogs. JLabel label = new JLabel("<html><p align=center>" + "This is a non-modal dialog.<br>" + "You can have one or more of these up<br>" + "and still use the main window."); label.setHorizontalAlignment(JLabel.CENTER); Font font = label.getFont(); label.setFont(label.getFont().deriveFont(font.PLAIN, 14.0f)); JButton closeButton = new JButton("Close"); closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.setVisible(false); dialog.dispose(); } }); JPanel closePanel = new JPanel(); closePanel.setLayout(new BoxLayout(closePanel, BoxLayout.LINE_AXIS)); closePanel.add(Box.createHorizontalGlue()); closePanel.add(closeButton); closePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 5)); JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(label, BorderLayout.CENTER); contentPane.add(closePanel, BorderLayout.PAGE_END); contentPane.setOpaque(true); dialog.setContentPane(contentPane); //Show it. dialog.setSize(new Dimension(300, 150)); dialog.setLocationRelativeTo(frame); dialog.setVisible(true); } } }); return createPane(moreDialogDesc + ":", radioButtons, showItButton); }