/** UI表示言語変更. */ public void LanguageChange() { MessageDataManager mesDataMan = getMesman().getMesDataMan(); getMenu().setText(mesDataMan.getMessage(MesTableDefine.mes_file)); open.setText(mesDataMan.getMessage(MesTableDefine.mes_open)); openMesTbl.setText(mesDataMan.getMessage(MesTableDefine.mes_mtbl)); openTabTbl.setText(mesDataMan.getMessage(MesTableDefine.mes_ttbl)); save.setText(mesDataMan.getMessage(MesTableDefine.mes_save)); saveMesTbl.setText(mesDataMan.getMessage(MesTableDefine.mes_mtbl)); saveTabTbl.setText(mesDataMan.getMessage(MesTableDefine.mes_ttbl)); output.setText(mesDataMan.getMessage(MesTableDefine.mes_output)); }
/** * Constructor for PopupMenu. */ public PopupMenu() { super(); JMenu pMenu = new JMenu(); pMenu.setText(Translator.localize("button.new-pseudostate")); pMenu.add(new ActionNewPseudoState( Model.getPseudostateKind().getChoice(), "label.pseudostate.choice")); pMenu.add(new ActionNewPseudoState( Model.getPseudostateKind().getInitial(), "label.pseudostate.initial")); pMenu.add(new ActionNewPseudoState( Model.getPseudostateKind().getDeepHistory(), "label.pseudostate.deephistory")); pMenu.add(new ActionNewPseudoState( Model.getPseudostateKind().getJunction(), "label.pseudostate.junction")); pMenu.add(new ActionNewPseudoState( Model.getPseudostateKind().getShallowHistory(), "label.pseudostate.shallowhistory")); pMenu.add(new ActionNewPseudoState( Model.getPseudostateKind().getFork(), "label.pseudostate.fork")); pMenu.add(new ActionNewPseudoState( Model.getPseudostateKind().getJoin(), "label.pseudostate.join")); JMenu newMenu = new JMenu(); newMenu.setText(Translator.localize("action.new")); newMenu.add(pMenu); newMenu.add(ActionNewSynchState.getInstance()); ActionNewSynchState.getInstance().setTarget(getTarget()); newMenu.add(ActionNewStubState.getInstance()); ActionNewStubState.getInstance().setTarget(getTarget()); newMenu.add(ActionNewCompositeState.getSingleton()); ActionNewCompositeState.getSingleton().setTarget(getTarget()); newMenu.add(ActionNewSimpleState.getSingleton()); ActionNewSimpleState.getSingleton().setTarget(getTarget()); newMenu.add(ActionNewFinalState.getSingleton()); ActionNewFinalState.getSingleton().setTarget(getTarget()); newMenu.add(ActionNewSubmachineState.getInstance()); ActionNewSubmachineState.getInstance().setTarget(getTarget()); add(newMenu); addSeparator(); ActionRemoveModelElement.SINGLETON.setTarget(getSelectedValue()); ActionRemoveModelElement.SINGLETON.setObjectToRemove( getSelectedValue()); add(ActionRemoveModelElement.SINGLETON); }
/** * Add a menu item to a named menu * * @param topMenu the name of the menu to add to * @param menuItem the entry text for the item itself * @param action the action associated with the menu item * @param accelerator the keystroke accelerator to associate with the item */ protected void addMenuItemToMenu( String topMenu, String menuItem, final Action action, KeyStroke accelerator) { JMenuItem newItem = m_menuItemMap.get(menuItem); if (newItem != null) { throw new IllegalArgumentException("The menu item '" + menuItem + "' already exists!"); } newItem = new JMenuItem(menuItem); if (accelerator != null) { newItem.setAccelerator(accelerator); } newItem.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { action.actionPerformed(e); } }); JMenu topJ = m_menuMap.get(topMenu); if (topJ == null) { topJ = new JMenu(); topJ.setText(topMenu); m_menuMap.put(topMenu, topJ); } topJ.add(newItem); m_menuItemMap.put(menuItem, newItem); }
/** * Loads the menu with the available look and feels for the application * * @return l and f menu */ JMenu buildLookAndFeelMenu() { String activeLookAndFeelName = UIManager.getLookAndFeel().getName(); // ButtonGroup buttonGroup = new ButtonGroup(); JMenu lfMenu = new JMenu(); lfMenu.setText(rb.getString("Menu.LookAndFeel.Name")); lfMenu.setMnemonic(jgnash.ui.util.Resource.getMnemonic("Menu.LookAndFeel.Mnemonic")); lfMenu.add(buildSubstanceMenu()); List<String> lookAndFeels = new ArrayList<>(); for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if (isLookAndFeelAvailable(info.getClassName())) { lookAndFeels.add(info.getClassName()); } } for (String lookAndFeel : KNOWN) { if (isLookAndFeelAvailable(lookAndFeel)) { lookAndFeels.add(lookAndFeel); } } Collections.sort(lookAndFeels); for (String lookAndFeel : lookAndFeels) { try { Class<?> lnfClass = Class.forName(lookAndFeel); LookAndFeel newLAF = (LookAndFeel) lnfClass.newInstance(); JRadioButtonMenuItem button = new JRadioButtonMenuItem(); button.setText(newLAF.getName()); button.setActionCommand(lookAndFeel); button.setName(newLAF.getName()); button.addActionListener( e -> { Preferences pref = Preferences.userNodeForPackage(ThemeManager.class); pref.put(LF, e.getActionCommand()); restartUI(); }); lfButtonGroup.add(button); lfMenu.add(button); if (newLAF.getName().equals(activeLookAndFeelName)) { button.setSelected(true); } } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { Logger.getLogger(ThemeManager.class.getName()).log(Level.WARNING, null, e); } } return lfMenu; }
/* WARNING: THIS METHOD WILL BE REGENERATED. */ private javax.swing.JMenu getTestMenu() { if (ivjTestMenu == null) { try { ivjTestMenu = new javax.swing.JMenu(); ivjTestMenu.setName("TestMenu"); ivjTestMenu.setText("Test"); ivjTestMenu.setBackground(java.awt.SystemColor.control); ivjTestMenu.setActionCommand("FileMenu"); ivjTestMenu.add(getRunMenuItem()); ivjTestMenu.add(getSetupMenuItem()); ivjTestMenu.add(getResetMenuItem()); ivjTestMenu.add(getJSeparator1()); ivjTestMenu.add(getKillMenuItem()); ivjTestMenu.add(getStopMenuItem()); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjTestMenu; }
public static JMenu createMenu(String text) { JMenu menu = new JMenu(); menu.setText(text); return menu; }
private void initGUI() { try { setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); setTitle("Die BSC der HTL Spengergasse"); { jMenuBar1 = new JMenuBar(); setJMenuBar(jMenuBar1); { jMenu1 = new JMenu(); jMenuBar1.add(jMenu1); jMenu1.setText("Eigene Einstellungen"); jMenu1.setPreferredSize(new java.awt.Dimension(131, 21)); { mi_PasswortÄndern = new JMenuItem(); jMenu1.add(mi_PasswortÄndern); mi_PasswortÄndern.setText("Passwort ändern"); } } } pack(); this.setSize(620, 400); } catch (Exception e) { e.printStackTrace(); } }
/* WARNING: THIS METHOD WILL BE REGENERATED. */ private javax.swing.JMenu getLoadBuildMenu() { if (ivjLoadBuildMenu == null) { try { ivjLoadBuildMenu = new javax.swing.JMenu(); ivjLoadBuildMenu.setName("LoadBuildMenu"); ivjLoadBuildMenu.setText("Test Results"); ivjLoadBuildMenu.setBackground(java.awt.SystemColor.control); ivjLoadBuildMenu.setActionCommand("FileMenu"); ivjLoadBuildMenu.add(getRebuildTestsMenuItem()); ivjLoadBuildMenu.add(getResetModelsMenuItem()); ivjLoadBuildMenu.add(getJSeparator11()); ivjLoadBuildMenu.add(getLogResultsMenuItem()); ivjLoadBuildMenu.add(getJSeparator2()); ivjLoadBuildMenu.add(getSaveResultsMenuItem()); ivjLoadBuildMenu.add(getQueryResultsMenuItem()); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjLoadBuildMenu; }
/** * Constructs a new popupmenu. The given parameter role determines what the purpose is of the * actions that can be created via this popupmenu. The parameter must comply to the interface * Roles defined on ActionNewAction. * * @param role the role * @param list the list */ public PopupMenuNewAction(String role, UMLMutableLinkedList list) { super(); JMenu newMenu = new JMenu(); newMenu.setText(Translator.localize("action.new")); newMenu.add(ActionNewCallAction.getInstance()); ActionNewCallAction.getInstance().setTarget(list.getTarget()); ActionNewCallAction.getInstance().putValue(ActionNewAction.ROLE, role); newMenu.add(ActionNewCreateAction.getInstance()); ActionNewCreateAction.getInstance().setTarget(list.getTarget()); ActionNewCreateAction.getInstance().putValue(ActionNewAction.ROLE, role); newMenu.add(ActionNewDestroyAction.getiNSTANCE()); ActionNewDestroyAction.getiNSTANCE().setTarget(list.getTarget()); ActionNewDestroyAction.getiNSTANCE().putValue(ActionNewAction.ROLE, role); newMenu.add(ActionNewReturnAction.getInstance()); ActionNewReturnAction.getInstance().setTarget(list.getTarget()); ActionNewReturnAction.getInstance().putValue(ActionNewAction.ROLE, role); newMenu.add(ActionNewSendAction.getInstance()); ActionNewSendAction.getInstance().setTarget(list.getTarget()); ActionNewSendAction.getInstance().putValue(ActionNewAction.ROLE, role); newMenu.add(ActionNewTerminateAction.getInstance()); ActionNewTerminateAction.getInstance().setTarget(list.getTarget()); ActionNewTerminateAction.getInstance().putValue(ActionNewAction.ROLE, role); newMenu.add(ActionNewUninterpretedAction.getInstance()); ActionNewUninterpretedAction.getInstance().setTarget(list.getTarget()); ActionNewUninterpretedAction.getInstance().putValue(ActionNewAction.ROLE, role); add(newMenu); addSeparator(); ActionRemoveModelElement.SINGLETON.setObjectToRemove( ActionNewAction.getAction(role, list.getTarget())); add(ActionRemoveModelElement.SINGLETON); }
/** * This method initializes showPageMenu * * @return javax.swing.JMenu */ private JMenu getShowPageMenu() { if (showPageMenu == null) { showPageMenu = new JMenu(); showPageMenu.setText("Show Page"); } return showPageMenu; }
/** * Updates menu configuration * * @param menu * @param prefix (in properties file) */ public void configureMenu(JMenu menu, String prefix) { menu.setName(prefix); String text = bundle.getString(prefix + ".text"); menu.setText(text); try { String mnemonic = bundle.getString(prefix + ".mnemonic"); menu.setMnemonic(mnemonic.charAt(0)); } catch (MissingResourceException exception) { // ok not to set mnemonic } try { String tooltip = bundle.getString(prefix + ".tooltip"); menu.setToolTipText(tooltip); } catch (MissingResourceException exception) { // ok not to set tooltip } try { String iconPath = bundle.getString(prefix + ".icon"); if (iconPath != null) { ImageIcon icon = new ImageIcon(this.referenceClass.getResource(iconPath)); menu.setIcon(icon); } } catch (MissingResourceException exception) { // ok not to set tooltip } }
/** Remove all types from the menu. Then cycle through all available values, and add them. */ public static void populateSpecialFieldMenu(JMenu menu, SpecialField field, JabRefFrame frame) { menu.setText(field.getMenuString()); menu.setIcon(((IconTheme.FontBasedIcon) field.getRepresentingIcon()).createSmallIcon()); for (SpecialFieldValue val : field.getValues()) { menu.add(val.getMenuAction(frame)); } }
/** Remove all types from the menu. Then cycle through all available values, and add them. */ public static void populateSpecialFieldMenu(JMenu menu, SpecialField field, JabRefFrame frame) { // menu.removeAll(); menu.setText(field.getMenuString()); menu.setIcon(field.getRepresentingIcon()); for (SpecialFieldValue val : field.getValues()) { menu.add(val.getMenuAction(frame)); } }
/** * Este método inicializa o jMenu * * @return javax.swing.JMenu */ private JMenu getJMenu() { if (jMenu == null) { jMenu = new JMenu(); jMenu.setText("Funções"); jMenu.add(getJMenuItemUcReservarCarro()); } return jMenu; }
public void majMenu(String panneau) { _dernierPanneau = panneau; if (panneau.equals("DPOG") || panneau.equals("DDiagram")) _mnu.setVisible(false); else { _mnu.setVisible(true); _mnu.setText(lnkSysteme.lnkFenetrePrincipale.getLnkLangues().valeurDe(panneau)); } }
/** * This method initializes jMenu * * @return javax.swing.JMenu */ private JMenu getHelpMenu() { if (helpMenu == null) { helpMenu = new JMenu(); helpMenu.setText("Help"); helpMenu.add(getAboutMenuItem()); } return helpMenu; }
/** * This method initializes jMenu * * @return javax.swing.JMenu */ javax.swing.JMenu getHelpMenu() { if (helpMenu == null) { helpMenu = new javax.swing.JMenu(); helpMenu.setText("Help"); helpMenu.add(getAboutMenuItem()); } return helpMenu; }
private void buildMenu() { jMenuBar = new javax.swing.JMenuBar(); mainMenu = new javax.swing.JMenu(); mainMenu.setText("Main"); loginMenuItem = new JMenuItem("Login..."); loginMenuItem.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { headerPanel.handleLoginLogout(); } }); mainMenu.add(loginMenuItem); exitMenuItem = new JMenuItem("Exit"); exitMenuItem.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { if (qsadminMain.isConnected() == true) { headerPanel.handleLoginLogout(); } System.exit(0); } }); mainMenu.add(exitMenuItem); helpMenu = new javax.swing.JMenu(); helpMenu.setText("Help"); aboutMenuItem = new JMenuItem("About..."); aboutMenuItem.setEnabled(true); aboutMenuItem.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { about(); } }); helpMenu.add(aboutMenuItem); jMenuBar.add(mainMenu); jMenuBar.add(helpMenu); parentFrame.setJMenuBar(jMenuBar); }
/** * This method initializes midiInItem * * @return javax.swing.JMenuItem */ private JMenu getPageChangeMidiInMenu() { if (pageChangeMidiInMenu == null) { pageChangeMidiInMenu = new JMenu(); pageChangeMidiInMenu.setText("Page Change MIDI In"); pageChangeMidiInMenu.setMnemonic(KeyEvent.VK_I); pageChangeMidiInMenu.add(getNoInputDevicesEnabledItem2()); } return pageChangeMidiInMenu; }
/** * This method initializes midiInItem * * @return javax.swing.JMenuItem */ private JMenu getMidiInMenu() { if (midiInMenu == null) { midiInMenu = new JMenu(); midiInMenu.setText("MIDI In"); midiInMenu.setMnemonic(KeyEvent.VK_I); midiInMenu.add(getNoInputDevicesEnabledItem()); } return midiInMenu; }
/** * This method initializes jMenu * * @return javax.swing.JMenu */ private JMenu getFileMenu() { if (fileMenu == null) { fileMenu = new JMenu(); fileMenu.setText("File"); fileMenu.add(getSaveMenuItem()); fileMenu.add(getExitMenuItem()); } return fileMenu; }
/** * This method initializes midiOutItem * * @return javax.swing.JMenuItem */ private JMenu getMidiOutMenu() { if (midiOutMenu == null) { midiOutMenu = new JMenu(); midiOutMenu.setText("MIDI Out"); midiOutMenu.add(getNoOutputDevicesEnabledItem()); midiOutMenu.setMnemonic(KeyEvent.VK_O); } return midiOutMenu; }
private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(new BorderLayout()); contentPane.setPreferredSize(new Dimension(600, 400)); contentPane.setBackground(Color.lightGray); jMenuFile.setText("File"); jMenuFileExit.setText("Exit"); jMenuFileExit.addActionListener(new AgentPanel_jMenuFileExit_ActionAdapter(this)); jMenuHelp.setText("Help"); jMenuHelpAbout.setText("About"); jMenuHelpAbout.addActionListener(new AgentPanel_jMenuHelpAbout_ActionAdapter(this)); jMenuBar.setActionMap(null); jMenuFile.add(jMenuFileExit); jMenuHelp.add(jMenuHelpAbout); jMenuBar.add(jMenuFile); jMenuBar.add(jMenuHelp); this.setJMenuBar(jMenuBar); }
/** * This method initializes menuConectar * * @return javax.swing.JMenu */ private JMenu getMenuConectar() { if (menuConectar == null) { menuConectar = new JMenu(); menuConectar.setText(MessagesUtil.getString("JanelaPrincipal.menu.conectar")); // $NON-NLS-1$ menuConectar.add(getMenuItemConectarJogador()); menuConectar.add(getMenuItemChat()); } return menuConectar; }
/** * This method initializes menuConfigurar * * @return javax.swing.JMenu */ private JMenu getMenuVisualizar() { if (menuVisualizar == null) { menuVisualizar = new JMenu(); menuVisualizar.setText( MessagesUtil.getString("JanelaPrincipal.menu.visualizar")); // $NON-NLS-1$ menuVisualizar.add(getMenuItemArena()); } return menuVisualizar; }
/** * This method initializes jMenu * * @return javax.swing.JMenu */ private JMenu getEditMenu() { if (editMenu == null) { editMenu = new JMenu(); editMenu.setText("Edit"); editMenu.add(getCutMenuItem()); editMenu.add(getCopyMenuItem()); editMenu.add(getPasteMenuItem()); } return editMenu; }
/** @param args the command line arguments */ public static void main(String[] args) { JFrame frame = new JFrame("Editing and Mouse Menu Demo"); SparseMultigraph<GraphElements.MyVertex, GraphElements.MyEdge> g = new SparseMultigraph<GraphElements.MyVertex, GraphElements.MyEdge>(); // Layout<V, E>, VisualizationViewer<V,E> // Map<GraphElements.MyVertex,Point2D> vertexLocations = new // HashMap<GraphElements.MyVertex, Point2D>(); Layout<GraphElements.MyVertex, GraphElements.MyEdge> layout = new StaticLayout(g); layout.setSize(new Dimension(300, 300)); VisualizationViewer<GraphElements.MyVertex, GraphElements.MyEdge> vv = new VisualizationViewer<GraphElements.MyVertex, GraphElements.MyEdge>(layout); vv.setPreferredSize(new Dimension(350, 350)); // Show vertex and edge labels vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller()); vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller()); // Create a graph mouse and add it to the visualization viewer EditingModalGraphMouse gm = new EditingModalGraphMouse( vv.getRenderContext(), GraphElements.MyVertexFactory.getInstance(), GraphElements.MyEdgeFactory.getInstance()); // Set some defaults for the Edges... GraphElements.MyEdgeFactory.setDefaultCapacity(192.0); GraphElements.MyEdgeFactory.setDefaultWeight(5.0); // Trying out our new popup menu mouse plugin... PopupVertexEdgeMenuMousePlugin myPlugin = new PopupVertexEdgeMenuMousePlugin(); // Add some popup menus for the edges and vertices to our mouse plugin. JPopupMenu edgeMenu = new MyMouseMenus.EdgeMenu(frame); JPopupMenu vertexMenu = new MyMouseMenus.VertexMenu(); myPlugin.setEdgePopup(edgeMenu); myPlugin.setVertexPopup(vertexMenu); gm.remove(gm.getPopupEditingPlugin()); // Removes the existing popup editing plugin gm.add(myPlugin); // Add our new plugin to the mouse vv.setGraphMouse(gm); // JFrame frame = new JFrame("Editing and Mouse Menu Demo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(vv); // Let's add a menu for changing mouse modes JMenuBar menuBar = new JMenuBar(); JMenu modeMenu = gm.getModeMenu(); modeMenu.setText("Mouse Mode"); modeMenu.setIcon(null); // I'm using this in a main menu modeMenu.setPreferredSize(new Dimension(80, 20)); // Change the size so I can see the text menuBar.add(modeMenu); frame.setJMenuBar(menuBar); gm.setMode(ModalGraphMouse.Mode.EDITING); // Start off in editing mode frame.pack(); frame.setVisible(true); }
/** * This method initializes midiMenu * * @return javax.swing.JMenu */ private JMenu getMidiMenu() { if (midiMenu == null) { midiMenu = new JMenu(); midiMenu.setText("MIDI"); midiMenu.add(getMidiInMenu()); midiMenu.add(getMidiOutMenu()); midiMenu.setEnabled(false); midiMenu.setMnemonic(KeyEvent.VK_M); } return midiMenu; }
/** * This method initializes jMenu * * @return javax.swing.JMenu */ javax.swing.JMenu getFileMenu() { if (fileMenu == null) { fileMenu = new javax.swing.JMenu(); fileMenu.setText("File"); fileMenu.add(getLoadParametersMenuItem()); fileMenu.add(getLoadCheckpointMenuItem()); fileMenu.add(new JSeparator()); fileMenu.add(getExitMenuItem()); } return fileMenu; }
private JMenu getJMenu0() { if (jMenu0 == null) { jMenu0 = new JMenu(); jMenu0.setText("Menu"); jMenu0.setBorderPainted(true); jMenu0.setOpaque(false); jMenu0.setRolloverEnabled(false); jMenu0.add(getJMenuItem0()); } return jMenu0; }