List of usage examples for java.awt.event KeyEvent VK_Y
int VK_Y
To view the source code for java.awt.event KeyEvent VK_Y.
Click Source Link
From source file:uk.ac.lkl.cram.ui.ModuleFrame.java
/** * Creates new form ModuleFrame//from w w w.j a va 2 s.co m * @param module the module that this window displays * @param file */ public ModuleFrame(final Module module, File file) { this.module = module; this.moduleFile = file; this.setTitle(module.getModuleName()); initComponents(); //Add undo mechanism undoHandler = new UndoHandler(); JMenuItem undoMI = editMenu.add(undoHandler.getUndoAction()); JMenuItem redoMI = editMenu.add(undoHandler.getRedoAction()); //Listen to the undo handler for when there is something to undo undoHandler.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { //We're assuming there's only one property //If the new value is true, then there's something to undo //And thus the save menu item should be enabled Boolean newValue = (Boolean) evt.getNewValue(); if (moduleFile != null) { saveMI.setEnabled(newValue); } } }); editMenu.addSeparator(); //Add cut, copy & paste menu items JMenuItem cutMI = editMenu.add(new JMenuItem(new DefaultEditorKit.CutAction())); cutMI.setText("Cut"); JMenuItem copyMI = editMenu.add(new JMenuItem(new DefaultEditorKit.CopyAction())); copyMI.setText("Copy"); JMenuItem pasteMI = editMenu.add(new JMenuItem(new DefaultEditorKit.PasteAction())); pasteMI.setText("Paste"); //Listen for changes to the shared selection model sharedSelectionModel.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { //Update the menu items modifyLineItemMI.setEnabled(evt.getNewValue() != null); removeLineItemMI.setEnabled(evt.getNewValue() != null); } }); doubleClickListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { //If the user double clicks, then treat this as a shortcut to modify the selected line item if (e.getClickCount() == 2) { modifySelectedLineItem(); } } }; //Set Accelerator keys undoMI.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); redoMI.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); cutMI.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); copyMI.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); pasteMI.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); newMI.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_N, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); openMI.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); saveMI.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); quitMI.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_Q, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); //Remove quit menu item and separator from file menu on Mac if (Utilities.isMac()) { fileMenu.remove(quitSeparator); fileMenu.remove(quitMI); } leftTaskPaneContainer.add(createCourseDataPane()); leftTaskPaneContainer.add(createLineItemPane()); leftTaskPaneContainer.add(createTutorHoursPane()); leftTaskPaneContainer.add(createTutorCostPane()); rightTaskPaneContainer.add(createLearningTypeChartPane()); rightTaskPaneContainer.add(createLearningExperienceChartPane()); rightTaskPaneContainer.add(createLearnerFeedbackChartPane()); rightTaskPaneContainer.add(createHoursChartPane()); rightTaskPaneContainer.add(createTotalCostsPane()); }
From source file:com.mirth.connect.client.ui.components.rsta.RSTAPreferences.java
private void setDefaultKeyStrokeMap() { keyStrokeMap = new HashMap<String, KeyStroke>(); boolean isOSX = RTextArea.isOSX(); int defaultModifier = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); int ctrl = InputEvent.CTRL_MASK; int alt = InputEvent.ALT_MASK; int shift = InputEvent.SHIFT_MASK; int defaultShift = defaultModifier | shift; int moveByWordMod = isOSX ? alt : defaultModifier; int moveByWordModShift = moveByWordMod | shift; putKeyStroke(ActionInfo.UNDO, KeyEvent.VK_Z, defaultModifier); if (isOSX) {/* ww w . ja v a 2 s. c om*/ putKeyStroke(ActionInfo.REDO, KeyEvent.VK_Z, defaultShift); } else { putKeyStroke(ActionInfo.REDO, KeyEvent.VK_Y, defaultModifier); } putKeyStroke(ActionInfo.CUT, KeyEvent.VK_X, defaultModifier); putKeyStroke(ActionInfo.COPY, KeyEvent.VK_C, defaultModifier); putKeyStroke(ActionInfo.PASTE, KeyEvent.VK_V, defaultModifier); putKeyStroke(ActionInfo.DELETE, KeyEvent.VK_DELETE, 0); putKeyStroke(ActionInfo.DELETE_REST_OF_LINE, KeyEvent.VK_DELETE, defaultModifier); putKeyStroke(ActionInfo.DELETE_LINE, KeyEvent.VK_D, defaultModifier); putKeyStroke(ActionInfo.JOIN_LINE, KeyEvent.VK_J, defaultModifier); putKeyStroke(ActionInfo.SELECT_ALL, KeyEvent.VK_A, defaultModifier); putKeyStroke(ActionInfo.FIND_REPLACE, KeyEvent.VK_F, defaultModifier); putKeyStroke(ActionInfo.FIND_NEXT, KeyEvent.VK_G, defaultModifier); putKeyStroke(ActionInfo.CLEAR_MARKED_OCCURRENCES, KeyEvent.VK_ESCAPE, 0); putKeyStroke(ActionInfo.FOLD_COLLAPSE, KeyEvent.VK_SUBTRACT, defaultModifier); putKeyStroke(ActionInfo.FOLD_EXPAND, KeyEvent.VK_ADD, defaultModifier); putKeyStroke(ActionInfo.FOLD_COLLAPSE_ALL, KeyEvent.VK_DIVIDE, defaultModifier); putKeyStroke(ActionInfo.FOLD_COLLAPSE_ALL_COMMENTS, KeyEvent.VK_DIVIDE, defaultShift); putKeyStroke(ActionInfo.FOLD_EXPAND_ALL, KeyEvent.VK_MULTIPLY, defaultModifier); putKeyStroke(ActionInfo.GO_TO_MATCHING_BRACKET, KeyEvent.VK_OPEN_BRACKET, defaultModifier); putKeyStroke(ActionInfo.TOGGLE_COMMENT, KeyEvent.VK_SLASH, defaultModifier); putKeyStroke(ActionInfo.AUTO_COMPLETE, KeyEvent.VK_SPACE, ctrl); if (isOSX) { putKeyStroke(ActionInfo.DOCUMENT_START, KeyEvent.VK_HOME, 0); putKeyStroke(ActionInfo.DOCUMENT_END, KeyEvent.VK_END, 0); putKeyStroke(ActionInfo.DOCUMENT_SELECT_START, KeyEvent.VK_HOME, shift); putKeyStroke(ActionInfo.DOCUMENT_SELECT_END, KeyEvent.VK_END, shift); putKeyStroke(ActionInfo.LINE_START, KeyEvent.VK_LEFT, defaultModifier); putKeyStroke(ActionInfo.LINE_END, KeyEvent.VK_RIGHT, defaultModifier); putKeyStroke(ActionInfo.LINE_SELECT_START, KeyEvent.VK_LEFT, defaultShift); putKeyStroke(ActionInfo.LINE_SELECT_END, KeyEvent.VK_RIGHT, defaultShift); } else { putKeyStroke(ActionInfo.DOCUMENT_START, KeyEvent.VK_HOME, defaultModifier); putKeyStroke(ActionInfo.DOCUMENT_END, KeyEvent.VK_END, defaultModifier); putKeyStroke(ActionInfo.DOCUMENT_SELECT_START, KeyEvent.VK_HOME, defaultShift); putKeyStroke(ActionInfo.DOCUMENT_SELECT_END, KeyEvent.VK_END, defaultShift); putKeyStroke(ActionInfo.LINE_START, KeyEvent.VK_HOME, 0); putKeyStroke(ActionInfo.LINE_END, KeyEvent.VK_END, 0); putKeyStroke(ActionInfo.LINE_SELECT_START, KeyEvent.VK_HOME, shift); putKeyStroke(ActionInfo.LINE_SELECT_END, KeyEvent.VK_END, shift); } putKeyStroke(ActionInfo.MOVE_LEFT, KeyEvent.VK_LEFT, 0); putKeyStroke(ActionInfo.MOVE_LEFT_SELECT, KeyEvent.VK_LEFT, shift); putKeyStroke(ActionInfo.MOVE_LEFT_WORD, KeyEvent.VK_LEFT, moveByWordMod); putKeyStroke(ActionInfo.MOVE_LEFT_WORD_SELECT, KeyEvent.VK_LEFT, moveByWordModShift); putKeyStroke(ActionInfo.MOVE_RIGHT, KeyEvent.VK_RIGHT, 0); putKeyStroke(ActionInfo.MOVE_RIGHT_SELECT, KeyEvent.VK_RIGHT, shift); putKeyStroke(ActionInfo.MOVE_RIGHT_WORD, KeyEvent.VK_RIGHT, moveByWordMod); putKeyStroke(ActionInfo.MOVE_RIGHT_WORD_SELECT, KeyEvent.VK_RIGHT, moveByWordModShift); putKeyStroke(ActionInfo.MOVE_UP, KeyEvent.VK_UP, 0); putKeyStroke(ActionInfo.MOVE_UP_SELECT, KeyEvent.VK_UP, shift); putKeyStroke(ActionInfo.MOVE_UP_SCROLL, KeyEvent.VK_UP, defaultModifier); putKeyStroke(ActionInfo.MOVE_UP_LINE, KeyEvent.VK_UP, alt); putKeyStroke(ActionInfo.MOVE_DOWN, KeyEvent.VK_DOWN, 0); putKeyStroke(ActionInfo.MOVE_DOWN_SELECT, KeyEvent.VK_DOWN, shift); putKeyStroke(ActionInfo.MOVE_DOWN_SCROLL, KeyEvent.VK_DOWN, defaultModifier); putKeyStroke(ActionInfo.MOVE_DOWN_LINE, KeyEvent.VK_DOWN, alt); putKeyStroke(ActionInfo.PAGE_UP, KeyEvent.VK_PAGE_UP, 0); putKeyStroke(ActionInfo.PAGE_UP_SELECT, KeyEvent.VK_PAGE_UP, shift); putKeyStroke(ActionInfo.PAGE_LEFT_SELECT, KeyEvent.VK_PAGE_UP, defaultShift); putKeyStroke(ActionInfo.PAGE_DOWN, KeyEvent.VK_PAGE_DOWN, 0); putKeyStroke(ActionInfo.PAGE_DOWN_SELECT, KeyEvent.VK_PAGE_DOWN, shift); putKeyStroke(ActionInfo.PAGE_RIGHT_SELECT, KeyEvent.VK_PAGE_DOWN, defaultShift); putKeyStroke(ActionInfo.INSERT_LF_BREAK, KeyEvent.VK_ENTER, 0); putKeyStroke(ActionInfo.INSERT_CR_BREAK, KeyEvent.VK_ENTER, shift); putKeyStroke(ActionInfo.MACRO_BEGIN, KeyEvent.VK_B, defaultShift); putKeyStroke(ActionInfo.MACRO_END, KeyEvent.VK_N, defaultShift); putKeyStroke(ActionInfo.MACRO_PLAYBACK, KeyEvent.VK_M, defaultShift); }
From source file:com.pingtel.sipviewer.SIPViewerFrame.java
protected void initMenu() { JMenu menu;/*www.ja va 2s .com*/ JMenu submenu; JMenuItem menuItem; JRadioButtonMenuItem rbMenuItem; // Create the menu bar. JMenuBar menuBar = new JMenuBar(); this.setJMenuBar(menuBar); // Build the File menu. menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_F); menuBar.add(menu); // Add the load-file items to the File menu. menuItem = new JMenuItem(); menuItem.setAction(new icOpenFileAction()); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.ALT_MASK)); menuItem.setMnemonic(KeyEvent.VK_F); menu.add(menuItem); menuItem = new JMenuItem(); menuItem.setAction(new icImportSyslogAction()); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, ActionEvent.ALT_MASK)); menuItem.setMnemonic(KeyEvent.VK_Y); menu.add(menuItem); menu.addSeparator(); menuItem = new JMenuItem(); menuItem.setAction(new icSaveAsAction()); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.ALT_MASK)); menuItem.setMnemonic(KeyEvent.VK_S); menu.add(menuItem); menu.addSeparator(); // Add the reload item to the File menu. menuItem = new JMenuItem(); menuItem.setAction(new icReloadAction()); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.ALT_MASK)); menuItem.setMnemonic(KeyEvent.VK_R); menu.add(menuItem); menu.addSeparator(); // Add the quit item to the File menu. menuItem = new JMenuItem(); menuItem.setAction(new icQuitAction()); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.ALT_MASK)); menuItem.setMnemonic(KeyEvent.VK_Q); menu.add(menuItem); // Build the Options menu. menu = new JMenu("Options"); menu.setMnemonic(KeyEvent.VK_O); menuBar.add(menu); // Add the split/single screen mode to the options menu menuItem = new JMenuItem(); menuItem.setAction(new icScreenModeAction()); menuItem.setMnemonic(KeyEvent.VK_M); menu.add(menuItem); menu.addSeparator(); // Add the show all dialogs option to the options menu menuItem = new JMenuItem(); menuItem.setAction(new icShowAllDialogsAction()); menuItem.setMnemonic(KeyEvent.VK_D); menu.add(menuItem); menu.addSeparator(); // Add the Time Zone Selection Time submenu submenu = new JMenu("Time Zone Setting"); submenu.setMnemonic(KeyEvent.VK_Z); ButtonGroup timeZoneGroup = new ButtonGroup(); // Set Time Zone to Local Time Zone m_localTimeZone = new JRadioButtonMenuItem(); m_localTimeZone.setAction(new icSetTimeToLocalZone()); m_localTimeZone.setMnemonic(KeyEvent.VK_L); timeZoneGroup.add(m_localTimeZone); m_localTimeZone.setSelected(true); submenu.add(m_localTimeZone); // Set Time Zone to UTC Time Zone m_utcTimeZone = new JRadioButtonMenuItem(); m_utcTimeZone.setAction(new icSetTimeToUTCZone()); m_utcTimeZone.setMnemonic(KeyEvent.VK_U); timeZoneGroup.add(m_utcTimeZone); submenu.add(m_utcTimeZone); menu.add(submenu); // Add the show/hide time index column menuItem = new JMenuItem(); menuItem.setAction(new icTimeVisibilityAction()); menuItem.setMnemonic(KeyEvent.VK_V); menu.add(menuItem); // Add the Time Display Format submenu submenu = new JMenu("Time Display Format"); submenu.setMnemonic(KeyEvent.VK_T); ButtonGroup group = new ButtonGroup(); m_dateAndTimeFormat = new JRadioButtonMenuItem(); m_dateAndTimeFormat.setAction(new icDateAndTimeAction()); m_dateAndTimeFormat.setMnemonic(KeyEvent.VK_I); group.add(m_dateAndTimeFormat); submenu.add(m_dateAndTimeFormat); m_defaultTimeFormat = new JRadioButtonMenuItem(); m_defaultTimeFormat.setAction(new icTimeOfDay()); m_defaultTimeFormat.setMnemonic(KeyEvent.VK_E); m_defaultTimeFormat.setSelected(true); group.add(m_defaultTimeFormat); submenu.add(m_defaultTimeFormat); m_sincePreviousFormat = new JRadioButtonMenuItem(); m_sincePreviousFormat.setAction(new icSincePrevious()); m_sincePreviousFormat.setMnemonic(KeyEvent.VK_P); group.add(m_sincePreviousFormat); submenu.add(m_sincePreviousFormat); m_sinceBeginningFormat = new JRadioButtonMenuItem(); m_sinceBeginningFormat.setAction(new icSinceBeginning()); m_sinceBeginningFormat.setMnemonic(KeyEvent.VK_B); group.add(m_sinceBeginningFormat); submenu.add(m_sinceBeginningFormat); m_sinceKeyIndexFormat = new JRadioButtonMenuItem(); m_sinceKeyIndexFormat.setAction(new icSinceKeyIndex()); m_sinceKeyIndexFormat.setMnemonic(KeyEvent.VK_K); group.add(m_sinceKeyIndexFormat); submenu.add(m_sinceKeyIndexFormat); menu.add(submenu); // Build the Help menu. menu = new JMenu("Help"); menu.setMnemonic(KeyEvent.VK_H); menuBar.add(menu); // Add the items to the File menu. menuItem = new JMenuItem(); menuItem.setAction(new icAboutAction()); menu.add(menuItem); }
From source file:com.itemanalysis.jmetrik.gui.Jmetrik.java
private JMenuBar createMenuBar() { final JMenuBar menuBar = new JMenuBar(); JMenuItem mItem = null;//from w w w . ja v a 2 s. co m String urlString; URL url; //============================================================================================ // File Menu //============================================================================================ JMenu fileMenu = new JMenu("File"); fileMenu.setMnemonic('f'); menuBar.add(fileMenu); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/document-new.png"; url = this.getClass().getResource(urlString); ImageIcon iconNew = new ImageIcon(url, "New"); mItem = new JMenuItem(new NewTextFileAction("New", iconNew)); fileMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/document-open.png"; url = this.getClass().getResource(urlString); ImageIcon iconOpen = new ImageIcon(url, "Open"); mItem = new JMenuItem(new OpenFileAction("Open...", iconOpen, new Integer(KeyEvent.VK_A))); fileMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/document-save.png"; url = this.getClass().getResource(urlString); ImageIcon iconSave = new ImageIcon(url, "Save"); mItem = new JMenuItem(new SaveAction("Save", iconSave, new Integer(KeyEvent.VK_S))); fileMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/document-save-as.png"; url = this.getClass().getResource(urlString); ImageIcon iconSaveAs = new ImageIcon(url, "Save As"); mItem = new JMenuItem(new SaveAsAction("Save As...", iconSaveAs)); fileMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/status/folder-visiting.png"; url = this.getClass().getResource(urlString); ImageIcon iconClose = new ImageIcon(url, "Close All Tabs"); mItem = new JMenuItem(new CloseAllTabsAction("Close All Tabs...", iconClose, new Integer(KeyEvent.VK_C))); fileMenu.add(mItem); fileMenu.addSeparator(); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/document-print.png"; url = this.getClass().getResource(urlString); ImageIcon iconPrint = new ImageIcon(url, "Print"); mItem = new JMenuItem(new PrintAction("Print...", iconPrint)); fileMenu.add(mItem); fileMenu.addSeparator(); // exit menu item urlString = "/org/tango-project/tango-icon-theme/16x16/actions/system-log-out.png"; url = this.getClass().getResource(urlString); ImageIcon iconExit = new ImageIcon(url, "Exit"); mItem = new JMenuItem(new ExitAction("Exit", iconExit)); fileMenu.add(mItem); //============================================================================================ // Edit Menu //============================================================================================ JMenu editMenu = new JMenu("Edit"); editMenu.setMnemonic(KeyEvent.VK_E); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/edit-cut.png"; url = this.getClass().getResource(urlString); ImageIcon iconCut = new ImageIcon(url, "Cut"); mItem = new JMenuItem(new DefaultEditorKit.CutAction()); mItem.setText("Cut"); mItem.setIcon(iconCut); mItem.setMnemonic(KeyEvent.VK_X); editMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/edit-copy.png"; url = this.getClass().getResource(urlString); ImageIcon iconCopy = new ImageIcon(url, "Copy"); mItem = new JMenuItem(new DefaultEditorKit.CopyAction()); mItem.setText("Copy"); mItem.setIcon(iconCopy); mItem.setMnemonic(KeyEvent.VK_C); editMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/edit-paste.png"; url = this.getClass().getResource(urlString); ImageIcon iconPaste = new ImageIcon(url, "Paste"); mItem = new JMenuItem(new DefaultEditorKit.PasteAction()); mItem.setText("Paste"); mItem.setIcon(iconPaste); mItem.setMnemonic(KeyEvent.VK_V); editMenu.add(mItem); editMenu.addSeparator(); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/edit-undo.png"; url = this.getClass().getResource(urlString); ImageIcon iconUndo = new ImageIcon(url, "Undo"); mItem = new JMenuItem(new UndoAction("Undo", iconUndo, new Integer(KeyEvent.VK_Z))); editMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/edit-redo.png"; url = this.getClass().getResource(urlString); ImageIcon iconRedo = new ImageIcon(url, "Redo"); mItem = new JMenuItem(new RedoAction("Redo", iconRedo, new Integer(KeyEvent.VK_Y))); editMenu.add(mItem); editMenu.addSeparator(); urlString = "/org/tango-project/tango-icon-theme/16x16/categories/preferences-system.png"; url = this.getClass().getResource(urlString); ImageIcon iconView = new ImageIcon(url, "Preferences"); mItem = new JMenuItem("Preferences"); mItem.setIcon(iconView); mItem.setToolTipText("Edit jMetrik preferences"); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JmetrikPreferencesManager prefs = new JmetrikPreferencesManager(); prefs.addPropertyChangeListener(new ErrorOccurredPropertyChangeListener()); prefs.addPropertyChangeListener(statusBar.getStatusListener()); JmetrikPreferencesDialog propDialog = new JmetrikPreferencesDialog(Jmetrik.this, prefs); // propDialog.loadPreferences(); propDialog.setVisible(true); } }); editMenu.setMnemonic('e'); editMenu.add(mItem); menuBar.add(editMenu); //============================================================================================ // Log Menu //============================================================================================ JMenu logMenu = new JMenu("Log"); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/document-properties.png"; url = this.getClass().getResource(urlString); ImageIcon iconLog = new ImageIcon(url, "View Log"); mItem = new JMenuItem(new ViewLogAction("View Log", iconLog)); logMenu.setMnemonic('l'); logMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/mimetypes/text-x-generic.png"; url = this.getClass().getResource(urlString); ImageIcon iconCommand = new ImageIcon(url, "Script Log"); mItem = new JMenuItem(new ViewScriptLogAction("Script Log", iconCommand)); logMenu.setMnemonic('c'); logMenu.add(mItem); menuBar.add(logMenu); //============================================================================================ // Manage Menu //============================================================================================ JMenu manageMenu = new JMenu("Manage"); manageMenu.setMnemonic('m'); mItem = new JMenuItem("New Database...");//create db mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { NewDatabaseDialog newDatabaseDialog = new NewDatabaseDialog(Jmetrik.this); newDatabaseDialog.setVisible(true); if (newDatabaseDialog.canRun()) { if (workspace == null) { // workspace = new Workspace(workspaceTree, tabbedPane, dataTable, variableTable); workspace = new Workspace(workspaceList, tabbedPane, dataTable, variableTable); workspace.addPropertyChangeListener(statusBar.getStatusListener()); workspace.addPropertyChangeListener(new ErrorOccurredPropertyChangeListener()); } workspace.runProcess(newDatabaseDialog.getCommand()); // workspace.createDatabase(newDatabaseDialog.getCommand()); } } }); manageMenu.add(mItem); mItem = new JMenuItem("Open Database..."); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { OpenDatabaseDialog openDbDialog = new OpenDatabaseDialog(Jmetrik.this, "Open"); JList l = openDbDialog.getDatabaseList(); workspace.setDatabaseListModel(l); openDbDialog.setVisible(true); if (openDbDialog.canRun()) { openWorkspace(openDbDialog.getDatabaseName()); } } }); manageMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/edit-delete.png"; url = this.getClass().getResource(urlString); ImageIcon iconDelete = new ImageIcon(url, "Delete"); mItem = new JMenuItem("Delete Database..."); mItem.setIcon(iconDelete); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { OpenDatabaseDialog selectDialog = new OpenDatabaseDialog(Jmetrik.this, "Delete"); JList l = selectDialog.getDatabaseList(); workspace.setDatabaseListModel(l); selectDialog.setVisible(true); if (selectDialog.canRun()) { int answer = JOptionPane.showConfirmDialog(Jmetrik.this, "Do you want to delete " + selectDialog.getDatabaseName() + " and all of its contents? \n" + "All data will be permanently deleted. You cannot undo this action.", "Delete Database", JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION); if (answer == JOptionPane.YES_OPTION) { DatabaseCommand command = new DatabaseCommand(); DatabaseName dbName = new DatabaseName(selectDialog.getDatabaseName()); command.getFreeOption("name").add(dbName.getName()); command.getSelectOneOption("action").setSelected("delete-db"); DatabaseName currentDb = workspace.getDatabaseName(); if (currentDb.getName().equals(dbName.getName())) { JOptionPane.showMessageDialog(Jmetrik.this, "You cannot delete the current database.\n" + "Close the database before attempting to delete it.", "Database Delete Error", JOptionPane.WARNING_MESSAGE); } else { workspace.runProcess(command); } } } } }); manageMenu.add(mItem); manageMenu.addSeparator(); urlString = "/org/tango-project/tango-icon-theme/16x16/apps/accessories-text-editor.png"; url = this.getClass().getResource(urlString); ImageIcon iconDesc = new ImageIcon(url, "Descriptions"); mItem = new JMenuItem("Table Descriptions..."); mItem.setIcon(iconDesc); mItem.addActionListener(new TableDescriptionActionListener()); manageMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/list-add.png"; url = this.getClass().getResource(urlString); ImageIcon iconImport = new ImageIcon(url, "Import"); mItem = new JMenuItem("Import Data..."); mItem.setIcon(iconImport); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (workspace.databaseOpened()) { ImportDialog importDialog = new ImportDialog(Jmetrik.this, workspace.getDatabaseName(), importExportPath); importDialog.setVisible(true); if (importDialog.canRun()) { importExportPath = importDialog.getCurrentDirectory(); workspace.runProcess(importDialog.getCommand()); } } else { JOptionPane.showMessageDialog(Jmetrik.this, "You must open a database before importing data.", "No Open Database", JOptionPane.ERROR_MESSAGE); } } }); manageMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/format-indent-less.png"; url = this.getClass().getResource(urlString); ImageIcon iconExport = new ImageIcon(url, "Export"); mItem = new JMenuItem("Export Data..."); mItem.setIcon(iconExport); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { DataTableName tableName = (DataTableName) workspaceList.getSelectedValue(); if (!workspace.databaseOpened()) { JOptionPane.showMessageDialog(Jmetrik.this, "You must open a database before exporting data.", "No Open Database", JOptionPane.ERROR_MESSAGE); } else if (tableName == null) { JOptionPane.showMessageDialog(Jmetrik.this, "You must select a table in the workspace list. \n " + "Select a table to continue the export.", "No Table Selected", JOptionPane.ERROR_MESSAGE); } else { ExportDataDialog exportDialog = new ExportDataDialog(Jmetrik.this, workspace.getDatabaseName(), tableName, importExportPath); if (exportDialog.canRun()) { importExportPath = exportDialog.getCurrentDirectory(); workspace.runProcess(exportDialog.getCommand()); } } } }); manageMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/edit-delete.png"; url = this.getClass().getResource(urlString); ImageIcon iconDeleteTable = new ImageIcon(url, "Delete"); mItem = new JMenuItem("Delete Table..."); mItem.setIcon(iconDeleteTable); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (workspace.databaseOpened()) { DeleteTableDialog deleteDialog = new DeleteTableDialog(Jmetrik.this, workspace.getDatabaseName(), (SortedListModel<DataTableName>) workspaceList.getModel()); deleteDialog.setVisible(true); if (deleteDialog.canRun()) { int nSelected = deleteDialog.getNumberOfSelectedTables(); int answer = JOptionPane.NO_OPTION; if (nSelected > 1) { answer = JOptionPane.showConfirmDialog(Jmetrik.this, "Do you want to delete these " + nSelected + " tables? \n" + "All data will be permanently deleted. You cannot undo this action.", "Delete Database", JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION); } else { ArrayList<DataTableName> dList = deleteDialog.getSelectedTables(); answer = JOptionPane.showConfirmDialog(Jmetrik.this, "Do you want to delete the table " + dList.get(0).getTableName() + "? \n" + "All data will be permanently deleted. You cannot undo this action.", "Delete Database", JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION); } if (answer == JOptionPane.YES_OPTION) { workspace.runProcess(deleteDialog.getCommand()); } } } else { JOptionPane.showMessageDialog(Jmetrik.this, "You must open a database before deleting a table.", "No Open Database", JOptionPane.ERROR_MESSAGE); } } }); manageMenu.add(mItem); manageMenu.addSeparator(); SubsetCasesProcess subsetCasesProcess = new SubsetCasesProcess(); subsetCasesProcess.addMenuItem(Jmetrik.this, manageMenu, dialogs, workspace, workspaceList); SubsetVariablesProcess subsetVariablesProcess = new SubsetVariablesProcess(); subsetVariablesProcess.addMenuItem(Jmetrik.this, manageMenu, dialogs, workspace, workspaceList); urlString = "/org/tango-project/tango-icon-theme/16x16/actions/edit-delete.png"; url = this.getClass().getResource(urlString); ImageIcon iconDeleteVariables = new ImageIcon(url, "Delete Variables"); mItem = new JMenuItem("Delete Variables..."); mItem.setIcon(iconDeleteVariables); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { DataTableName tableName = (DataTableName) workspaceList.getSelectedValue(); if (!workspace.databaseOpened()) { JOptionPane.showMessageDialog(Jmetrik.this, "You must open a database before subsetting data.", "No Open Database", JOptionPane.ERROR_MESSAGE); } else if (tableName == null) { JOptionPane.showMessageDialog(Jmetrik.this, "You must select a table in the workspace list. \n " + "Select a table to continue.", "No Table Selected", JOptionPane.ERROR_MESSAGE); } else if (workspace.tableOpen()) { DeleteVariableDialog deleteVariableDialog = new DeleteVariableDialog(Jmetrik.this, workspace.getDatabaseName(), workspace.getCurrentDataTable(), workspace.getVariables()); deleteVariableDialog.setVisible(true); if (deleteVariableDialog.canRun()) { int nSelected = deleteVariableDialog.getNumberOfSelectedVariables(); int answer = JOptionPane.NO_OPTION; if (nSelected > 1) { answer = JOptionPane.showConfirmDialog(Jmetrik.this, "Do you want to delete these " + nSelected + " variables? \n" + "All data will be permanently deleted. You cannot undo this action.", "Delete Variables", JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION); } else { VariableAttributes v = deleteVariableDialog.getSelectedVariable(); answer = JOptionPane.showConfirmDialog(Jmetrik.this, "Do you want to delete the variable " + v.getName().toString() + "? \n" + "All data will be permanently deleted. You cannot undo this action.", "Delete Database", JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION); } if (answer == JOptionPane.YES_OPTION) { workspace.runProcess(deleteVariableDialog.getCommand()); } } } } }); manageMenu.add(mItem); menuBar.add(manageMenu); //============================================================================================ // Transform Menu //============================================================================================ JMenu transformMenu = new JMenu("Transform"); transformMenu.setMnemonic('t'); BasicScoringProcess basicScoringProcess = new BasicScoringProcess(); basicScoringProcess.addMenuItem(Jmetrik.this, transformMenu, dialogs, workspace, workspaceList); ScoringProcess scoringProcess = new ScoringProcess(); scoringProcess.addMenuItem(Jmetrik.this, transformMenu, dialogs, workspace, workspaceList); transformMenu.addSeparator(); RankingProcess rankingProcess = new RankingProcess(); rankingProcess.addMenuItem(Jmetrik.this, transformMenu, dialogs, workspace, workspaceList); TestScalingProcess testScalingProcess = new TestScalingProcess(); testScalingProcess.addMenuItem(Jmetrik.this, transformMenu, dialogs, workspace, workspaceList); LinearTransformationProcess linearTransformationProcess = new LinearTransformationProcess(); linearTransformationProcess.addMenuItem(Jmetrik.this, transformMenu, dialogs, workspace, workspaceList); transformMenu.addSeparator(); IrtLinkingProcess irtLinkingProcess = new IrtLinkingProcess(); irtLinkingProcess.addMenuItem(Jmetrik.this, transformMenu, dialogs, workspace, workspaceList); IrtEquatingProcess irtEquatingProcess = new IrtEquatingProcess(); irtEquatingProcess.addMenuItem(Jmetrik.this, transformMenu, dialogs, workspace, workspaceList); menuBar.add(transformMenu); //============================================================================================ // Analyze Menu //============================================================================================ JMenu analyzeMenu = new JMenu("Analyze"); analyzeMenu.setMnemonic('a'); FrequencyProcess frequencyProcess = new FrequencyProcess(); frequencyProcess.addMenuItem(Jmetrik.this, analyzeMenu, dialogs, workspace, workspaceList); DescriptiveProcess descriptiveProcess = new DescriptiveProcess(); descriptiveProcess.addMenuItem(Jmetrik.this, analyzeMenu, dialogs, workspace, workspaceList); CorrelationProcess correlationProcess = new CorrelationProcess(); correlationProcess.addMenuItem(Jmetrik.this, analyzeMenu, dialogs, workspace, workspaceList); analyzeMenu.addSeparator(); ItemAnalysisProcess itemAnalysisProcess = new ItemAnalysisProcess(); itemAnalysisProcess.addMenuItem(Jmetrik.this, analyzeMenu, dialogs, workspace, workspaceList); CmhProcess cmhProcess = new CmhProcess(); cmhProcess.addMenuItem(Jmetrik.this, analyzeMenu, dialogs, workspace, workspaceList); analyzeMenu.addSeparator(); RaschAnalysisProcess raschAnalysisProcess = new RaschAnalysisProcess(); raschAnalysisProcess.addMenuItem(Jmetrik.this, analyzeMenu, dialogs, workspace, workspaceList); IrtItemCalibrationProcess irtItemCalibrationProcess = new IrtItemCalibrationProcess(); irtItemCalibrationProcess.addMenuItem(Jmetrik.this, analyzeMenu, dialogs, workspace, workspaceList); IrtPersonScoringProcess irtPersonScoringProcess = new IrtPersonScoringProcess(); irtPersonScoringProcess.addMenuItem(Jmetrik.this, analyzeMenu, dialogs, workspace, workspaceList); menuBar.add(analyzeMenu); //============================================================================================ // Graph Menu //============================================================================================ JMenu graphMenu = new JMenu("Graph"); graphMenu.setMnemonic('g'); BarChartProcess barchartProcess = new BarChartProcess(); barchartProcess.addMenuItem(Jmetrik.this, graphMenu, dialogs, workspace, workspaceList); PieChartProcess piechartProcess = new PieChartProcess(); piechartProcess.addMenuItem(Jmetrik.this, graphMenu, dialogs, workspace, workspaceList); graphMenu.addSeparator(); HistogramProcess histogramProcess = new HistogramProcess(); histogramProcess.addMenuItem(Jmetrik.this, graphMenu, dialogs, workspace, workspaceList); DensityProcess densityProcess = new DensityProcess(); densityProcess.addMenuItem(Jmetrik.this, graphMenu, dialogs, workspace, workspaceList); LineChartProcess lineChartProcess = new LineChartProcess(); lineChartProcess.addMenuItem(Jmetrik.this, graphMenu, dialogs, workspace, workspaceList); ScatterplotProcess scatterplotProcess = new ScatterplotProcess(); scatterplotProcess.addMenuItem(Jmetrik.this, graphMenu, dialogs, workspace, workspaceList); graphMenu.addSeparator(); NonparametricCurveProcess nonparametricCurveProcess = new NonparametricCurveProcess(); nonparametricCurveProcess.addMenuItem(Jmetrik.this, graphMenu, dialogs, workspace, workspaceList); mItem = new JMenuItem("Irt Plot..."); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { DataTableName tableName = (DataTableName) workspaceList.getSelectedValue(); if (tableName == null) { JOptionPane.showMessageDialog(Jmetrik.this, "You must open a database and select a table. \n " + "Select a table to continue scoring.", "No Table Selected", JOptionPane.ERROR_MESSAGE); } else { if (irtPlotDialog == null && workspace.tableOpen()) { //Note that starting this dialog is different because variables //names must be obtained from the rows of a table. DatabaseAccessObject dao = workspace.getDatabaseFactory().getDatabaseAccessObject(); try { ArrayList<VariableAttributes> tempVar = dao.getVariableAttributesFromColumn( workspace.getConnection(), workspace.getCurrentDataTable(), new VariableName("name")); irtPlotDialog = new IrtPlotDialog(Jmetrik.this, workspace.getDatabaseName(), tableName, tempVar, (SortedListModel<DataTableName>) workspaceList.getModel()); } catch (SQLException ex) { logger.fatal(ex.getMessage(), ex); firePropertyChange("error", "", "Error - Check log for details."); } } if (irtPlotDialog != null) irtPlotDialog.setVisible(true); } if (irtPlotDialog != null && irtPlotDialog.canRun()) { workspace.runProcess(irtPlotDialog.getCommand()); } } }); graphMenu.add(mItem); ItemMapProcess itemMapProcess = new ItemMapProcess(); itemMapProcess.addMenuItem(Jmetrik.this, graphMenu, dialogs, workspace, workspaceList); menuBar.add(graphMenu); //============================================================================================ // Command Menu //============================================================================================ JMenu commandMenu = new JMenu("Commands"); commandMenu.setMnemonic('c'); mItem = new JMenuItem("Run command"); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JScrollPane pain = (JScrollPane) tabbedPane.getSelectedComponent(); JViewport vp = pain.getViewport(); Component c = vp.getComponent(0); if (c instanceof JmetrikTextFile) { JmetrikTab tempTab = (JmetrikTab) tabbedPane.getTabComponentAt(tabbedPane.getSelectedIndex()); JmetrikTextFile textFile = (JmetrikTextFile) c; workspace.runFromSyntax(textFile.getText()); } } }); commandMenu.add(mItem); mItem = new JMenuItem("Stop command"); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //add something } }); mItem.setEnabled(false); commandMenu.add(mItem); mItem = new JMenuItem("Command Reference..."); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //add something } }); mItem.setEnabled(false); commandMenu.add(mItem); menuBar.add(commandMenu); //============================================================================================ // Help Menu //============================================================================================ JMenu helpMenu = new JMenu("Help"); helpMenu.setMnemonic('h'); mItem = new JMenuItem("Quick Start Guide"); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Desktop deskTop = Desktop.getDesktop(); try { URI uri = new URI("http://www.itemanalysis.com/quick-start-guide.php"); deskTop.browse(uri); } catch (URISyntaxException ex) { logger.fatal(ex.getMessage(), ex); firePropertyChange("error", "", "Error - Check log for details."); } catch (IOException ex) { logger.fatal(ex.getMessage(), ex); firePropertyChange("error", "", "Error - Check log for details."); } } }); helpMenu.add(mItem); urlString = "/org/tango-project/tango-icon-theme/16x16/apps/help-browser.png"; url = this.getClass().getResource(urlString); ImageIcon iconAbout = new ImageIcon(url, "About"); mItem = new JMenuItem("About"); mItem.setIcon(iconAbout); mItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JmetrikAboutDialog aboutDialog = new JmetrikAboutDialog(Jmetrik.this, APP_NAME, VERSION, AUTHOR, RELEASE_DATE, COPYRIGHT_YEAR, BETA_VERSION); aboutDialog.setVisible(true); } }); helpMenu.add(mItem); menuBar.add(helpMenu); return menuBar; }
From source file:com.opendoorlogistics.studio.AppFrame.java
private List<MyAction> initEditActions() { ArrayList<MyAction> ret = new ArrayList<>(); ret.add(new MyAction("Undo", "Undo last action", null, "edit-undo-7-32x32.png", true, KeyStroke.getKeyStroke(KeyEvent.VK_Z, Event.CTRL_MASK)) { @Override/*from w ww. ja v a2 s. co m*/ public void actionPerformed(ActionEvent e) { loaded.getDs().undo(); } @Override public void updateEnabled() { setEnabled(loaded != null && loaded.getDs().hasUndo()); } }); ret.add(new MyAction("Redo", "Redo last undone action", null, "edit-redo-7-32x32.png", true, KeyStroke.getKeyStroke(KeyEvent.VK_Y, Event.CTRL_MASK)) { @Override public void actionPerformed(ActionEvent e) { loaded.getDs().redo(); } @Override public void updateEnabled() { setEnabled(loaded != null && loaded.getDs().hasRedo()); } }); return ret; }
From source file:de.codesourcery.jasm16.ide.ui.views.SourceCodeView.java
protected final void setupKeyBindings(final JTextPane editor) { // 'Save' action addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.CTRL_MASK), new AbstractAction() { @Override//from w w w .ja v a2 s . com public void actionPerformed(ActionEvent e) { saveCurrentFile(); } }); // 'Underline text when pressing CTRL while hovering over an identifier' editorPane.addKeyListener(new KeyAdapter() { private boolean isControlKey(KeyEvent e) { return e.getKeyCode() == KeyEvent.VK_CONTROL; } public void keyPressed(KeyEvent e) { if (isControlKey(e)) { final Point ptr = getMouseLocation(); if (ptr != null) { maybeUnderlineIdentifierAt(ptr); } } } public void keyReleased(KeyEvent e) { if (isControlKey(e)) { clearUnderlineHighlight(); } }; }); // "Undo" action addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_Z, Event.CTRL_MASK), undoAction); addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_Y, Event.CTRL_MASK), redoAction); // 'Search' action addKeyBinding(editor, KeyStroke.getKeyStroke(KeyEvent.VK_F, Event.CTRL_MASK), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { showSearchDialog(); } }); setupKeyBindingsHook(editor); }
From source file:edu.ku.brc.ui.UIRegistry.java
public JMenu createEditMenu() { JMenu menu = new JMenu(getResourceString("EDIT")); menu.setMnemonic(KeyEvent.VK_E); // Undo and redo are actions of our own creation. undoAction = (UndoAction) makeAction(UndoAction.class, this, "Undo", null, null, new Integer(KeyEvent.VK_Z), KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); register(UNDO, menu.add(undoAction)); actionMap.put(UNDO, undoAction);// w w w .jav a 2 s . c om redoAction = (RedoAction) makeAction(RedoAction.class, this, "Redo", null, null, new Integer(KeyEvent.VK_Y), KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); register(REDO, menu.add(redoAction)); actionMap.put(REDO, redoAction); menu.addSeparator(); // These actions come from the default editor kit. Get the ones we want // and stick them in the menu. Action cutAction = makeAction(DefaultEditorKit.CutAction.class, null, "Cut", null, "Cut selection to clipboard", // I18N ???? new Integer(KeyEvent.VK_X), KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); register(CUT, menu.add(cutAction)); cutAction.setEnabled(false); actionMap.put(CUT, cutAction); Action copyAction = makeAction(DefaultEditorKit.CopyAction.class, null, "Copy", null, "Copy selection to clipboard", new Integer(KeyEvent.VK_C), KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); register(COPY, menu.add(copyAction)); copyAction.setEnabled(false); actionMap.put(COPY, copyAction); Action pasteAction = makeAction(DefaultEditorKit.PasteAction.class, null, "Paste", null, "Paste contents of clipboard", new Integer(KeyEvent.VK_V), KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); pasteAction.setEnabled(false); register(PASTE, menu.add(pasteAction)); actionMap.put(PASTE, pasteAction); /* menu.addSeparator(); Action selectAllAction = makeAction(SelectAllAction.class, this, "Select All", null, "Select all text", new Integer(KeyEvent.VK_A), KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); menu.add(selectAllAction); */ launchFindReplaceAction = (LaunchFindReplaceAction) makeAction(LaunchFindReplaceAction.class, this, "Find", null, null, new Integer(KeyEvent.VK_F), KeyStroke.getKeyStroke(KeyEvent.VK_F, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); //menu.add(launchFindReplaceAction); // launchFindReplaceAction.setEnabled(false); // register(FIND, menu.add(launchFindReplaceAction)); // actionMap.put(FIND, launchFindReplaceAction); launchFindReplaceAction.setEnabled(false); register(FIND, menu.add(launchFindReplaceAction)); actionMap.put(FIND, launchFindReplaceAction); return menu; }
From source file:com.projity.pm.graphic.frames.GraphicManager.java
public void setToolBarAndMenus(final Container contentPane) { JToolBar toolBar;/*w w w .j av a 2s. co m*/ if (Environment.isRibbonUI()) { if (Environment.isNeedToRestart()) { contentPane.add(new JLabel(Messages.getString("Error.restart")), BorderLayout.CENTER); return; } setRibbon((JRibbonFrame) container, getMenuManager()); // JToolBar viewToolBar = getMenuManager().getToolBar(MenuManager.VIEW_TOOL_BAR_WITH_NO_SUB_VIEW_OPTION); // topTabs = new TabbedNavigation(); // JComponent tabs = topTabs.createContentPanel(getMenuManager(),viewToolBar,0,JTabbedPane.TOP,true); // tabs.setAlignmentX(0.0f); // so it is left justified // // // Box top = new Box(BoxLayout.Y_AXIS); // JComponent bottom; // top.add(tabs); // bottom = new TabbedNavigation().createContentPanel(getMenuManager(),viewToolBar,1,JTabbedPane.BOTTOM,false); // contentPane.add(top, BorderLayout.BEFORE_FIRST_LINE); // contentPane.add(bottom,BorderLayout.AFTER_LAST_LINE); // if (Environment.isNewLaf()) // contentPane.setBackground(Color.WHITE); // if (Environment.isMac()){ // //System.setProperty("apple.laf.useScreenMenuBar","true"); // //System.setProperty("com.apple.mrj.application.apple.menu.about.name", Messages.getMetaString("Text.ShortTitle")); // JMenuBar menu = getMenuManager().getMenu(Environment.getStandAlone()?MenuManager.MAC_STANDARD_MENU:MenuManager.SERVER_STANDARD_MENU); // //((JComponent)menu).setBorder(BorderFactory.createEmptyBorder()); // // ((JFrame)container).setJMenuBar(menu); // projectListMenu = (JMenu) menu.getComponent(5); // } } else if (Environment.isNewLook()) { if (Environment.isNeedToRestart()) { contentPane.add(new JLabel(Messages.getString("Error.restart")), BorderLayout.CENTER); return; } toolBar = getMenuManager().getToolBar(MenuManager.BIG_TOOL_BAR); if (!getLafManager().isToolbarOpaque()) toolBar.setOpaque(false); if (!isApplet()) getMenuManager().setActionVisible(ACTION_FULL_SCREEN, false); if (Environment.isExternal()) // external users only see project team getMenuManager().setActionVisible(ACTION_TEAM_FILTER, false); toolBar.addSeparator(new Dimension(20, 20)); toolBar.add(new Box.Filler(new Dimension(0, 0), new Dimension(0, 0), new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE))); toolBar.add(((DefaultFrameManager) getFrameManager()).getProjectComboPanel()); toolBar.add(Box.createRigidArea(new Dimension(20, 20))); if (Environment.isNewLaf()) toolBar.setBackground(Color.WHITE); toolBar.setFloatable(false); toolBar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); Box top; JComponent bottom; top = new Box(BoxLayout.Y_AXIS); toolBar.setAlignmentX(0.0f); // so it is left justified top.add(toolBar); JToolBar viewToolBar = getMenuManager().getToolBar(MenuManager.VIEW_TOOL_BAR_WITH_NO_SUB_VIEW_OPTION); topTabs = new TabbedNavigation(); JComponent tabs = topTabs.createContentPanel(getMenuManager(), viewToolBar, 0, JTabbedPane.TOP, true); tabs.setAlignmentX(0.0f); // so it is left justified top.add(tabs); bottom = new TabbedNavigation().createContentPanel(getMenuManager(), viewToolBar, 1, JTabbedPane.BOTTOM, false); contentPane.add(top, BorderLayout.BEFORE_FIRST_LINE); contentPane.add(bottom, BorderLayout.AFTER_LAST_LINE); if (Environment.isNewLaf()) contentPane.setBackground(Color.WHITE); if (Environment.isMac()) { //System.setProperty("apple.laf.useScreenMenuBar","true"); //System.setProperty("com.apple.mrj.application.apple.menu.about.name", Messages.getMetaString("Text.ShortTitle")); JMenuBar menu = getMenuManager().getMenu(Environment.getStandAlone() ? MenuManager.MAC_STANDARD_MENU : MenuManager.SERVER_STANDARD_MENU); //((JComponent)menu).setBorder(BorderFactory.createEmptyBorder()); ((JFrame) container).setJMenuBar(menu); projectListMenu = (JMenu) menu.getComponent(5); } } else { toolBar = getMenuManager().getToolBar( Environment.isMac() ? MenuManager.MAC_STANDARD_TOOL_BAR : MenuManager.STANDARD_TOOL_BAR); filterToolBarManager = FilterToolBarManager.create(getMenuManager()); filterToolBarManager.addButtons(toolBar); contentPane.add(toolBar, BorderLayout.BEFORE_FIRST_LINE); JToolBar viewToolBar = getMenuManager().getToolBar(MenuManager.VIEW_TOOL_BAR); viewToolBar.setOrientation(JToolBar.VERTICAL); viewToolBar.setRollover(true); contentPane.add(viewToolBar, BorderLayout.WEST); JMenuBar menu = getMenuManager().getMenu(Environment.getStandAlone() ? (Environment.isMac() ? MenuManager.MAC_STANDARD_MENU : MenuManager.STANDARD_MENU) : MenuManager.SERVER_STANDARD_MENU); if (!Environment.isMac()) { ((JComponent) menu).setBorder(BorderFactory.createEmptyBorder()); JMenuItem logo = (JMenuItem) menu.getComponent(0); logo.setBorder(BorderFactory.createEmptyBorder()); logo.setMaximumSize(new Dimension(124, 52)); logo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } ((JFrame) container).setJMenuBar(menu); projectListMenu = (JMenu) menu.getComponent(Environment.isMac() ? 5 : 6); } //accelerators addCtrlAccel(KeyEvent.VK_G, ACTION_GOTO, null); addCtrlAccel(KeyEvent.VK_L, ACTION_GOTO, null); addCtrlAccel(KeyEvent.VK_F, ACTION_FIND, null); addCtrlAccel(KeyEvent.VK_Z, ACTION_UNDO, null); //- Sanhita addCtrlAccel(KeyEvent.VK_Y, ACTION_REDO, null); addCtrlAccel(KeyEvent.VK_N, ACTION_NEW_PROJECT, null); addCtrlAccel(KeyEvent.VK_O, ACTION_OPEN_PROJECT, null); addCtrlAccel(KeyEvent.VK_S, ACTION_SAVE_PROJECT, null); addCtrlAccel(KeyEvent.VK_P, ACTION_PRINT, null); //-Sanhita addCtrlAccel(KeyEvent.VK_I, ACTION_INSERT_TASK, null); addCtrlAccel(KeyEvent.VK_PERIOD, ACTION_INDENT, null); addCtrlAccel(KeyEvent.VK_COMMA, ACTION_OUTDENT, null); addCtrlAccel(KeyEvent.VK_PLUS, ACTION_EXPAND, new ExpandAction()); addCtrlAccel(KeyEvent.VK_ADD, ACTION_EXPAND, new ExpandAction()); addCtrlAccel(KeyEvent.VK_EQUALS, ACTION_EXPAND, new ExpandAction()); addCtrlAccel(KeyEvent.VK_MINUS, ACTION_COLLAPSE, new CollapseAction()); addCtrlAccel(KeyEvent.VK_SUBTRACT, ACTION_COLLAPSE, new CollapseAction()); // To force a recalculation. This normally shouldn't be needed. addCtrlAccel(KeyEvent.VK_R, ACTION_RECALCULATE, new RecalculateAction()); }
From source file:org.datavyu.views.DatavyuView.java
/** * Constructor.// ww w .j a v a 2 s .c o m * * @param app * The SingleFrameApplication that invoked this main FrameView. */ public DatavyuView(final SingleFrameApplication app) { super(app); KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); manager.addKeyEventDispatcher(new KeyEventDispatcher() { /** * Dispatches the keystroke to the correct action. * * @param evt The event that triggered this action. * @return true if the KeyboardFocusManager should take no further * action with regard to the KeyEvent; false otherwise. */ @Override public boolean dispatchKeyEvent(final KeyEvent evt) { // Pass the keyevent onto the keyswitchboard so that it can // route it to the correct action. // spreadsheetMenuSelected(null); return Datavyu.getApplication().dispatchKeyEvent(evt); } }); // generated GUI builder code initComponents(); // BugzID:492 - Set the shortcut for new cell, so a keystroke that won't // get confused for the "carriage return". The shortcut for new cells // is handled in Datavyu.java newCellMenuItem.setAccelerator(KeyStroke.getKeyStroke('\u21A9')); // BugzID:521 + 468 - Define accelerator keys based on Operating system. int keyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); weakTemporalOrderMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, keyMask)); strongTemporalOrderMenuItem .setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.SHIFT_MASK | keyMask)); // Set zoom in to keyMask + '+' zoomInMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, keyMask)); // Set zoom out to keyMask + '-' zoomOutMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, keyMask)); // Set reset zoom to keyMask + '0' resetZoomMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_0, keyMask)); // Set the save accelerator to keyMask + 'S' saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, keyMask)); // Set the save as accelerator to keyMask + shift + 'S' saveAsMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, keyMask | InputEvent.SHIFT_MASK)); // Set the open accelerator to keyMask + 'o'; openMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, keyMask)); // Set the new accelerator to keyMask + 'N'; newMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, keyMask)); // Set the new accelerator to keyMask + 'L'; newCellLeftMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, keyMask)); // Set the new accelerator to keyMask + 'R'; newCellRightMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, keyMask)); // Set the show spreadsheet accelrator to F5. showSpreadsheetMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0)); // Set the undo accelerator to keyMask + 'Z'; undoSpreadSheetMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, keyMask)); // Set the redo accelerator to keyMask + 'Y' redoSpreadSheetMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, keyMask)); if (panel != null) { panel.deregisterListeners(); panel.removeFileDropEventListener(this); } panel = new SpreadsheetPanel(Datavyu.getProjectController().getDB(), null); panel.registerListeners(); panel.addFileDropEventListener(this); setComponent(panel); System.out.println(getComponent()); // initialize the undo/redo system spreadsheetUndoManager = new SpreadsheetUndoManager(); undoSupport = new UndoableEditSupport(); undoSupport.addUndoableEditListener(new UndoAdapter()); refreshUndoRedo(); ////// //Jakrabbit Menu pushMenuItem.setVisible(false); pullMenuItem.setVisible(false); jSeparator10.setVisible(false); }
From source file:org.domainmath.gui.MainFrame.java
/** This method is called from within the constructor to * initialize the form./*from w ww.ja va 2 s .c om*/ * 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(); }