Example usage for javax.swing JMenuItem setText

List of usage examples for javax.swing JMenuItem setText

Introduction

In this page you can find the example usage for javax.swing JMenuItem setText.

Prototype

@BeanProperty(preferred = true, visualUpdate = true, description = "The button's text.")
public void setText(String text) 

Source Link

Document

Sets the button's text.

Usage

From source file:com.jmstoolkit.queuebrowser.QueueBrowserView.java

/**
 * This method is called from within the constructor to
 * initialize the form.//from w ww . jav  a2  s  .  c o  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() {

    mainPanel = new javax.swing.JPanel();
    destinationLabel = new javax.swing.JLabel();
    destinationComboBox = new javax.swing.JComboBox();
    browseButton = new javax.swing.JButton();
    cancelButton = new javax.swing.JButton();
    connectionFactoryLabel = new javax.swing.JLabel();
    connectionFactoryComboBox = new javax.swing.JComboBox();
    messageSplitPane = new javax.swing.JSplitPane();
    messagePropertiesSplitPane = new javax.swing.JSplitPane();
    messageScrollPane = new javax.swing.JScrollPane();
    messageTextArea = new javax.swing.JTextArea();
    messagePropertiesScrollPane = new javax.swing.JScrollPane();
    messagePropertiesTable = new javax.swing.JTable();
    messageRecordTableScrollPane = new javax.swing.JScrollPane();
    messageRecordTable = new javax.swing.JTable();
    menuBar = new javax.swing.JMenuBar();
    javax.swing.JMenu fileMenu = new javax.swing.JMenu();
    drainQueueMenuItem = new javax.swing.JMenuItem();
    javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
    javax.swing.JMenu helpMenu = new javax.swing.JMenu();
    javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
    statusPanel = new javax.swing.JPanel();
    javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
    statusMessageLabel = new javax.swing.JLabel();
    statusAnimationLabel = new javax.swing.JLabel();
    progressBar = new javax.swing.JProgressBar();
    messageTableModel = new com.jmstoolkit.beans.MessageTableModel();
    messagePropertyTableModel = new com.jmstoolkit.beans.PropertyTableModel();
    queueDrainedDialog = new javax.swing.JDialog();
    queueDrainedDialogOKButton = new javax.swing.JButton();
    itemsDrainedLabel = new javax.swing.JLabel();
    itemsDrainedTextField = new javax.swing.JTextField();
    queueDrainedScrollPane = new javax.swing.JScrollPane();
    queueDrainedTextPane = new javax.swing.JTextPane();

    org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance()
            .getContext().getResourceMap(QueueBrowserView.class);
    mainPanel.setBackground(resourceMap.getColor("mainPanel.background")); // NOI18N
    mainPanel.setForeground(resourceMap.getColor("mainPanel.foreground")); // NOI18N
    mainPanel.setName("mainPanel"); // NOI18N

    destinationLabel.setText(resourceMap.getString("destinationLabel.text")); // NOI18N
    destinationLabel.setName("destinationLabel"); // NOI18N

    destinationComboBox.setEditable(true);
    destinationComboBox.setModel(new javax.swing.DefaultComboBoxModel(destinationList.toArray()));
    destinationComboBox.setToolTipText(resourceMap.getString("destinationComboBox.toolTipText")); // NOI18N
    destinationComboBox.setName("destinationComboBox"); // NOI18N
    destinationComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            destinationComboBoxActionPerformed(evt);
        }
    });

    javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance().getContext()
            .getActionMap(QueueBrowserView.class, this);
    browseButton.setAction(actionMap.get("browseQueue")); // NOI18N
    browseButton.setText(resourceMap.getString("browseButton.text")); // NOI18N
    browseButton.setToolTipText(resourceMap.getString("browseButton.toolTipText")); // NOI18N
    browseButton.setName("browseButton"); // NOI18N

    cancelButton.setFont(resourceMap.getFont("cancelButton.font")); // NOI18N
    cancelButton.setText(resourceMap.getString("cancelButton.text")); // NOI18N
    cancelButton.setToolTipText(resourceMap.getString("cancelButton.toolTipText")); // NOI18N
    cancelButton.setEnabled(false);
    cancelButton.setName("cancelButton"); // NOI18N
    cancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelButtonActionPerformed(evt);
        }
    });

    connectionFactoryLabel.setText(resourceMap.getString("connectionFactoryLabel.text")); // NOI18N
    connectionFactoryLabel.setName("connectionFactoryLabel"); // NOI18N

    connectionFactoryComboBox.setEditable(true);
    connectionFactoryComboBox.setModel(new javax.swing.DefaultComboBoxModel(connectionFactoryList.toArray()));
    connectionFactoryComboBox.setName("connectionFactoryComboBox"); // NOI18N
    connectionFactoryComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            connectionFactoryComboBoxActionPerformed(evt);
        }
    });

    messageSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    messageSplitPane.setName("messageSplitPane"); // NOI18N
    messageSplitPane.setPreferredSize(new java.awt.Dimension(456, 400));

    messagePropertiesSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    messagePropertiesSplitPane.setName("messagePropertiesSplitPane"); // NOI18N
    messagePropertiesSplitPane.setPreferredSize(new java.awt.Dimension(454, 200));

    messageScrollPane.setBackground(resourceMap.getColor("messageScrollPane.background")); // NOI18N
    messageScrollPane.setForeground(resourceMap.getColor("messageScrollPane.foreground")); // NOI18N
    messageScrollPane.setName("messageScrollPane"); // NOI18N

    messageTextArea.setBackground(resourceMap.getColor("messageTextArea.background")); // NOI18N
    messageTextArea.setColumns(20);
    messageTextArea.setForeground(resourceMap.getColor("messageTextArea.foreground")); // NOI18N
    messageTextArea.setLineWrap(true);
    messageTextArea.setRows(5);
    messageTextArea.setTabSize(2);
    messageTextArea.setToolTipText(resourceMap.getString("messageTextArea.toolTipText")); // NOI18N
    messageTextArea.setWrapStyleWord(true);
    messageTextArea.setName("messageTextArea"); // NOI18N
    messageScrollPane.setViewportView(messageTextArea);

    messagePropertiesSplitPane.setTopComponent(messageScrollPane);

    messagePropertiesScrollPane.setName("messagePropertiesScrollPane"); // NOI18N
    messagePropertiesScrollPane.setPreferredSize(new java.awt.Dimension(452, 202));

    messagePropertiesTable.setModel(messagePropertyTableModel);
    messagePropertiesTable.setAutoCreateRowSorter(true);
    messagePropertiesTable.setCellSelectionEnabled(true);
    messagePropertiesTable.setDoubleBuffered(true);
    messagePropertiesTable.setName("messagePropertiesTable"); // NOI18N
    messagePropertiesScrollPane.setViewportView(messagePropertiesTable);

    messagePropertiesSplitPane.setRightComponent(messagePropertiesScrollPane);

    messageSplitPane.setRightComponent(messagePropertiesSplitPane);

    messageRecordTableScrollPane.setName("messageRecordTableScrollPane"); // NOI18N
    messageRecordTableScrollPane.setPreferredSize(new java.awt.Dimension(452, 202));

    messageRecordTable.setModel(messageTableModel);
    messageRecordTable.setCellSelectionEnabled(true);
    messageRecordTable.setDoubleBuffered(true);
    messageRecordTable.setName("messageRecordTable"); // NOI18N
    messageRecordTable.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            messageRecordTableMouseClicked(evt);
        }
    });
    messageRecordTableScrollPane.setViewportView(messageRecordTable);

    messageSplitPane.setLeftComponent(messageRecordTableScrollPane);

    javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
    mainPanel.setLayout(mainPanelLayout);
    mainPanelLayout.setHorizontalGroup(mainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup().addContainerGap().addGroup(mainPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(mainPanelLayout.createSequentialGroup().addComponent(destinationLabel)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(destinationComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addGroup(mainPanelLayout.createSequentialGroup().addComponent(connectionFactoryLabel)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(connectionFactoryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    240, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(browseButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(cancelButton).addGap(19, 19, 19))
            .addComponent(messageSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 597, Short.MAX_VALUE));
    mainPanelLayout.setVerticalGroup(mainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(connectionFactoryLabel).addComponent(connectionFactoryComboBox,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(destinationLabel)
                            .addComponent(destinationComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(cancelButton).addComponent(browseButton))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(
                            messageSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)));

    menuBar.setName("menuBar"); // NOI18N

    fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
    fileMenu.setName("fileMenu"); // NOI18N

    drainQueueMenuItem.setAction(actionMap.get("drainQueue")); // NOI18N
    drainQueueMenuItem.setText(resourceMap.getString("drainQueueMenuItem.text")); // NOI18N
    drainQueueMenuItem.setName("drainQueueMenuItem"); // NOI18N
    fileMenu.add(drainQueueMenuItem);

    exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
    exitMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X,
            java.awt.event.InputEvent.CTRL_MASK));
    exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N
    exitMenuItem.setToolTipText(resourceMap.getString("exitMenuItem.toolTipText")); // NOI18N
    exitMenuItem.setName("exitMenuItem"); // NOI18N
    fileMenu.add(exitMenuItem);

    menuBar.add(fileMenu);

    helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
    helpMenu.setName("helpMenu"); // NOI18N

    aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
    aboutMenuItem.setName("aboutMenuItem"); // NOI18N
    helpMenu.add(aboutMenuItem);

    menuBar.add(helpMenu);

    statusPanel.setName("statusPanel"); // NOI18N
    statusPanel.setPreferredSize(new java.awt.Dimension(454, 30));

    statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

    statusMessageLabel.setAlignmentY(0.0F);
    statusMessageLabel.setName("statusMessageLabel"); // NOI18N

    statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

    progressBar.setName("progressBar"); // NOI18N

    javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
    statusPanel.setLayout(statusPanelLayout);
    statusPanelLayout.setHorizontalGroup(statusPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 597, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(statusMessageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 235,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 166, Short.MAX_VALUE)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(statusAnimationLabel).addContainerGap()));
    statusPanelLayout.setVerticalGroup(statusPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                    .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(statusPanelLayout.createSequentialGroup().addGroup(statusPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(statusMessageLabel, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            21, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(statusAnimationLabel)).addGap(3, 3, 3))
                            .addGroup(statusPanelLayout.createSequentialGroup()
                                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap()))));

    messagePropertyTableModel.setData(messagePropertyTableModel.getData());

    queueDrainedDialog.setLocationByPlatform(true);
    queueDrainedDialog.setMinimumSize(new java.awt.Dimension(300, 180));
    queueDrainedDialog.setModal(true);
    queueDrainedDialog.setName("queueDrainedDialog"); // NOI18N
    queueDrainedDialog.setResizable(false);

    queueDrainedDialogOKButton.setText(resourceMap.getString("queueDrainedDialogOKButton.text")); // NOI18N
    queueDrainedDialogOKButton.setName("queueDrainedDialogOKButton"); // NOI18N
    queueDrainedDialogOKButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            queueDrainedDialogOKButtonActionPerformed(evt);
        }
    });

    itemsDrainedLabel.setText(resourceMap.getString("itemsDrainedLabel.text")); // NOI18N
    itemsDrainedLabel.setName("itemsDrainedLabel"); // NOI18N

    itemsDrainedTextField.setEditable(false);
    itemsDrainedTextField.setText(resourceMap.getString("itemsDrainedTextField.text")); // NOI18N
    itemsDrainedTextField.setName("itemsDrainedTextField"); // NOI18N

    queueDrainedScrollPane.setName("queueDrainedScrollPane"); // NOI18N

    queueDrainedTextPane.setEditable(false);
    queueDrainedTextPane.setText(resourceMap.getString("queueDrainedTextPane.text")); // NOI18N
    queueDrainedTextPane.setName("queueDrainedTextPane"); // NOI18N
    queueDrainedScrollPane.setViewportView(queueDrainedTextPane);

    javax.swing.GroupLayout queueDrainedDialogLayout = new javax.swing.GroupLayout(
            queueDrainedDialog.getContentPane());
    queueDrainedDialog.getContentPane().setLayout(queueDrainedDialogLayout);
    queueDrainedDialogLayout.setHorizontalGroup(queueDrainedDialogLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(queueDrainedDialogLayout.createSequentialGroup().addGroup(queueDrainedDialogLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(queueDrainedDialogLayout.createSequentialGroup().addContainerGap()
                            .addComponent(itemsDrainedLabel)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(itemsDrainedTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(queueDrainedDialogLayout.createSequentialGroup().addContainerGap().addComponent(
                            queueDrainedScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE))
                    .addGroup(queueDrainedDialogLayout.createSequentialGroup().addGap(127, 127, 127)
                            .addComponent(queueDrainedDialogOKButton)))
                    .addContainerGap()));
    queueDrainedDialogLayout.setVerticalGroup(
            queueDrainedDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(queueDrainedDialogLayout.createSequentialGroup().addContainerGap()
                            .addGroup(queueDrainedDialogLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(itemsDrainedLabel).addComponent(itemsDrainedTextField,
                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(queueDrainedScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 59,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(queueDrainedDialogOKButton).addGap(32, 32, 32)));

    setComponent(mainPanel);
    setMenuBar(menuBar);
    setStatusBar(statusPanel);
}

From source file:nz.govt.natlib.ndha.manualdeposit.ManualDepositPresenter.java

public void setupFavourites() {
    theFavouritesMenu.removeAll();//ww w. j a  v  a2  s .  c o  m
    PersonalSettings personalSettings = applicationProperties.getApplicationData().getPersonalSettings();
    if (personalSettings.getNoOfFavourites() > 0) {
        for (String favourite : personalSettings.getFavourites()) {
            addFavouriteMenuItem(favourite);
        }
        theFavouritesMenu.addSeparator();
        addFavouriteMenuItem("Clear Favourites");
    } else {
        JMenuItem mnuDirectory = new JMenuItem();
        mnuDirectory.setText("No favourites found");
        theFavouritesMenu.add(mnuDirectory);
    }
}

From source file:nz.govt.natlib.ndha.manualdeposit.ManualDepositPresenter.java

private void addFavouriteMenuItem(String directoryName) {
    JMenuItem mnuDirectory = new JMenuItem();
    mnuDirectory.setText(directoryName);
    mnuDirectory.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnuLoadFavouriteActionPerformed(evt);
        }//from   w ww . j  av  a 2  s . c o  m
    });
    theFavouritesMenu.add(mnuDirectory);
}

From source file:org.accada.hal.impl.sim.GraphicSimulator.java

/**
 * creates the file menu item if it does not already exists
 * //  www.ja v a  2 s .c  o  m
 * @return file menu
 */
private JMenu getFileMenu() {
    JMenu fileMenu = new JMenu(guiTextConfig.getString("FileMenuItem"));

    // exit
    JMenuItem exitMenuItem = new JMenuItem();
    exitMenuItem.setText(guiTextConfig.getString("QuitMenuItem"));
    exitMenuItem.addMouseListener(new MouseAdapter() {
        public void mouseReleased(MouseEvent e) {
            System.exit(0);
        }
    });
    fileMenu.add(exitMenuItem);
    return fileMenu;
}

From source file:org.accada.hal.impl.sim.GraphicSimulator.java

/**
 * creates the antenna menu item if it does not already exists
 * /*from ww  w  .  j a v a 2s .  c o  m*/
 * @return antenna menu
 */
private JMenu getAntennaMenu() {
    JMenu antennaMenu = new JMenu(guiTextConfig.getString("AntennaMenuItem"));

    // new antenna
    JMenuItem newAntennaMenuItem = new JMenuItem();
    newAntennaMenuItem.setText(guiTextConfig.getString("AddNewAntennaMenuItem"));
    newAntennaMenuItem.addMouseListener(new MouseAdapter() {
        public void mouseReleased(MouseEvent e) {
            showAddAntennaDialog();
        }
    });
    antennaMenu.add(newAntennaMenuItem);
    return antennaMenu;
}

From source file:org.accada.hal.impl.sim.GraphicSimulator.java

/**
 * creates the tag menu item if it does not already exists
 * //from w w  w  .ja  va  2 s.c  om
 * @return tag menu
 */
private JMenu getTagMenu() {
    JMenu tagMenu = new JMenu(guiTextConfig.getString("TagMenuItem"));

    // new tag
    JMenuItem newTagMenuItem = new JMenuItem();
    newTagMenuItem.setText(guiTextConfig.getString("AddNewTagMenuItem"));
    newTagMenuItem.addMouseListener(new MouseAdapter() {
        public void mouseReleased(MouseEvent e) {
            showAddTagDialog();
        }
    });
    tagMenu.add(newTagMenuItem);
    return tagMenu;
}

From source file:org.accada.hal.impl.sim.GraphicSimulator.java

/**
 * creates the help menu item if it does not already exists
 * //from   w ww.j a v a 2  s .c  om
 * @return help menu
 */
private JMenu getHelpMenu() {
    JMenu helpMenu = new JMenu(guiTextConfig.getString("HelpMenuItem"));

    // about
    JMenuItem aboutMenuItem = new JMenuItem();
    aboutMenuItem.setText(guiTextConfig.getString("AboutMenuItem"));
    aboutMenuItem.addMouseListener(new MouseAdapter() {
        public void mouseReleased(MouseEvent e) {
            JDialog aboutDialog = new JDialog(GraphicSimulator.this,
                    guiTextConfig.getString("AboutDialogTitle"), true);
            Point pos = new Point();
            pos.x = jLayeredPane.getLocationOnScreen().x
                    + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2;
            pos.y = jLayeredPane.getLocationOnScreen().y
                    + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;
            aboutDialog.setLocation(pos);
            aboutDialog.setSize(getProperty("DialogWindowWidth"), getProperty("DialogWindowHeight"));
            aboutDialog.setTitle(guiTextConfig.getString("AboutDialogTitle"));
            JLabel text = new JLabel(guiTextConfig.getString("AboutDialogContent"));
            text.setHorizontalAlignment(JLabel.CENTER);
            aboutDialog.add(text);
            aboutDialog.setVisible(true);
        }
    });
    helpMenu.add(aboutMenuItem);
    return helpMenu;
}

From source file:org.accada.hal.impl.sim.multi.GraphicSimulatorServer.java

/**
 * creates the view menu item/*from  w ww .ja  va2  s  .c o  m*/
 * 
 * @return view menu
 */
private JMenu getViewMenu() {
    JMenu viewMenu = new JMenu(guiTextConfig.getString("ViewMenuItem"));

    // exit
    JMenuItem refreshMenuItem = new JMenuItem();
    refreshMenuItem.setText(guiTextConfig.getString("RefreshMenuItem"));
    refreshMenuItem.addMouseListener(new MouseAdapter() {
        public void mouseReleased(MouseEvent e) {
            updateGUI();
        }
    });
    viewMenu.add(refreshMenuItem);
    return viewMenu;
}

From source file:org.accada.hal.impl.sim.multi.GraphicSimulatorServer.java

/**
 * creates the help menu item/*from w  w w.ja v  a 2  s  .  com*/
 * 
 * @return help menu
 */
private JMenu getHelpMenu() {
    JMenu helpMenu = new JMenu(guiTextConfig.getString("HelpMenuItem"));

    // about
    JMenuItem aboutMenuItem = new JMenuItem();
    aboutMenuItem.setText(guiTextConfig.getString("AboutMenuItem"));
    aboutMenuItem.addMouseListener(new MouseAdapter() {
        public void mouseReleased(MouseEvent e) {
            JDialog aboutDialog = new JDialog(GraphicSimulatorServer.this,
                    guiTextConfig.getString("AboutDialogTitle"), true);
            Point pos = new Point();
            pos.x = jLayeredPane.getLocationOnScreen().x
                    + (jLayeredPane.getWidth() - getProperty("DialogWindowWidth")) / 2;
            pos.y = jLayeredPane.getLocationOnScreen().y
                    + (jLayeredPane.getHeight() - getProperty("DialogWindowHeight")) / 2;
            aboutDialog.setLocation(pos);
            aboutDialog.setSize(getProperty("DialogWindowWidth"), getProperty("DialogWindowHeight"));
            aboutDialog.setTitle(guiTextConfig.getString("AboutDialogTitle"));
            JLabel text = new JLabel(guiTextConfig.getString("AboutDialogContent"));
            text.setHorizontalAlignment(JLabel.CENTER);
            aboutDialog.add(text);
            aboutDialog.setVisible(true);
        }
    });
    helpMenu.add(aboutMenuItem);
    return helpMenu;
}

From source file:org.accada.reader.hal.impl.sim.GraphicSimulator.java

/**
 * creates the file menu item if it does not already exists
 * /*from  ww w .j a va2s .  com*/
 * @return file menu
 */
private JMenu getFileMenu() {
    JMenu fileMenu = new JMenu(guiText.getString("FileMenuItem"));

    // exit
    JMenuItem exitMenuItem = new JMenuItem();
    exitMenuItem.setText(guiText.getString("QuitMenuItem"));
    exitMenuItem.addMouseListener(new MouseAdapter() {
        public void mouseReleased(MouseEvent e) {
            System.exit(0);
        }
    });
    fileMenu.add(exitMenuItem);
    return fileMenu;
}