Java Code Examples for javax.swing.JMenuBar#setOpaque()
The following examples show how to use
javax.swing.JMenuBar#setOpaque() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleApp.java From magarena with GNU General Public License v3.0 | 5 votes |
public SimpleApp(String[] args) { super("Java Application"); final int inset = 100; Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setBounds (inset, inset, screenSize.width - inset * 2, screenSize.height - inset * 2); JMenu menu = new JMenu("File"); menu.add(new JMenuItem("Open")); menu.add(new JMenuItem("Save")); JMenuBar mb = new JMenuBar(); mb.setOpaque(true); mb.add(menu); setJMenuBar(mb); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(123); }}); setVisible(true); StringBuffer sb = new StringBuffer("Java version: "); sb.append(System.getProperty("java.version")); sb.append("\nJava home: "); sb.append(System.getProperty("java.home")); sb.append("\nCurrent dir: "); sb.append(System.getProperty("user.dir")); if (args.length > 0) { sb.append("\nArgs: "); for (int i = 0; i < args.length; i++) { sb.append(args[i]); sb.append(' '); } } JOptionPane.showMessageDialog(this, sb.toString(), "Info", JOptionPane.INFORMATION_MESSAGE); }
Example 2
Source File: BitcoinWalletDialog.java From RipplePower with Apache License 2.0 | 5 votes |
public BitcoinWalletDialog(String text, Window parent) { super(LSystem.applicationMain, text, Dialog.ModalityType.DOCUMENT_MODAL); addWindowListener(HelperWindow.get()); setIconImage(UIRes.getIcon()); setResizable(false); int frameWidth = 900; int frameHeight = 580; if (LSystem.applicationMain != null) { frameWidth = LSystem.applicationMain.getWidth() - 150; frameHeight = LSystem.applicationMain.getHeight() - 150; } setPreferredSize(new Dimension(frameWidth, frameHeight)); JMenuBar menuBar = new JMenuBar(); menuBar.setOpaque(true); menuBar.setBackground(new Color(230, 230, 230)); menuBar.add(new Menus(this, "File", new String[] { "Exit", "exit" })); menuBar.add(new Menus(this, "View", new String[] { "Receive Addresses", "view receive" }, new String[] { "Send Addresses", "view send" })); menuBar.add(new Menus(this, "Actions", new String[] { "Send Coins", "send coins" }, new String[] { "Sign Message", "sign message" }, new String[] { "Verify Message", "verify message" })); menuBar.add(new Menus(this, "Tools", new String[] { "Export Keys", "export keys" }, new String[] { "Import Keys", "import keys" }, new String[] { "Rescan Block Chain", "rescan" })); setJMenuBar(menuBar); transactionPanel = new TransactionPanel(this); setContentPane(transactionPanel); if (BTCLoader.networkChainHeight > BTCLoader.blockStore.getChainHeight()) { setTitle("Bitcoin Wallet - Synchronizing with network"); synchronizingTitle = true; } addWindowListener(new ApplicationWindowListener()); BTCLoader.networkHandler.addListener(this); BTCLoader.databaseHandler.addListener(this); }
Example 3
Source File: MetalworksFrame.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 4
Source File: MetalworksFrame.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 5
Source File: MetalworksFrame.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 6
Source File: MetalworksFrame.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 7
Source File: MetalworksFrame.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 8
Source File: MetalworksFrame.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 9
Source File: MetalworksFrame.java From hottub with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 10
Source File: BlazeActions.java From constellation with Apache License 2.0 | 4 votes |
public BlazeActions() { panel = new JPanel(); panel.setLayout(new BorderLayout()); menuBar = new JMenuBar(); menuBar.setOpaque(true); menu = new JMenu(); menu.setIcon(ImageUtilities.loadImageIcon(BLAZE_ACTIONS_ICON, false)); menu.setToolTipText("Blaze Controls"); menu.addChangeListener(e -> { if (graph != null) { updateSliders(graph); } }); menu.setEnabled(false); final JMenuItem selectBlazesItem = new JMenuItem("Select Blazes"); selectBlazesItem.setIcon(ImageUtilities.loadImageIcon(SELECT_BLAZES_ICON, false)); selectBlazesItem.setActionCommand(SELECT_BLAZES_ACTION); selectBlazesItem.addActionListener(this); menu.add(selectBlazesItem); final JMenuItem deselectBlazesItem = new JMenuItem("Deselect Blazes"); deselectBlazesItem.setIcon(ImageUtilities.loadImageIcon(DESELECT_BLAZES_ICON, false)); deselectBlazesItem.setActionCommand(DESELECT_BLAZES_ACTION); deselectBlazesItem.addActionListener(this); menu.add(deselectBlazesItem); final JMenuItem addBlueBlazeItem = new JMenuItem("Add Blue Blazes"); addBlueBlazeItem.setIcon(ImageUtilities.loadImageIcon(ADD_BLUE_BLAZE_ICON, false)); addBlueBlazeItem.setActionCommand(ADD_BLUE_BLAZE_ACTION); addBlueBlazeItem.addActionListener(BlazeActions.this); menu.add(addBlueBlazeItem); final JMenuItem addRedBlazeItem = new JMenuItem("Add Red Blazes"); addRedBlazeItem.setIcon(ImageUtilities.loadImageIcon(ADD_RED_BLAZE_ICON, false)); addRedBlazeItem.setActionCommand(ADD_RED_BLAZE_ACTION); addRedBlazeItem.addActionListener(BlazeActions.this); menu.add(addRedBlazeItem); final JMenuItem addYellowBlazeItem = new JMenuItem("Add Yellow Blazes"); addYellowBlazeItem.setIcon(ImageUtilities.loadImageIcon(ADD_YELLOW_BLAZE_ICON, false)); addYellowBlazeItem.setActionCommand(ADD_YELLOW_BLAZE_ACTION); addYellowBlazeItem.addActionListener(BlazeActions.this); menu.add(addYellowBlazeItem); final JMenuItem colorBlazeItem = new JMenuItem("Add Custom Blazes"); colorBlazeItem.setIcon(ImageUtilities.loadImageIcon(ADD_CUSTOM_BLAZE_ICON, false)); colorBlazeItem.setActionCommand(ADD_CUSTOM_BLAZE_ACTION); colorBlazeItem.addActionListener(BlazeActions.this); menu.add(colorBlazeItem); final JMenuItem removeBlazeItem = new JMenuItem("Remove Blazes"); removeBlazeItem.setIcon(ImageUtilities.loadImageIcon(REMOVE_BLAZE_ICON, false)); removeBlazeItem.setActionCommand(REMOVE_BLAZES_ACTION); removeBlazeItem.addActionListener(BlazeActions.this); menu.add(removeBlazeItem); this.sizeSlider = new SliderMenuItem("Size"); sizeSlider.setValue((NbPreferences.forModule(GraphPreferenceKeys.class) .getInt(GraphPreferenceKeys.BLAZE_SIZE, GraphPreferenceKeys.BLAZE_SIZE_DEFAULT))); menu.add(sizeSlider); this.opacitySlider = new SliderMenuItem("Opacity"); opacitySlider.setValue((NbPreferences.forModule(GraphPreferenceKeys.class) .getInt(GraphPreferenceKeys.BLAZE_OPACITY, GraphPreferenceKeys.BLAZE_OPACITY_DEFAULT))); menu.add(opacitySlider); this.sliderChangeListener = e -> setBlazeProperties(sizeSlider.getValue() / 100f, opacitySlider.getValue() / 100f); sizeSlider.addChangeListener(sliderChangeListener); opacitySlider.addChangeListener(sliderChangeListener); menuBar.add(menu); panel.add(menuBar, BorderLayout.CENTER); GraphManager.getDefault().addGraphManagerListener(BlazeActions.this); }
Example 11
Source File: MetalworksFrame.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 12
Source File: MetalworksFrame.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 13
Source File: MetalworksFrame.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 14
Source File: MetalworksFrame.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 15
Source File: MetalworksFrame.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 16
Source File: MetalworksFrame.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
protected void buildMenus() { menuBar = new JMenuBar(); menuBar.setOpaque(true); JMenu file = buildFileMenu(); JMenu edit = buildEditMenu(); JMenu views = buildViewsMenu(); JMenu speed = buildSpeedMenu(); JMenu help = buildHelpMenu(); // load a theme from a text file MetalTheme myTheme = null; try { InputStream istream = getClass().getResourceAsStream( "/resources/MyTheme.theme"); myTheme = new PropertiesMetalTheme(istream); } catch (NullPointerException e) { System.out.println(e); } // build an array of themes MetalTheme[] themes = { new OceanTheme(), new DefaultMetalTheme(), new GreenMetalTheme(), new AquaMetalTheme(), new KhakiMetalTheme(), new DemoMetalTheme(), new ContrastMetalTheme(), new BigContrastMetalTheme(), myTheme }; // put the themes in a menu JMenu themeMenu = new MetalThemeMenu("Theme", themes); menuBar.add(file); menuBar.add(edit); menuBar.add(views); menuBar.add(themeMenu); menuBar.add(speed); menuBar.add(help); setJMenuBar(menuBar); }
Example 17
Source File: HopActions.java From constellation with Apache License 2.0 | 4 votes |
public HopActions() { panel = new JPanel(); panel.setLayout(new BorderLayout()); menuBar = new JMenuBar(); menuBar.setOpaque(true); menu = new JMenu(); menu.setIcon(HOP_OUT_ONE_ICON); menu.setToolTipText("Hop Controls"); menu.setEnabled(false); final JMenuItem hopOutHalfItem = new JMenuItem("Hop Out Half"); hopOutHalfItem.setIcon(HOP_OUT_HALF_ICON); hopOutHalfItem.setActionCommand(HOP_OUT_HALF_ACTION); hopOutHalfItem.addActionListener(HopActions.this); menu.add(hopOutHalfItem); final JMenuItem hopOutOneItem = new JMenuItem("Hop Out One"); hopOutOneItem.setIcon(HOP_OUT_ONE_ICON); hopOutOneItem.setActionCommand(HOP_OUT_ONE_ACTION); hopOutOneItem.addActionListener(HopActions.this); menu.add(hopOutOneItem); final JMenuItem hopOutFullItem = new JMenuItem("Hop Out Full"); hopOutFullItem.setIcon(HOP_OUT_FULL_ICON); hopOutFullItem.setActionCommand(HOP_OUT_FULL_ACTION); hopOutFullItem.addActionListener(HopActions.this); menu.add(hopOutFullItem); final JPanel directionPanel = new JPanel(); directionPanel.setLayout(new BoxLayout(directionPanel, BoxLayout.Y_AXIS)); directionPanel.setBorder(new TitledBorder("Direction")); outgoing = new JCheckBox("Outgoing", true); outgoing.setToolTipText("Hop Along Outgoing Transactions"); directionPanel.add(outgoing); incoming = new JCheckBox("Incoming", true); incoming.setToolTipText("Hop Along Incoming Transactions"); directionPanel.add(incoming); undirected = new JCheckBox("Undirected", true); undirected.setToolTipText("Hop Along Undirected Transactions"); directionPanel.add(undirected); final JPanel optionsPanel = new JPanel(); optionsPanel.setBorder(new EmptyBorder(10, 0, 0, 0)); optionsPanel.setLayout(new BorderLayout()); optionsPanel.add(directionPanel, BorderLayout.CENTER); menu.add(optionsPanel); menuBar.add(menu); panel.add(menuBar, BorderLayout.CENTER); GraphManager.getDefault().addGraphManagerListener(HopActions.this); }
Example 18
Source File: DimActions.java From constellation with Apache License 2.0 | 4 votes |
public DimActions() { panel = new JPanel(); panel.setLayout(new BorderLayout()); menuBar = new JMenuBar(); menuBar.setOpaque(true); menu = new JMenu(); menu.setIcon(ImageUtilities.loadImageIcon(DIM_ACTIONS_ICON, false)); menu.setToolTipText("Dim Controls"); menu.setEnabled(false); final JMenuItem dimSelectedItem = new JMenuItem("Dim Selected"); dimSelectedItem.setIcon(ImageUtilities.loadImageIcon(DIM_SELECTED_ICON, false)); dimSelectedItem.setActionCommand(DIM_SELECTED_ACTION); dimSelectedItem.addActionListener(DimActions.this); menu.add(dimSelectedItem); final JMenuItem dimUnselectedItem = new JMenuItem("Dim Unselected"); dimUnselectedItem.setIcon(ImageUtilities.loadImageIcon(DIM_UNSELECTED_ICON, false)); dimUnselectedItem.setActionCommand(DIM_UNSELECTED_ACTION); dimUnselectedItem.addActionListener(DimActions.this); menu.add(dimUnselectedItem); final JMenuItem dimAllItem = new JMenuItem("Dim All"); dimAllItem.setIcon(ImageUtilities.loadImageIcon(DIM_ALL_ICON, false)); dimAllItem.setActionCommand(DIM_ALL_ACTION); dimAllItem.addActionListener(DimActions.this); menu.add(dimAllItem); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); final JMenuItem undimSelectedItem = new JMenuItem("Undim Selected"); undimSelectedItem.setIcon(ImageUtilities.loadImageIcon(UNDIM_SELECTED_ICON, false)); undimSelectedItem.setActionCommand(UNDIM_SELECTED_ACTION); undimSelectedItem.addActionListener(DimActions.this); menu.add(undimSelectedItem); final JMenuItem undimUnselectedItem = new JMenuItem("Undim Unselected"); undimUnselectedItem.setIcon(ImageUtilities.loadImageIcon(UNDIM_UNSELECTED_ICON, false)); undimUnselectedItem.setActionCommand(UNDIM_UNSELECTED_ACTION); undimUnselectedItem.addActionListener(DimActions.this); menu.add(undimUnselectedItem); final JMenuItem undimAllItem = new JMenuItem("Undim All"); undimAllItem.setIcon(ImageUtilities.loadImageIcon(UNDIM_ALL_ICON, false)); undimAllItem.setActionCommand(UNDIM_ALL_ACTION); undimAllItem.addActionListener(DimActions.this); menu.add(undimAllItem); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); final JMenuItem selectDimmed = new JMenuItem("Select Dimmed"); selectDimmed.setIcon(ImageUtilities.loadImageIcon(SELECT_DIMMED_ICON, false)); selectDimmed.setActionCommand(SELECT_DIMMED_ACTION); selectDimmed.addActionListener(DimActions.this); menu.add(selectDimmed); final JMenuItem selectUndimmed = new JMenuItem("Select Undimmed"); selectUndimmed.setIcon(ImageUtilities.loadImageIcon(SELECT_UNDIMMED_ICON, false)); selectUndimmed.setActionCommand(SELECT_UNDIMMED_ACTION); selectUndimmed.addActionListener(DimActions.this); menu.add(selectUndimmed); menuBar.add(menu); panel.add(menuBar, BorderLayout.CENTER); GraphManager.getDefault().addGraphManagerListener(DimActions.this); }