private ApplicationMain(EntryPoint impl) { configureLookAndFeel(); _impl = impl; _singleton = this; _masterView = new MasterView(this); _helpView = new HelpView(); _editorContainer = new JAttributeEditorContainer() { private JAttributeEditor currentEditor = null; public void displayEditor(JNode node, final JAttributeEditor editor) { if (currentEditor != null) { _impl.remove(currentEditor); } _impl.add(editor, BorderLayout.EAST); _impl.validate(); currentEditor = editor; } public void hideEditor() { if (currentEditor != null) { _impl.remove(currentEditor); _impl.validate(); currentEditor = null; } } }; initApplicationMenuBar(); _impl.add(_masterView, BorderLayout.CENTER); _masterView.addDefaultPane(); }
private void initApplicationMenuBar() { JMenu fileMenu = _masterView.createApplicationFileMenu(); JMenu helpMenu = _helpView.createApplicationHelpMenu(); JMenu diaoptMenu = _masterView.createApplicationDiagramOptionsMenu(); if (_impl.isTerminatable()) { AbstractAction action = new AbstractAction("Exit") { public void actionPerformed(ActionEvent e) { applicationStop(); } }; fileMenu.add(new JMenuItem(action)); } JMenuBar result = new JMenuBar(); result.add(fileMenu); result.add(diaoptMenu); result.add(Box.createHorizontalGlue()); result.add(helpMenu); _impl.setJMenuBar(result); }