List of usage examples for java.awt BorderLayout PAGE_START
String PAGE_START
To view the source code for java.awt BorderLayout PAGE_START.
Click Source Link
From source file:com.xilinx.virtex7.MainScreen.java
private JPanel testAndStats() { JPanel tstats = new JPanel(); tstats.setLayout(new BoxLayout(tstats, BoxLayout.Y_AXIS)); JPanel tstats1 = new JPanel(); tstats1.setLayout(new BoxLayout(tstats1, BoxLayout.Y_AXIS)); tstats1.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""), BorderFactory.createRaisedBevelBorder())); tstats1.add(testPanelItems());/* w ww . j av a 2 s. c o m*/ JPanel dmaInner = new JPanel(new BorderLayout()); JPanel dmaPanel = new JPanel(new BorderLayout()); dmaPanel.setBackground(new Color(130, 170, 180)); table1 = new MyTableModel(dummy_data, dmaColumnNames0); dmaStats1 = new JTable(table1); try { dmaStats1.setDefaultRenderer(Object.class, new CustomTableCellRenderer()); } catch (Exception e) { } JTableHeader dmaHeader = dmaStats1.getTableHeader(); dmaHeader.setForeground(new Color(92, 25, 25)); dmaPanel.add(dmaHeader, BorderLayout.PAGE_START); dmaPanel.add(dmaStats1, BorderLayout.CENTER); dmaInner.add(dmaPanel, BorderLayout.CENTER); tstats1.add(dmaInner); tstats.add(tstats1); //tstats.add(trnPanel); JPanel tstats2 = new JPanel(); tstats2.setLayout(new BoxLayout(tstats2, BoxLayout.Y_AXIS)); tstats2.add(testPanelItems1()); tstats2.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""), BorderFactory.createRaisedBevelBorder())); JPanel dmaPanel1 = new JPanel(new BorderLayout()); table2 = new MyTableModel(dummy_data, dmaColumnNames1); dmaStats2 = new JTable(table2); try { dmaStats2.setDefaultRenderer(Object.class, new CustomTableCellRenderer()); } catch (Exception e) { } JTableHeader dmaHeader1 = dmaStats2.getTableHeader(); dmaHeader1.setForeground(new Color(92, 25, 25)); dmaPanel1.add(dmaHeader1, BorderLayout.PAGE_START); dmaPanel1.add(dmaStats2, BorderLayout.CENTER); tstats2.add(dmaPanel1); tstats.add(tstats2); return tstats; }
From source file:UI.SecurityDashboard.java
private void performMetric4(MainViewPanel mvp) { Metric4 metric4 = new Metric4(); JPanel graphPanel4 = new JPanel(); graphPanel4.setLayout(new BorderLayout()); metric4.run();// w w w.java 2 s . co m graphPanel4.add(mvp.getPanel4(metric4), BorderLayout.CENTER); MalwarePanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nThe Malware detection will scan for viruses, trojans, and worms that may have affected a device.\n"); header.setLineWrap(true); header.setWrapStyleWord(true); header.setEditable(false); MalwarePanel.add(header, BorderLayout.NORTH); if (metric4.getTotalCount() == 0) { Font noMalwareFont = new Font("Calibri", Font.BOLD, 40); JLabel noMalwareLabel = new JLabel( " No Malware Detected"); noMalwareLabel.setFont(noMalwareFont); noMalwareLabel.setPreferredSize(new Dimension(WIDTH, 100)); graphPanel4.add(noMalwareLabel, BorderLayout.NORTH); JPanel emptyPanel = new JPanel(); emptyPanel.setPreferredSize(new Dimension(50, 200)); emptyPanel.setOpaque(true); graphPanel4.add(emptyPanel, BorderLayout.SOUTH); } MalwarePanel.add(graphPanel4, BorderLayout.CENTER); ChartPanel fourthPanel = mvp.getPanel4(metric4); fourthPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent cme) { dashboardTabs.setSelectedIndex(4); } @Override public void chartMouseMoved(ChartMouseEvent cme) { } }); Metric4Panel.setLayout(new BorderLayout()); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel malwareTitleLabel = new JLabel(" Malware Detection"); malwareTitleLabel.setFont(titleFont); Metric4Panel.add(malwareTitleLabel, BorderLayout.PAGE_START); Metric4Panel.add(fourthPanel, BorderLayout.CENTER); if (metric4.getTotalCount() == 0) { Font noMalwareFont = new Font("Calibri", Font.BOLD, 20); JLabel noMalwareLabel = new JLabel(" No Malware Detected"); noMalwareLabel.setFont(noMalwareFont); Metric4Panel.add(noMalwareLabel, BorderLayout.SOUTH); } Metric4Panel.setBackground(Color.white); }
From source file:com.xilinx.virtex7.MainScreen.java
private JPanel messageBox() { JPanel tstats3 = new JPanel(new BorderLayout()); /*tstats3.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder("Message Log"), BorderFactory.createRaisedBevelBorder()));*/ JPanel trnPanel = new JPanel(new GridLayout(1, 1)); trnPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("PCIe Statistics"), BorderFactory.createRaisedBevelBorder())); JPanel trn1 = new JPanel(new FlowLayout()); trn1.add(new JLabel("Transmit (writes in Gbps): ")); trnLTX = new JTextField("0.0", 5); trnLTX.setEditable(false);/* ww w. ja v a2s . co m*/ trn1.add(trnLTX); trn1.add(new JLabel("Receive (reads in Gbps): ")); trnLRX = new JTextField("0.0", 5); trnLRX.setEditable(false); trn1.add(trnLRX); trnPanel.add(trn1); textArea = new CustomTextPane(); final JScrollPane scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Message Log"), BorderFactory.createRaisedBevelBorder())); scrollPane.setPreferredSize(new Dimension(scrollPane.getPreferredSize().width, 100)); //scrollPane.setMaximumSize(new Dimension(scrollPane.getPreferredSize().width, 100)); // keep scrollbar at end showing latest messages /*scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() { BoundedRangeModel brm = scrollPane.getVerticalScrollBar().getModel(); boolean wasAtBottom = true; @Override public void adjustmentValueChanged(AdjustmentEvent ae) { if (!brm.getValueIsAdjusting() && (scrollPane.) == brm.getMaximum()) { if (wasAtBottom) brm.setValue(brm.getMaximum()); } else wasAtBottom = ((brm.getValue() + brm.getExtent()) == brm.getMaximum()); } });*/ textArea.setEditable(false); tstats3.add(scrollPane, BorderLayout.CENTER); tstats3.add(trnPanel, BorderLayout.PAGE_START); return tstats3; // testPanel.add(tstats3, BorderLayout.PAGE_END); }
From source file:com.xilinx.virtex7.MainScreen.java
private JPanel testAndStatsSecondTab() { JPanel tstats = new JPanel(); tstats.setLayout(new BoxLayout(tstats, BoxLayout.Y_AXIS)); JPanel tstats1 = new JPanel(); tstats1.setLayout(new BoxLayout(tstats1, BoxLayout.Y_AXIS)); tstats1.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""), BorderFactory.createRaisedBevelBorder())); tstats1.add(testPanelItems2());// need to change testPanelItems method. JPanel dmaInner = new JPanel(new BorderLayout()); JPanel dmaPanel = new JPanel(new BorderLayout()); dmaPanel.setBackground(new Color(130, 170, 180)); table1T2 = new MyTableModel(dummy_data, dmaColumnNames2); dmaStats1T2 = new JTable(table1T2); try {//from ww w. j a v a 2 s. co m dmaStats1T2.setDefaultRenderer(Object.class, new CustomTableCellRenderer()); } catch (Exception e) { } JTableHeader dmaHeader = dmaStats1T2.getTableHeader(); dmaHeader.setForeground(new Color(92, 25, 25)); dmaPanel.add(dmaHeader, BorderLayout.PAGE_START); dmaPanel.add(dmaStats1T2, BorderLayout.CENTER); dmaInner.add(dmaPanel, BorderLayout.CENTER); tstats1.add(dmaInner); tstats.add(tstats1); /*JPanel trnPanel = new JPanel(new GridLayout(1,1)); trnPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder("PCIe Statistics"), BorderFactory.createRaisedBevelBorder())); JPanel trn1 = new JPanel(new FlowLayout()); trn1.add(new JLabel("Transmit (writes in Gbps): ")); trnLTXT2 = new JTextField("0.0", 5); trnLTXT2.setEditable(false); trn1.add(trnLTXT2); trn1.add(new JLabel("Receive (reads in Gbps): ")); trnLRXT2 = new JTextField("0.0", 5); trnLRXT2.setEditable(false); trn1.add(trnLRXT2); trnPanel.add(trn1); tstats.add(trnPanel);*/ JPanel tstats2 = new JPanel(); tstats2.setLayout(new BoxLayout(tstats2, BoxLayout.Y_AXIS)); tstats2.add(testPanelItems3()); tstats2.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""), BorderFactory.createRaisedBevelBorder())); JPanel dmaPanel1 = new JPanel(new BorderLayout()); table2T2 = new MyTableModel(dummy_data, dmaColumnNames3); dmaStats2T2 = new JTable(table2T2); try { dmaStats2T2.setDefaultRenderer(Object.class, new CustomTableCellRenderer()); } catch (Exception e) { } JTableHeader dmaHeader1 = dmaStats2T2.getTableHeader(); dmaHeader1.setForeground(new Color(92, 25, 25)); dmaPanel1.add(dmaHeader1, BorderLayout.PAGE_START); dmaPanel1.add(dmaStats2T2, BorderLayout.CENTER); tstats2.add(dmaPanel1); tstats.add(tstats2); return tstats; }
From source file:com.github.dougkelly88.FLIMPlateReaderGUI.SequencingClasses.GUIComponents.XYSequencing.java
private void genZStackButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_genZStackButtonActionPerformed //TODO: generate new FOV in current position if FOV table is empty. //TODO: /*w ww . j ava 2 s . com*/ double startUm = -1.0; double endUm = -1.0; double stepUm = 1.0; String um = "(" + "\u00B5" + "m)"; JLabel messageLabel = new JLabel("<html>Please enter start, end and delta values for Z stack: </html>"); JLabel startLabel = new JLabel("Start Z position " + um + ":"); JLabel endLabel = new JLabel("End Z position " + um + ":"); JLabel stepLabel = new JLabel("Step size " + um + ":"); // Uses a custom NumberFormat. NumberFormat customFormat = NumberFormat.getInstance(new Locale("en_US")); JFormattedTextField customFormatField = new JFormattedTextField(new NumberFormatter(customFormat)); JFormattedTextField startField = new JFormattedTextField(customFormat); startField.setValue(-3.0); JFormattedTextField endField = new JFormattedTextField(customFormat); endField.setValue(3.0); JFormattedTextField stepField = new JFormattedTextField(customFormat); stepField.setValue(1.0); JPanel zStackDialog = new JPanel(); zStackDialog.setLayout(new BorderLayout(50, 100)); JPanel controlsPanel = new JPanel(); controlsPanel.setLayout(new GridLayout(3, 2, 50, 10)); controlsPanel.add(startLabel); controlsPanel.add(startField); controlsPanel.add(endLabel); controlsPanel.add(endField); controlsPanel.add(stepLabel); controlsPanel.add(stepField); zStackDialog.add(messageLabel, BorderLayout.PAGE_START); zStackDialog.add(controlsPanel, BorderLayout.CENTER); int result = JOptionPane.showConfirmDialog(this, zStackDialog, "Z stack setup", JOptionPane.OK_CANCEL_OPTION); if (result == JOptionPane.OK_OPTION) { // must be a better way to achieve this...? if (startField.getValue().getClass() == Double.class) { startUm = (Double) (startField.getValue()); } else { startUm = ((Long) startField.getValue()).doubleValue(); } if (endField.getValue().getClass() == Double.class) { endUm = (Double) (endField.getValue()); } else { endUm = ((Long) endField.getValue()).doubleValue(); } if (stepField.getValue().getClass() == Double.class) { stepUm = (Double) (stepField.getValue()); } else { stepUm = ((Long) stepField.getValue()).doubleValue(); } setZStackParams(startUm, endUm, stepUm); doZStackGeneration(getZStackParams()); } }
From source file:org.domainmath.gui.MainFrame.java
/** This method is called from within the constructor to * initialize the form.// ww w . jav a 2s . co m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); jToolBar1 = new javax.swing.JToolBar(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jSeparator4 = new javax.swing.JToolBar.Separator(); connectButton = new javax.swing.JButton(); disconnectButton = new javax.swing.JButton(); jSeparator9 = new javax.swing.JToolBar.Separator(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jSeparator15 = new javax.swing.JToolBar.Separator(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jButton8 = new javax.swing.JButton(); jSeparator13 = new javax.swing.JToolBar.Separator(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); dirComboBox = new javax.swing.JComboBox(); folderUpButton = new javax.swing.JButton(); browseButton = new javax.swing.JButton(); addButton = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); fileMenu = new javax.swing.JMenu(); newFileItem = new javax.swing.JMenuItem(); openItem = new javax.swing.JMenuItem(); jSeparator17 = new javax.swing.JPopupMenu.Separator(); saveFileItem = new javax.swing.JMenuItem(); saveAsItem = new javax.swing.JMenuItem(); savePlotItem = new javax.swing.JMenuItem(); saveAllItem = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JPopupMenu.Separator(); printFileItem = new javax.swing.JMenuItem(); printItem = new javax.swing.JMenuItem(); jSeparator19 = new javax.swing.JPopupMenu.Separator(); preferencesItem = new javax.swing.JMenuItem(); jSeparator2 = new javax.swing.JPopupMenu.Separator(); connectItem = new javax.swing.JMenuItem(); disconnectItem = new javax.swing.JMenuItem(); jSeparator3 = new javax.swing.JPopupMenu.Separator(); exitItem = new javax.swing.JMenuItem(); editMenu = new javax.swing.JMenu(); undoItem = new javax.swing.JMenuItem(); redoItem = new javax.swing.JMenuItem(); jSeparator20 = new javax.swing.JPopupMenu.Separator(); cutItem = new javax.swing.JMenuItem(); copyItem = new javax.swing.JMenuItem(); pasteItem = new javax.swing.JMenuItem(); jSeparator21 = new javax.swing.JPopupMenu.Separator(); deleteItem = new javax.swing.JMenuItem(); selectAllItem = new javax.swing.JMenuItem(); jSeparator22 = new javax.swing.JPopupMenu.Separator(); jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); jSeparator23 = new javax.swing.JPopupMenu.Separator(); jMenuItem4 = new javax.swing.JMenuItem(); jMenuItem5 = new javax.swing.JMenuItem(); jSeparator24 = new javax.swing.JPopupMenu.Separator(); jMenuItem6 = new javax.swing.JMenuItem(); jMenuItem1 = new javax.swing.JMenuItem(); jSeparator11 = new javax.swing.JPopupMenu.Separator(); clearOutWindowItem = new javax.swing.JMenuItem(); jMenu3 = new javax.swing.JMenu(); consoleItem = new javax.swing.JMenuItem(); historyItem = new javax.swing.JMenuItem(); filesItem = new javax.swing.JMenuItem(); workspaceItem = new javax.swing.JMenuItem(); codeEditorItem = new javax.swing.JMenuItem(); pathsItem = new javax.swing.JMenuItem(); pkgsItem = new javax.swing.JMenuItem(); arrayEditItem = new javax.swing.JMenuItem(); jMenuItem7 = new javax.swing.JMenuItem(); jMenu1 = new javax.swing.JMenu(); findItem = new javax.swing.JMenuItem(); replaceItem = new javax.swing.JMenuItem(); gotoItem = new javax.swing.JMenuItem(); jSeparator25 = new javax.swing.JPopupMenu.Separator(); googleItem = new javax.swing.JMenuItem(); wikiItem = new javax.swing.JMenuItem(); pkgMenu = new javax.swing.JMenu(); debugMenu = new javax.swing.JMenu(); runScriptItem = new javax.swing.JMenuItem(); runScriptCItem = new javax.swing.JMenuItem(); jMenuItem8 = new javax.swing.JMenuItem(); jSeparator8 = new javax.swing.JPopupMenu.Separator(); debugScriptMenuItem = new javax.swing.JMenuItem(); testScriptMenuItem = new javax.swing.JMenuItem(); toggleBreakpointItem = new javax.swing.JMenuItem(); removeToggleBreakpointItem = new javax.swing.JMenuItem(); clearAllBreakpointsItem = new javax.swing.JMenuItem(); jSeparator10 = new javax.swing.JPopupMenu.Separator(); stepItem = new javax.swing.JMenuItem(); stepInItem = new javax.swing.JMenuItem(); stepOutItem = new javax.swing.JMenuItem(); continueItem = new javax.swing.JMenuItem(); jSeparator5 = new javax.swing.JPopupMenu.Separator(); finishDebugItem = new javax.swing.JMenuItem(); toolsMenu = new javax.swing.JMenu(); fltkplotItem = new javax.swing.JMenuItem(); octaveCmdItem = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); previousWindowItem = new javax.swing.JMenuItem(); nextWindowItem = new javax.swing.JMenuItem(); jSeparator29 = new javax.swing.JPopupMenu.Separator(); closeItem = new javax.swing.JMenuItem(); closeAllItem = new javax.swing.JMenuItem(); jSeparator18 = new javax.swing.JPopupMenu.Separator(); windowsItem = new javax.swing.JMenuItem(); helpMenu = new javax.swing.JMenu(); forumItem = new javax.swing.JMenuItem(); octaveInfoItem = new javax.swing.JMenuItem(); jSeparator12 = new javax.swing.JPopupMenu.Separator(); quickHelpItem = new javax.swing.JMenuItem(); jMenuItem9 = new javax.swing.JMenuItem(); docPkgItem = new javax.swing.JMenuItem(); referenceMenu = new javax.swing.JMenu(); referenceItem = new javax.swing.JMenuItem(); jSeparator6 = new javax.swing.JPopupMenu.Separator(); checkForUpdatesMenuItem = new javax.swing.JMenuItem(); onlineHelpItem = new javax.swing.JMenuItem(); faqItem = new javax.swing.JMenuItem(); jSeparator14 = new javax.swing.JPopupMenu.Separator(); reportBugItem = new javax.swing.JMenuItem(); feedBackItem = new javax.swing.JMenuItem(); jSeparator7 = new javax.swing.JPopupMenu.Separator(); AboutItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); java.util.ResourceBundle bundle = java.util.ResourceBundle .getBundle("org/domainmath/gui/resources/DomainMath_en"); // NOI18N setTitle(bundle.getString("DomainMath.title")); // NOI18N addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } }); jToolBar1.setRollover(true); jToolBar1.setName("Standard"); // NOI18N jButton1.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/document-new.png"))); // 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); } }); jToolBar1.add(jButton1); jButton2.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/document-open.png"))); // NOI18N jButton2.setFocusable(false); jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jToolBar1.add(jButton2); jButton3.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/document-save-all.png"))); // NOI18N jButton3.setFocusable(false); jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jToolBar1.add(jButton3); jToolBar1.add(jSeparator4); connectButton.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/connect.png"))); // NOI18N connectButton.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("connectItem.mnemonic").charAt(0)); connectButton.setToolTipText(bundle.getString("connectItem.tooltip")); // NOI18N connectButton.setFocusable(false); connectButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); connectButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); connectButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { connectButtonActionPerformed(evt); } }); jToolBar1.add(connectButton); disconnectButton.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/disconnect.png"))); // NOI18N disconnectButton .setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("disconnectItem.mnemonic").charAt(0)); disconnectButton.setToolTipText(bundle.getString("disconnectItem.tooltip")); // NOI18N disconnectButton.setFocusable(false); disconnectButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); disconnectButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); disconnectButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { disconnectButtonActionPerformed(evt); } }); jToolBar1.add(disconnectButton); jToolBar1.add(jSeparator9); jButton4.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-undo.png"))); // NOI18N jButton4.setFocusable(false); jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jToolBar1.add(jButton4); jButton5.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-redo.png"))); // NOI18N jButton5.setFocusable(false); jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jToolBar1.add(jButton5); jToolBar1.add(jSeparator15); jButton6.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-cut.png"))); // NOI18N jButton6.setFocusable(false); jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jToolBar1.add(jButton6); jButton7.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-copy.png"))); // NOI18N jButton7.setFocusable(false); jButton7.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton7.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jToolBar1.add(jButton7); jButton8.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-paste.png"))); // NOI18N jButton8.setFocusable(false); jButton8.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton8.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton8ActionPerformed(evt); } }); jToolBar1.add(jButton8); jToolBar1.add(jSeparator13); jLabel1.setText("Current Directory:"); dirComboBox.setEditable(true); dirComboBox.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { dirComboBoxItemStateChanged(evt); } }); 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(1, 1, 1).addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(dirComboBox, 0, 112, Short.MAX_VALUE).addGap(1, 1, 1))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(5, 5, 5).addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1) .addComponent(dirComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(3, 3, 3))); jToolBar1.add(jPanel1); folderUpButton.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/size22x22/go-up.png"))); // NOI18N folderUpButton.setToolTipText("Up"); folderUpButton.setFocusable(false); folderUpButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); folderUpButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); folderUpButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { folderUpButtonActionPerformed(evt); } }); jToolBar1.add(folderUpButton); browseButton.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/document-open.png"))); // NOI18N browseButton.setToolTipText(bundle.getString("browseButton.title")); // NOI18N browseButton.setFocusable(false); browseButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); browseButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); browseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { browseButtonActionPerformed(evt); } }); jToolBar1.add(browseButton); addButton.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-add.png"))); // NOI18N addButton.setToolTipText(bundle.getString("addButton.title")); // NOI18N addButton.setFocusable(false); addButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); addButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); addButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addButtonActionPerformed(evt); } }); jToolBar1.add(addButton); getContentPane().add(jToolBar1, java.awt.BorderLayout.PAGE_START); fileMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("fileMenu.mnemonic").charAt(0)); fileMenu.setText(bundle.getString("fileMenu.name")); // NOI18N newFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK)); newFileItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-new.png"))); // NOI18N newFileItem.setText("New"); newFileItem.setToolTipText(bundle.getString("newMenuItem.tooltip")); // NOI18N newFileItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newFileItemActionPerformed(evt); } }); fileMenu.add(newFileItem); openItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK)); openItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-open.png"))); // NOI18N openItem.setText("Open..."); openItem.setToolTipText("Open File"); openItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { openItemActionPerformed(evt); } }); fileMenu.add(openItem); fileMenu.add(jSeparator17); saveFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); saveFileItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-save.png"))); // NOI18N saveFileItem.setText("Save "); saveFileItem.setToolTipText(bundle.getString("saveMenuItem.tooltp")); // NOI18N saveFileItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveFileItemActionPerformed(evt); } }); fileMenu.add(saveFileItem); saveAsItem.setText("Save As..."); saveAsItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveAsItemActionPerformed(evt); } }); fileMenu.add(saveAsItem); savePlotItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("savePlotItem.mnemonic").charAt(0)); savePlotItem.setText(bundle.getString("savePlotItem.name")); // NOI18N savePlotItem.setToolTipText(bundle.getString("savePlotItem.tooltip")); // NOI18N savePlotItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { savePlotItemActionPerformed(evt); } }); fileMenu.add(savePlotItem); saveAllItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); saveAllItem.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/document-save-all.png"))); // NOI18N saveAllItem.setText(bundle.getString("saveAllMenuItem.text")); // NOI18N saveAllItem.setToolTipText(bundle.getString("saveAllMenuItem.tooltip")); // NOI18N saveAllItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveAllItemActionPerformed(evt); } }); fileMenu.add(saveAllItem); fileMenu.add(jSeparator1); printFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK)); printFileItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-print2.png"))); // NOI18N printFileItem.setText("Print"); printFileItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { printFileItemActionPerformed(evt); } }); fileMenu.add(printFileItem); printItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); printItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("printItem.mnemonic").charAt(0)); printItem.setText(bundle.getString("printItem.name")); // NOI18N printItem.setToolTipText(bundle.getString("printItem.tooltip")); // NOI18N printItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { printItemActionPerformed(evt); } }); fileMenu.add(printItem); fileMenu.add(jSeparator19); preferencesItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/preferences.png"))); // NOI18N preferencesItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("preferecesItem.mnemonic").charAt(0)); preferencesItem.setText(bundle.getString("preferencesItem.name")); // NOI18N preferencesItem.setToolTipText(bundle.getString("preferencesItem.tooltip")); // NOI18N preferencesItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { preferencesItemActionPerformed(evt); } }); fileMenu.add(preferencesItem); fileMenu.add(jSeparator2); connectItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/connect.png"))); // NOI18N connectItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("connectItem.mnemonic").charAt(0)); connectItem.setText(bundle.getString("connectItem.name")); // NOI18N connectItem.setToolTipText(bundle.getString("connectItem.tooltip")); // NOI18N connectItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { connectItemActionPerformed(evt); } }); fileMenu.add(connectItem); disconnectItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/disconnect.png"))); // NOI18N disconnectItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("disconnectItem.mnemonic").charAt(0)); disconnectItem.setText(bundle.getString("disconnectItem.name")); // NOI18N disconnectItem.setToolTipText(bundle.getString("disconnectItem.tooltip")); // NOI18N disconnectItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { disconnectItemActionPerformed(evt); } }); fileMenu.add(disconnectItem); fileMenu.add(jSeparator3); exitItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("exitItem.mnemonic").charAt(0)); exitItem.setText(bundle.getString("exitItem.name")); // NOI18N exitItem.setToolTipText(bundle.getString("exitItem.tooltip")); // NOI18N exitItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitItemActionPerformed(evt); } }); fileMenu.add(exitItem); jMenuBar1.add(fileMenu); editMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("editMenu.mnemonic").charAt(0)); editMenu.setText("Edit"); undoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.CTRL_MASK)); undoItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-undo.png"))); // NOI18N undoItem.setText("Undo"); undoItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { undoItemActionPerformed(evt); } }); editMenu.add(undoItem); redoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, java.awt.event.InputEvent.CTRL_MASK)); redoItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-redo.png"))); // NOI18N redoItem.setText("Redo"); redoItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { redoItemActionPerformed(evt); } }); editMenu.add(redoItem); editMenu.add(jSeparator20); cutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK)); cutItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-cut.png"))); // NOI18N cutItem.setText("Cut"); cutItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cutItemActionPerformed(evt); } }); editMenu.add(cutItem); copyItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK)); copyItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-copy.png"))); // NOI18N copyItem.setText("Copy"); copyItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { copyItemActionPerformed(evt); } }); editMenu.add(copyItem); pasteItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK)); pasteItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-paste.png"))); // NOI18N pasteItem.setText("Paste"); pasteItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pasteItemActionPerformed(evt); } }); editMenu.add(pasteItem); editMenu.add(jSeparator21); deleteItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-delete.png"))); // NOI18N deleteItem.setText("Delete"); deleteItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { deleteItemActionPerformed(evt); } }); editMenu.add(deleteItem); selectAllItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK)); selectAllItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-select-all.png"))); // NOI18N selectAllItem.setText("Select All"); selectAllItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectAllItemActionPerformed(evt); } }); editMenu.add(selectAllItem); editMenu.add(jSeparator22); jMenuItem2.setAction(new RSyntaxTextAreaEditorKit.InsertTabAction()); jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem2.setText("Increase Indent"); editMenu.add(jMenuItem2); jMenuItem3.setAction(new RSyntaxTextAreaEditorKit.DecreaseIndentAction()); jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB, java.awt.event.InputEvent.SHIFT_MASK)); jMenuItem3.setText("Decrease Indent"); editMenu.add(jMenuItem3); editMenu.add(jSeparator23); jMenuItem4.setAction(new RTextAreaEditorKit.UpperSelectionCaseAction()); jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem4.setText("Make Uppercase"); editMenu.add(jMenuItem4); jMenuItem5.setAction(new RTextAreaEditorKit.LowerSelectionCaseAction()); jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); jMenuItem5.setText("Make Lowercase"); editMenu.add(jMenuItem5); editMenu.add(jSeparator24); jMenuItem6.setText("Clear All Marks..."); jMenuItem6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem6ActionPerformed(evt); } }); editMenu.add(jMenuItem6); jMenuItem1.setAction(new RSyntaxTextAreaEditorKit.ToggleCommentAction()); jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_SLASH, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem1.setText("Toggle Comment"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); editMenu.add(jMenuItem1); editMenu.add(jSeparator11); clearOutWindowItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK)); clearOutWindowItem .setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("clearOutputWindowItem.mnemonic").charAt(0)); clearOutWindowItem.setText(bundle.getString("clearOutputWindowItem.name")); // NOI18N clearOutWindowItem.setToolTipText(bundle.getString("clearOutputWindowItem.tooltip")); // NOI18N clearOutWindowItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clearOutWindowItemActionPerformed(evt); } }); editMenu.add(clearOutWindowItem); jMenuBar1.add(editMenu); jMenu3.setText(bundle.getString("viewMenu.title")); // NOI18N consoleItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_0, java.awt.event.InputEvent.CTRL_MASK)); consoleItem.setText(bundle.getString("consoleItem.title")); // NOI18N consoleItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { consoleItemActionPerformed(evt); } }); jMenu3.add(consoleItem); historyItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_1, java.awt.event.InputEvent.CTRL_MASK)); historyItem.setText(bundle.getString("historyItem.title")); // NOI18N historyItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { historyItemActionPerformed(evt); } }); jMenu3.add(historyItem); filesItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_2, java.awt.event.InputEvent.CTRL_MASK)); filesItem.setText(bundle.getString("filesItem.title")); // NOI18N filesItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { filesItemActionPerformed(evt); } }); jMenu3.add(filesItem); workspaceItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_3, java.awt.event.InputEvent.CTRL_MASK)); workspaceItem.setText(bundle.getString("worksaceItem.title")); // NOI18N workspaceItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { workspaceItemActionPerformed(evt); } }); jMenu3.add(workspaceItem); codeEditorItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_4, java.awt.event.InputEvent.CTRL_MASK)); codeEditorItem.setText(bundle.getString("codeEditorItem.title")); // NOI18N codeEditorItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { codeEditorItemActionPerformed(evt); } }); jMenu3.add(codeEditorItem); pathsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_5, java.awt.event.InputEvent.CTRL_MASK)); pathsItem.setText(bundle.getString("setPathsItem.title")); // NOI18N pathsItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pathsItemActionPerformed(evt); } }); jMenu3.add(pathsItem); pkgsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_6, java.awt.event.InputEvent.CTRL_MASK)); pkgsItem.setText(bundle.getString("pkgsItem.title")); // NOI18N pkgsItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pkgsItemActionPerformed(evt); } }); jMenu3.add(pkgsItem); arrayEditItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_7, java.awt.event.InputEvent.CTRL_MASK)); arrayEditItem.setText(bundle.getString("arrayEidtorItem.title")); // NOI18N arrayEditItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { arrayEditItemActionPerformed(evt); } }); jMenu3.add(arrayEditItem); jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_8, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem7.setText("Debugger Window"); jMenuItem7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem7ActionPerformed(evt); } }); jMenu3.add(jMenuItem7); jMenuBar1.add(jMenu3); jMenu1.setMnemonic('S'); jMenu1.setText("Search"); findItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK)); findItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-find.png"))); // NOI18N findItem.setMnemonic('F'); findItem.setText("Find..."); findItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { findItemActionPerformed(evt); } }); jMenu1.add(findItem); replaceItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK)); replaceItem.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/domainmath/gui/icons/edit-find-replace.png"))); // NOI18N replaceItem.setText("Replace..."); replaceItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { replaceItemActionPerformed(evt); } }); jMenu1.add(replaceItem); gotoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); gotoItem.setText("Go To..."); gotoItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { gotoItemActionPerformed(evt); } }); jMenu1.add(gotoItem); jMenu1.add(jSeparator25); googleItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.CTRL_MASK)); googleItem.setText("Google Search"); googleItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { googleItemActionPerformed(evt); } }); jMenu1.add(googleItem); wikiItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); wikiItem.setText("Wikipedia Search"); wikiItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { wikiItemActionPerformed(evt); } }); jMenu1.add(wikiItem); jMenuBar1.add(jMenu1); pkgMenu.setText(bundle.getString("pkgMenu.name")); // NOI18N jMenuBar1.add(pkgMenu); debugMenu.setText("Debug"); runScriptItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F6, 0)); runScriptItem .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/Run.png"))); // NOI18N runScriptItem.setText("Run Script"); runScriptItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { runScriptItemActionPerformed(evt); } }); debugMenu.add(runScriptItem); runScriptCItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F6, java.awt.event.InputEvent.SHIFT_MASK)); runScriptCItem.setText("Run Script from Console"); runScriptCItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { runScriptCItemActionPerformed(evt); } }); debugMenu.add(runScriptCItem); jMenuItem8.setText("Edit Run Configuration"); jMenuItem8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem8ActionPerformed(evt); } }); debugMenu.add(jMenuItem8); debugMenu.add(jSeparator8); debugScriptMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, java.awt.event.InputEvent.CTRL_MASK)); debugScriptMenuItem.setText("Debug Script"); debugScriptMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { debugScriptMenuItemActionPerformed(evt); } }); debugMenu.add(debugScriptMenuItem); testScriptMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); testScriptMenuItem.setText("Test Script"); testScriptMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { testScriptMenuItemActionPerformed(evt); } }); debugMenu.add(testScriptMenuItem); toggleBreakpointItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9, 0)); toggleBreakpointItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/resources/stop.png"))); // NOI18N toggleBreakpointItem.setText("Toggle Breakpoint"); toggleBreakpointItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { toggleBreakpointItemActionPerformed(evt); } }); debugMenu.add(toggleBreakpointItem); removeToggleBreakpointItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9, java.awt.event.InputEvent.SHIFT_MASK)); removeToggleBreakpointItem.setText("Remove Toggle Breakpoint"); removeToggleBreakpointItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeToggleBreakpointItemActionPerformed(evt); } }); debugMenu.add(removeToggleBreakpointItem); clearAllBreakpointsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); clearAllBreakpointsItem.setText("Clear All Breakpoints..."); clearAllBreakpointsItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clearAllBreakpointsItemActionPerformed(evt); } }); debugMenu.add(clearAllBreakpointsItem); debugMenu.add(jSeparator10); stepItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F10, java.awt.event.InputEvent.SHIFT_MASK)); stepItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/step.png"))); // NOI18N stepItem.setText("Step"); stepItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stepItemActionPerformed(evt); } }); debugMenu.add(stepItem); stepInItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F11, 0)); stepInItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/step-in.png"))); // NOI18N stepInItem.setText("Step in"); stepInItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stepInItemActionPerformed(evt); } }); debugMenu.add(stepInItem); stepOutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F11, java.awt.event.InputEvent.SHIFT_MASK)); stepOutItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/step-out.png"))); // NOI18N stepOutItem.setText("Step out"); stepOutItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stepOutItemActionPerformed(evt); } }); debugMenu.add(stepOutItem); continueItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F8, 0)); continueItem.setText("Continue"); continueItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { continueItemActionPerformed(evt); } }); debugMenu.add(continueItem); debugMenu.add(jSeparator5); finishDebugItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, java.awt.event.InputEvent.SHIFT_MASK)); finishDebugItem .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/finish.png"))); // NOI18N finishDebugItem.setText("Finish Debugger Session"); finishDebugItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { finishDebugItemActionPerformed(evt); } }); debugMenu.add(finishDebugItem); jMenuBar1.add(debugMenu); toolsMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("ToolsMenu.mnemonic").charAt(0)); toolsMenu.setText(bundle.getString("ToolsMenu.name")); // NOI18N fltkplotItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); fltkplotItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("fltkPlotItem.mnemonic").charAt(0)); fltkplotItem.setText(bundle.getString("fltkPlotItem.name")); // NOI18N fltkplotItem.setToolTipText(bundle.getString("fltkPlotItem.tooltip")); // NOI18N fltkplotItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { fltkplotItemActionPerformed(evt); } }); toolsMenu.add(fltkplotItem); octaveCmdItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("octaveCmdItem.mnemonic").charAt(0)); octaveCmdItem.setText(bundle.getString("octaveCmdItem.name")); // NOI18N octaveCmdItem.setToolTipText(bundle.getString("octaveCmdItem.tooltip")); // NOI18N octaveCmdItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { octaveCmdItemActionPerformed(evt); } }); toolsMenu.add(octaveCmdItem); jMenuBar1.add(toolsMenu); jMenu2.setText(bundle.getString("windowMenu.title")); // NOI18N previousWindowItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_DOWN, java.awt.event.InputEvent.CTRL_MASK)); previousWindowItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/go-previous.png"))); // NOI18N previousWindowItem.setText(bundle.getString("previousWindowItem.title")); // NOI18N previousWindowItem.setToolTipText(bundle.getString("previousWindowItem.tooltip")); // NOI18N previousWindowItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { previousWindowItemActionPerformed(evt); } }); jMenu2.add(previousWindowItem); nextWindowItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_UP, java.awt.event.InputEvent.CTRL_MASK)); nextWindowItem.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/go-next.png"))); // NOI18N nextWindowItem.setText(bundle.getString("nextWindowItem.title")); // NOI18N nextWindowItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nextWindowItemActionPerformed(evt); } }); jMenu2.add(nextWindowItem); jMenu2.add(jSeparator29); closeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.ALT_MASK)); closeItem.setText(bundle.getString("closeMenuItem.name")); // NOI18N closeItem.setToolTipText(bundle.getString("closeItem.tooltip")); // NOI18N closeItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { closeItemActionPerformed(evt); } }); jMenu2.add(closeItem); closeAllItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.SHIFT_MASK)); closeAllItem.setText(bundle.getString("closeAllItem.name")); // NOI18N closeAllItem.setToolTipText(bundle.getString("closeAllItem.tooltip")); // NOI18N closeAllItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { closeAllItemActionPerformed(evt); } }); jMenu2.add(closeAllItem); jMenu2.add(jSeparator18); windowsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.SHIFT_MASK)); windowsItem.setText(bundle.getString("windowsItem.title")); // NOI18N windowsItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { windowsItemActionPerformed(evt); } }); jMenu2.add(windowsItem); jMenuBar1.add(jMenu2); helpMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("helpMenu.mnemonic").charAt(0)); helpMenu.setText(bundle.getString("helpMenu.name")); // NOI18N forumItem.setText("Forum"); forumItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { forumItemActionPerformed(evt); } }); helpMenu.add(forumItem); octaveInfoItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("octInfoItem.mnemonic").charAt(0)); octaveInfoItem.setText(bundle.getString("octInfoItem.name")); // NOI18N octaveInfoItem.setToolTipText(bundle.getString("octInfoItem.tooltip")); // NOI18N octaveInfoItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { octaveInfoItemActionPerformed(evt); } }); helpMenu.add(octaveInfoItem); helpMenu.add(jSeparator12); quickHelpItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0)); quickHelpItem.setText(bundle.getString("quickHelpItem.name")); // NOI18N quickHelpItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { quickHelpItemActionPerformed(evt); } }); helpMenu.add(quickHelpItem); jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, java.awt.event.InputEvent.SHIFT_MASK)); jMenuItem9.setText("Package Documentation"); jMenuItem9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem9ActionPerformed(evt); } }); helpMenu.add(jMenuItem9); docPkgItem.setText("Package Online Documentation"); docPkgItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { docPkgItemActionPerformed(evt); } }); helpMenu.add(docPkgItem); referenceMenu.setText(bundle.getString("referencesMenu.name")); // NOI18N helpMenu.add(referenceMenu); referenceItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("addReferencesItem.mnemonic").charAt(0)); referenceItem.setText(bundle.getString("addReferencesItem.name")); // NOI18N referenceItem.setToolTipText(bundle.getString("addReferencesItem.tooltip")); // NOI18N referenceItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { referenceItemActionPerformed(evt); } }); helpMenu.add(referenceItem); helpMenu.add(jSeparator6); checkForUpdatesMenuItem.setText(bundle.getString("checkForUpdatesMenuItem.text")); // NOI18N checkForUpdatesMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkForUpdatesMenuItemActionPerformed(evt); } }); helpMenu.add(checkForUpdatesMenuItem); onlineHelpItem.setText("Help and Support"); onlineHelpItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { onlineHelpItemActionPerformed(evt); } }); helpMenu.add(onlineHelpItem); faqItem.setText("Online FAQ"); faqItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { faqItemActionPerformed(evt); } }); helpMenu.add(faqItem); helpMenu.add(jSeparator14); reportBugItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("reportBugItem.mnemonic").charAt(0)); reportBugItem.setText(bundle.getString("reportBugItem.name")); // NOI18N reportBugItem.setToolTipText(bundle.getString("reportBugItem.tooltip")); // NOI18N reportBugItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { reportBugItemActionPerformed(evt); } }); helpMenu.add(reportBugItem); feedBackItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("yourFeedbackItem.mnemonic").charAt(0)); feedBackItem.setText(bundle.getString("yourFeedbackItem.name")); // NOI18N feedBackItem.setToolTipText(bundle.getString("yourFeedbackItem.tooltip")); // NOI18N feedBackItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { feedBackItemActionPerformed(evt); } }); helpMenu.add(feedBackItem); helpMenu.add(jSeparator7); AboutItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en") .getString("aboutItem.mnemonic").charAt(0)); AboutItem.setText(bundle.getString("aboutItem.name")); // NOI18N AboutItem.setToolTipText(bundle.getString("aboutItem.tooltip")); // NOI18N AboutItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { AboutItemActionPerformed(evt); } }); helpMenu.add(AboutItem); jMenuBar1.add(helpMenu); setJMenuBar(jMenuBar1); pack(); }
From source file:com.xilinx.virtex7.MainScreen.java
private JPanel pciInfo() { JPanel pciSystemPanel = new JPanel(); pciSystemPanel.setLayout(new BoxLayout(pciSystemPanel, BoxLayout.Y_AXIS)); //pciSystemPanel.setLayout(new GridLayout(2, 1)); JPanel topPanel = new JPanel(new GridLayout(1, 2)); topPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("PCIe Settings"), BorderFactory.createRaisedBevelBorder())); /*JPanel sPanel = new JPanel(new FlowLayout()); sPanel.add(new JLabel("Link Speed: ")); Object[] speeds = {"2.5 Gbps","5.0 Gbps"}; final PartialDisableComboBox lspeed = new PartialDisableComboBox(); lspeed.addItems(speeds);//from w w w .j av a2s . com // hack for safe exit if (di.getPCIInfo().LinkSpeed != 0 && di.getPCIInfo().LinkSpeed-1 < speeds.length){ lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed-1); lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed-1, false); }else{ if (di.getPCIInfo().LinkSpeed == 4){ System.out.println(di.getPCIInfo().LinkSpeed-2); // lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed-2); // lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed-2, false); }else updateLog("Invalid Link Speed", keyWord); } sPanel.add(lspeed); JButton setSpeed = new JButton("Go"); setSpeed.setToolTipText("This enables directed PCIe link speed change"); setSpeed.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { if (lspeed.isItemEnabled(lspeed.getSelectedIndex())) { int ret = 0; if (lspeed.getSelectedIndex() == 2) ret = di.setLinkSpeed(lspeed.getSelectedIndex()+2); else ret = di.setLinkSpeed(lspeed.getSelectedIndex()+1); if (ret == 0){ //update pcie information di.get_PCIstate(); lspeed.setItemEnabled(0, true); lspeed.setItemEnabled(1, true); lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed-1); lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed-1, false); ptable.setData(di.getPCIInfo().getPCIData(), pcieColumnNames); ptable.fireTableDataChanged(); } else{ updateLog("Unable to set Link Speed "+lspeed.getSelectedItem(), keyWord); } } } }); sPanel.add(setSpeed); // topPanel.add(sPanel); JPanel sPanel1 = new JPanel(new FlowLayout()); sPanel1.add(new JLabel("Link Width: ")); Object[] widths = {"x1","x2","x4","x8"}; final PartialDisableComboBox lwidths = new PartialDisableComboBox(); lwidths.addItems(widths); lwidths.setSelectedItem("x"+di.getPCIInfo().LinkWidth); lwidths.setItemEnabled(lwidths.getSelectedIndex(), false); sPanel1.add(lwidths); JButton setWidth = new JButton("Go"); setWidth.setToolTipText("This enables directed PCIe link width change"); setWidth.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { if (lwidths.isItemEnabled(lwidths.getSelectedIndex())) { int ret = di.setLinkWidth(lwidths.getSelectedIndex()+1); if (ret == 0){ //update pcie information // some times width change affect link speed so // enable the same in lspeedd also di.get_PCIstate(); lwidths.setItemEnabled(0, true); lwidths.setItemEnabled(1, true); lwidths.setItemEnabled(2, true); lwidths.setItemEnabled(3, true); lwidths.setSelectedItem("x"+di.getPCIInfo().LinkWidth); lwidths.setItemEnabled(lwidths.getSelectedIndex(), false); // some times width change affect link speed so // enable the same in lspeed also lspeed.setItemEnabled(0, true); lspeed.setItemEnabled(1, true); lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed-1); lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed-1, false); ptable.setData(di.getPCIInfo().getPCIData(), pcieColumnNames); ptable.fireTableDataChanged(); }else { di.get_PCIstate(); int upCap = di.getPCIInfo().LinkUpCap; if (upCap == 0) updateLog("Unable to set Link Width "+lwidths.getSelectedItem()+". PCIe link not upconfigurable", keyWord); else updateLog("Unable to set Link Width "+lwidths.getSelectedItem(), keyWord); } } } }); sPanel1.add(setWidth); // topPanel.add(sPanel1); */ // pciSystemPanel.add(topPanel); JPanel panel = new JPanel(new GridLayout(1, 2)); JPanel pciPanel = new JPanel(new BorderLayout()); pciPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder("PCIe Endpoint Status"), BorderFactory.createRaisedBevelBorder())); ptable = new MyTableModel(di.getPCIInfo().getPCIData(), pcieColumnNames); pcieTable = new JTable(ptable); try { pcieTable.setDefaultRenderer(Object.class, new CustomTableCellRenderer()); } catch (Exception e) { } JTableHeader pcieHeader = pcieTable.getTableHeader(); pcieHeader.setForeground(new Color(92, 25, 25)); pciPanel.add(pcieHeader, BorderLayout.PAGE_START); pciPanel.add(pcieTable, BorderLayout.CENTER); panel.add(pciPanel); JPanel hostPanel = new JPanel(new BorderLayout()); hostPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder("Host System's Initial Credits"), BorderFactory.createRaisedBevelBorder())); htable = new MyTableModel(di.getPCIInfo().getHostedData(), pcieColumnNames); hostTable = new JTable(htable); try { hostTable.setDefaultRenderer(Object.class, new CustomTableCellRenderer()); } catch (Exception e) { } JTableHeader hostHeader = hostTable.getTableHeader(); hostHeader.setForeground(new Color(92, 25, 25)); hostPanel.add(hostHeader, BorderLayout.PAGE_START); hostPanel.add(hostTable, BorderLayout.CENTER); panel.add(hostPanel); pciSystemPanel.add(panel); pciSystemPanel.add(dialChart(pciSystemPanel.getWidth())); return pciSystemPanel; }
From source file:org.prom5.analysis.performance.PerformanceAnalysisGUI.java
/** * Calculates the metrics belonging to a place and displays the * results.// w w w . j ava 2s. c o m * @param place ExtendedPlace: the place of which the values of metrics are * calculated. */ private void displayPlaceMetrics(ExtendedPlace place) { ArrayList instanceIDList = getSelectedInstanceIDs(); tablePanel.removeAll(); tablePanel.add(placeTable.getTableHeader(), BorderLayout.PAGE_START); tablePanel.add(placeTable, BorderLayout.CENTER); try { //calculate place metrics place.calculateMetrics(instanceIDList, advancedSettings[1], failedInstances); //initialize the placeTable ThreeMetricsTableModel ptm = new ThreeMetricsTableModel(); ptm.setHeadings("", "Waiting time (" + timeSort + ")", "Synchronization time (" + timeSort + ")", "Sojourn time (" + timeSort + ")"); placeTable.setModel(ptm); placeTable.setBorder(BorderFactory.createEtchedBorder()); placeTable.setPreferredSize(new Dimension(480, 112)); placeTable.setMinimumSize(new Dimension(480, 112)); placeTable.getColumnModel().getColumn(0).setPreferredWidth(60); placeTable.getColumnModel().getColumn(0).setMaxWidth(150); placeTable.getColumnModel().getColumn(2).setPreferredWidth(100); placeTable.setRowSelectionAllowed(false); placeTable.getTableHeader().setFont(new Font("SansSerif", Font.BOLD, 12)); DefaultTableCellRenderer dtcr = new DefaultTableCellRenderer(); dtcr.setBackground(new Color(235, 235, 235)); dtcr.setFont(new Font("SansSerif", Font.BOLD, 12)); placeTable.getColumnModel().getColumn(0).setCellRenderer(dtcr); //place time metrics in the table placeTable.setValueAt(formatString(place.getMeanWaitingTime() / timeDivider, decimalPlaces), 0, 1); placeTable.setValueAt(formatString(place.getMeanSynchronizationTime() / timeDivider, decimalPlaces), 0, 2); placeTable.setValueAt(formatString(place.getMeanSojournTime() / timeDivider, decimalPlaces), 0, 3); placeTable.setValueAt(formatString((place.getMinWaitingTime() * 1.0) / timeDivider, decimalPlaces), 1, 1); placeTable.setValueAt( formatString((place.getMinSynchronizationTime() * 1.0) / timeDivider, decimalPlaces), 1, 2); placeTable.setValueAt(formatString((place.getMinSojournTime() * 1.0) / timeDivider, decimalPlaces), 1, 3); placeTable.setValueAt(formatString((place.getMaxWaitingTime() * 1.0) / timeDivider, decimalPlaces), 2, 1); placeTable.setValueAt( formatString((place.getMaxSynchronizationTime() * 1.0) / timeDivider, decimalPlaces), 2, 2); placeTable.setValueAt(formatString((place.getMaxSojournTime() * 1.0) / timeDivider, decimalPlaces), 2, 3); placeTable.setValueAt(formatString(place.getStdevWaitingTime() / timeDivider, decimalPlaces), 3, 1); placeTable.setValueAt(formatString(place.getStdevSynchronizationTime() / timeDivider, decimalPlaces), 3, 2); placeTable.setValueAt(formatString(place.getStdevSojournTime() / timeDivider, decimalPlaces), 3, 3); double[] avgTimes = place.getAvgTimes(fastestPlacePercentage, slowestPlacePercentage); placeTable.setValueAt(formatString(avgTimes[0] / timeDivider, decimalPlaces), 4, 1); placeTable.setValueAt(formatString(avgTimes[1] / timeDivider, decimalPlaces), 4, 2); placeTable.setValueAt(formatString(avgTimes[2] / timeDivider, decimalPlaces), 4, 3); placeTable.setValueAt(formatString(avgTimes[3] / timeDivider, decimalPlaces), 5, 1); placeTable.setValueAt(formatString(avgTimes[4] / timeDivider, decimalPlaces), 5, 2); placeTable.setValueAt(formatString(avgTimes[5] / timeDivider, decimalPlaces), 5, 3); placeTable.setValueAt(formatString(avgTimes[6] / timeDivider, decimalPlaces), 6, 1); placeTable.setValueAt(formatString(avgTimes[7] / timeDivider, decimalPlaces), 6, 2); placeTable.setValueAt(formatString(avgTimes[8] / timeDivider, decimalPlaces), 6, 3); DecimalFormat df = new DecimalFormat("0.00"); int[] sizes = place.getSizes(fastestPlacePercentage, slowestPlacePercentage); placeTable.setValueAt("fast " + df.format(fastestPlacePercentage) + "%(" + sizes[0] + ")", 4, 0); placeTable.setValueAt("slow " + df.format(slowestPlacePercentage) + "%(" + sizes[1] + ")", 5, 0); placeTable.setValueAt("normal " + df.format(100 - fastestPlacePercentage - slowestPlacePercentage) + "%(" + sizes[2] + ")", 6, 0); titleLabel.setText("Performance information of the selected place:"); //display frequency of visits freqObjectLabel.setText(place.getFrequency() + " visits"); //display the arrival rate ratePlaceLabel.setText(formatString(place.getArrivalRate() * timeDivider, decimalPlaces) + " visits per " + timeSort.substring(0, timeSort.length() - 1)); placeTable.getTableHeader().setVisible(true); titleLabel.setVisible(true); numberObjectLabel.setVisible(true); freqObjectLabel.setVisible(true); arrivalPlaceLabel.setVisible(true); ratePlaceLabel.setVisible(true); changePercentagesButton.setVisible(true); changePercentagesButton.setPreferredSize(new Dimension(170, 25)); exportButton.setVisible(true); placeTable.repaint(); metricsBottomPanel.revalidate(); } catch (Exception ex) { Message.add("An internal error occured while calculating " + "place metrics.\n" + ex.toString(), 2); ex.printStackTrace(); } }
From source file:org.processmining.analysis.performance.PerformanceAnalysisGUI.java
/** * Calculates the metrics belonging to a place and displays the results. * /* w w w .j a v a 2 s . com*/ * @param place * ExtendedPlace: the place of which the values of metrics are * calculated. */ private void displayPlaceMetrics(ExtendedPlace place) { ArrayList instanceIDList = getSelectedInstanceIDs(); tablePanel.removeAll(); tablePanel.add(placeTable.getTableHeader(), BorderLayout.PAGE_START); tablePanel.add(placeTable, BorderLayout.CENTER); try { // calculate place metrics place.calculateMetrics(instanceIDList, advancedSettings[1], failedInstances); // initialize the placeTable ThreeMetricsTableModel ptm = new ThreeMetricsTableModel(); ptm.setHeadings("", "Waiting time (" + timeSort + ")", "Synchronization time (" + timeSort + ")", "Sojourn time (" + timeSort + ")"); placeTable.setModel(ptm); placeTable.setBorder(BorderFactory.createEtchedBorder()); placeTable.setPreferredSize(new Dimension(480, 112)); placeTable.setMinimumSize(new Dimension(480, 112)); placeTable.getColumnModel().getColumn(0).setPreferredWidth(60); placeTable.getColumnModel().getColumn(0).setMaxWidth(150); placeTable.getColumnModel().getColumn(2).setPreferredWidth(100); placeTable.setRowSelectionAllowed(false); placeTable.getTableHeader().setFont(new Font("SansSerif", Font.BOLD, 12)); DefaultTableCellRenderer dtcr = new DefaultTableCellRenderer(); dtcr.setBackground(new Color(235, 235, 235)); dtcr.setFont(new Font("SansSerif", Font.BOLD, 12)); placeTable.getColumnModel().getColumn(0).setCellRenderer(dtcr); // place time metrics in the table placeTable.setValueAt(formatString(place.getMeanWaitingTime() / timeDivider, decimalPlaces), 0, 1); placeTable.setValueAt(formatString(place.getMeanSynchronizationTime() / timeDivider, decimalPlaces), 0, 2); placeTable.setValueAt(formatString(place.getMeanSojournTime() / timeDivider, decimalPlaces), 0, 3); placeTable.setValueAt(formatString((place.getMinWaitingTime() * 1.0) / timeDivider, decimalPlaces), 1, 1); placeTable.setValueAt( formatString((place.getMinSynchronizationTime() * 1.0) / timeDivider, decimalPlaces), 1, 2); placeTable.setValueAt(formatString((place.getMinSojournTime() * 1.0) / timeDivider, decimalPlaces), 1, 3); placeTable.setValueAt(formatString((place.getMaxWaitingTime() * 1.0) / timeDivider, decimalPlaces), 2, 1); placeTable.setValueAt( formatString((place.getMaxSynchronizationTime() * 1.0) / timeDivider, decimalPlaces), 2, 2); placeTable.setValueAt(formatString((place.getMaxSojournTime() * 1.0) / timeDivider, decimalPlaces), 2, 3); placeTable.setValueAt(formatString(place.getStdevWaitingTime() / timeDivider, decimalPlaces), 3, 1); placeTable.setValueAt(formatString(place.getStdevSynchronizationTime() / timeDivider, decimalPlaces), 3, 2); placeTable.setValueAt(formatString(place.getStdevSojournTime() / timeDivider, decimalPlaces), 3, 3); double[] avgTimes = place.getAvgTimes(fastestPlacePercentage, slowestPlacePercentage); placeTable.setValueAt(formatString(avgTimes[0] / timeDivider, decimalPlaces), 4, 1); placeTable.setValueAt(formatString(avgTimes[1] / timeDivider, decimalPlaces), 4, 2); placeTable.setValueAt(formatString(avgTimes[2] / timeDivider, decimalPlaces), 4, 3); placeTable.setValueAt(formatString(avgTimes[3] / timeDivider, decimalPlaces), 5, 1); placeTable.setValueAt(formatString(avgTimes[4] / timeDivider, decimalPlaces), 5, 2); placeTable.setValueAt(formatString(avgTimes[5] / timeDivider, decimalPlaces), 5, 3); placeTable.setValueAt(formatString(avgTimes[6] / timeDivider, decimalPlaces), 6, 1); placeTable.setValueAt(formatString(avgTimes[7] / timeDivider, decimalPlaces), 6, 2); placeTable.setValueAt(formatString(avgTimes[8] / timeDivider, decimalPlaces), 6, 3); DecimalFormat df = new DecimalFormat("0.00"); int[] sizes = place.getSizes(fastestPlacePercentage, slowestPlacePercentage); placeTable.setValueAt("fast " + df.format(fastestPlacePercentage) + "%(" + sizes[0] + ")", 4, 0); placeTable.setValueAt("slow " + df.format(slowestPlacePercentage) + "%(" + sizes[1] + ")", 5, 0); placeTable.setValueAt("normal " + df.format(100 - fastestPlacePercentage - slowestPlacePercentage) + "%(" + sizes[2] + ")", 6, 0); titleLabel.setText("Performance information of the selected place:"); // display frequency of visits freqObjectLabel.setText(place.getFrequency() + " visits"); // display the arrival rate ratePlaceLabel.setText(formatString(place.getArrivalRate() * timeDivider, decimalPlaces) + " visits per " + timeSort.substring(0, timeSort.length() - 1)); placeTable.getTableHeader().setVisible(true); titleLabel.setVisible(true); numberObjectLabel.setVisible(true); freqObjectLabel.setVisible(true); arrivalPlaceLabel.setVisible(true); ratePlaceLabel.setVisible(true); changePercentagesButton.setVisible(true); changePercentagesButton.setPreferredSize(new Dimension(170, 25)); exportButton.setVisible(true); placeTable.repaint(); metricsBottomPanel.revalidate(); } catch (Exception ex) { Message.add("An internal error occured while calculating " + "place metrics.\n" + ex.toString(), 2); ex.printStackTrace(); } }
From source file:de.bwravencl.controllerbuddy.gui.Main.java
private void updateOverlayAlignment(final Rectangle maxWindowBounds) { final var inLowerHalf = overlayFrame.getY() + overlayFrame.getHeight() / 2 < maxWindowBounds.height / 2; overlayFrame.remove(labelCurrentMode); overlayFrame.add(labelCurrentMode, inLowerHalf ? BorderLayout.PAGE_START : BorderLayout.PAGE_END); var alignment = SwingConstants.RIGHT; var flowLayoutAlignment = FlowLayout.RIGHT; if (overlayFrame.getX() + overlayFrame.getWidth() / 2 < maxWindowBounds.width / 2) { alignment = SwingConstants.LEFT; flowLayoutAlignment = FlowLayout.LEFT; }/*from ww w . j a v a 2s. c om*/ labelCurrentMode.setHorizontalAlignment(alignment); indicatorPanelFlowLayout.setAlignment(flowLayoutAlignment); indicatorPanel.invalidate(); overlayFrame.setBackground(TRANSPARENT); overlayFrame.pack(); }