use of javax.swing.JRootPane in project freeplane by freeplane.
the class MModeControllerFactory method createStandardControllers.
private void createStandardControllers() {
final Controller controller = Controller.getCurrentController();
modeController = new MModeController(controller);
final UserInputListenerFactory userInputListenerFactory = new UserInputListenerFactory(modeController);
final IMouseListener nodeMouseMotionListener = new MNodeMotionListener();
userInputListenerFactory.setNodeMouseMotionListener(nodeMouseMotionListener);
userInputListenerFactory.setNodeMouseWheelListener(new MNodeMouseWheelListener(userInputListenerFactory.getMapMouseWheelListener()));
final JPopupMenu popupmenu = new JPopupMenu();
userInputListenerFactory.setNodePopupMenu(popupmenu);
modeController.setUserInputListenerFactory(userInputListenerFactory);
controller.addModeController(modeController);
controller.selectModeForBuild(modeController);
new MMapController(modeController);
final MFileManager fileManager = new MFileManager();
UrlManager.install(fileManager);
MMapIO.install(modeController);
controller.getMapViewManager().addMapViewChangeListener(fileManager);
new MIconController(modeController).install(modeController);
new ProgressFactory().installActions(modeController);
final MapController mapController = modeController.getMapController();
EdgeController.install(new MEdgeController(modeController));
CloudController.install(new MCloudController(modeController));
NoteController.install(new MNoteController(modeController));
userInputListenerFactory.setMapMouseListener(new MMapMouseListener());
final MTextController textController = new MTextController(modeController);
textController.install(modeController);
LinkController.install(new MLinkController(modeController));
NodeStyleController.install(new MNodeStyleController(modeController));
ClipboardController.install(new MClipboardController());
userInputListenerFactory.setNodeDragListener(new MNodeDragListener());
userInputListenerFactory.setNodeDropTargetListener(new MNodeDropListener());
LocationController.install(new MLocationController());
final MLogicalStyleController logicalStyleController = new MLogicalStyleController(modeController);
LogicalStyleController.install(logicalStyleController);
logicalStyleController.initM();
AttributeController.install(new MAttributeController(modeController));
userInputListenerFactory.setNodeKeyListener(new DefaultNodeKeyListener(new IEditHandler() {
public void edit(final KeyEvent e, final FirstAction action, final boolean editLong) {
((MTextController) MTextController.getController(modeController)).getEventQueue().activate(e);
textController.edit(action, editLong);
}
}));
userInputListenerFactory.setNodeMotionListener(new MNodeMotionListener());
modeController.addAction(new EditAttributesAction());
SpellCheckerController.install(modeController);
ExportController.install(new ExportController("/xml/ExportWithXSLT.xml"));
MapStyle.install(true);
final FreeplaneToolBar toolbar = new FreeplaneToolBar("main_toolbar", SwingConstants.HORIZONTAL);
final FrameController frameController = (FrameController) controller.getViewController();
UIComponentVisibilityDispatcher.install(frameController, toolbar, "toolbarVisible");
userInputListenerFactory.addToolBar("/main_toolbar", ViewController.TOP, toolbar);
userInputListenerFactory.addToolBar("/filter_toolbar", FilterController.TOOLBAR_SIDE, FilterController.getController(controller).getFilterToolbar());
userInputListenerFactory.addToolBar("/status", ViewController.BOTTOM, frameController.getStatusBar());
final JTabbedPane formattingPanel = new JTabbedPane();
Box resisableTabs = new CollapseableBoxBuilder(frameController).setPropertyNameBase("styleScrollPaneVisible").createBox(formattingPanel, Direction.RIGHT);
userInputListenerFactory.addToolBar("/format", ViewController.RIGHT, resisableTabs);
final JRootPane rootPane = ((RootPaneContainer) frameController.getMenuComponent()).getRootPane();
final FButtonBar fButtonToolBar = new FButtonBar(rootPane);
UIComponentVisibilityDispatcher.install(frameController, fButtonToolBar, "fbarVisible");
fButtonToolBar.setVisible(ResourceController.getResourceController().getBooleanProperty("fbarVisible"));
userInputListenerFactory.addToolBar("/fbuttons", ViewController.TOP, fButtonToolBar);
userInputListenerFactory.setKeyEventProcessor(new IKeyStrokeProcessor() {
@Override
public boolean processKeyBinding(KeyStroke ks, KeyEvent e) {
return ResourceController.getResourceController().getAcceleratorManager().processKeyBinding(ks, e) || fButtonToolBar.processKeyBinding(ks, e);
}
});
controller.addAction(new ToggleToolbarAction("ToggleFBarAction", "/fbuttons"));
SModeControllerFactory.install();
modeController.addAction(new SetAcceleratorOnNextClickAction());
modeController.addAction(new ShowNotesInMapAction());
// userInputListenerFactory.getMenuBuilder().setAcceleratorChangeListener(fButtonToolBar);
ResourceController.getResourceController().getAcceleratorManager().addAcceleratorChangeListener(modeController, fButtonToolBar);
userInputListenerFactory.addToolBar("/icon_toolbar", ViewController.LEFT, ((MIconController) IconController.getController()).getIconToolBarScrollPane());
modeController.addAction(new ToggleToolbarAction("ToggleLeftToolbarAction", "/icon_toolbar"));
new RevisionPlugin();
FoldingController.install(new FoldingController());
uiFactory = new MUIFactory();
mapController.addNodeChangeListener(uiFactory);
mapController.addNodeSelectionListener(uiFactory);
mapController.addMapChangeListener(uiFactory);
controller.getMapViewManager().addMapSelectionListener(uiFactory);
modeController.addExtension(MUIFactory.class, uiFactory);
modeController.addUiBuilder(Phase.ACTIONS, "main_toolbar_font_name", new ComponentBuilder(new ComponentProvider() {
@Override
public Component createComponent(Entry entry) {
final Container fontBox = uiFactory.createFontBox();
return fontBox;
}
}), EntryVisitor.EMTPY);
modeController.addUiBuilder(Phase.ACTIONS, "main_toolbar_font_size", new ComponentBuilder(new ComponentProvider() {
@Override
public Component createComponent(Entry entry) {
return uiFactory.createSizeBox();
}
}), EntryVisitor.EMTPY);
modeController.addUiBuilder(Phase.ACTIONS, "main_toolbar_style", new ComponentBuilder(new ComponentProvider() {
@Override
public Component createComponent(Entry entry) {
return uiFactory.createStyleBox();
}
}), EntryVisitor.EMTPY);
modeController.addUiBuilder(Phase.UI, "main_toolbar_zoom", new JToolbarComponentBuilder(new ComponentProvider() {
@Override
public Component createComponent(Entry entry) {
return controller.getMapViewManager().createZoomBox();
}
}));
// IconController.getController(modeController).addStateIconProvider(new IStateIconProvider() {
// public UIIcon getStateIcon(NodeModel node) {
// final URI link = NodeLinks.getLink(node);
// return wrapIcon(LinkController.getLinkIcon(link, node));
// }
//
// private UIIcon wrapIcon(final Icon linkIcon) {
// UIIcon icon = null;
// if(linkIcon != null) {
// if(linkIcon instanceof UIIcon) {
// icon = (UIIcon) linkIcon;
// }
// else {
// icon = new UIIcon("ownIcon", null) {
// public Icon getIcon() {
// return linkIcon;
// }
// };
// }
// }
// return icon;
// }
// });
}
use of javax.swing.JRootPane in project com.revolsys.open by revolsys.
the class ProjectFrame method initUi.
@Override
protected void initUi() {
setMinimumSize(new Dimension(600, 500));
final JRootPane rootPane = getRootPane();
addSaveActions(rootPane, this.project);
final BoundingBox defaultBoundingBox = getDefaultBoundingBox();
this.project.setViewBoundingBoxAndGeometryFactory(defaultBoundingBox);
Project.set(this.project);
this.project.setPropertyWeak(PROJECT_FRAME, this);
setConnectionRegistries();
newMapPanel();
this.leftTabs.setMinimumSize(new Dimension(100, 300));
this.leftTabs.setPreferredSize(new Dimension(300, 700));
this.mapPanel.setMinimumSize(new Dimension(300, 300));
this.mapPanel.setPreferredSize(new Dimension(700, 700));
this.leftRightSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.leftTabs, this.mapPanel);
this.leftRightSplit.setBorder(BorderFactory.createEmptyBorder());
this.bottomTabs.setBorder(BorderFactory.createEmptyBorder());
this.bottomTabs.setPreferredSize(new Dimension(700, 200));
final ContainerListener listener = new ContainerAdapter() {
@Override
public void componentRemoved(final ContainerEvent e) {
final Component eventComponent = e.getChild();
if (eventComponent instanceof ProjectFramePanel) {
final ProjectFramePanel panel = (ProjectFramePanel) eventComponent;
panel.setProperty(BOTTOM_TAB, null);
}
}
};
this.bottomTabs.addContainerListener(listener);
this.topBottomSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, this.leftRightSplit, this.bottomTabs);
this.bottomTabs.setMinimumSize(new Dimension(600, 100));
this.topBottomSplit.setResizeWeight(1);
add(this.topBottomSplit, BorderLayout.CENTER);
newTabLeftTableOfContents();
newTabLeftCatalogPanel();
addBottomTabs(this.bottomTabs);
setBounds((Object) null, false);
super.initUi();
}
use of javax.swing.JRootPane in project com.revolsys.open by revolsys.
the class ProjectFrame method close.
@Override
protected void close() {
Property.removeAllListeners(this);
setVisible(false);
super.close();
setRootPane(new JRootPane());
removeAll();
setMenuBar(null);
if (this.project != null) {
this.project.setProperty(PROJECT_FRAME, null);
Project.clearProject(this.project);
}
if (this.bottomTabs != null) {
for (final ContainerListener listener : this.bottomTabs.getContainerListeners()) {
this.bottomTabs.removeContainerListener(listener);
}
}
if (this.catalogTree != null) {
this.catalogTree.setRoot(null);
}
if (this.mapPanel != null) {
this.mapPanel.destroy();
}
if (this.project != null) {
this.project.getRecordStores().remove();
this.project.getFolderConnections().remove();
this.project.getWebServices().remove();
if (Project.get() == this.project) {
Project.set(null);
}
this.project.delete();
}
if (this.tocTree != null) {
this.tocTree.setRoot(null);
}
this.bottomTabs = null;
this.catalogTree = null;
this.leftRightSplit = null;
this.leftTabs = null;
this.mapPanel = null;
this.project = null;
this.tocTree = null;
this.topBottomSplit = null;
final ActionMap actionMap = getRootPane().getActionMap();
actionMap.put(SAVE_PROJECT_KEY, null);
actionMap.put(SAVE_CHANGES_KEY, null);
}
use of javax.swing.JRootPane in project gitblit by gitblit.
the class EditUserDialog method createRootPane.
@Override
protected JRootPane createRootPane() {
KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
JRootPane rootPane = new JRootPane();
rootPane.registerKeyboardAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
}, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
return rootPane;
}
use of javax.swing.JRootPane in project gitblit by gitblit.
the class EditRegistrationDialog method createRootPane.
@Override
protected JRootPane createRootPane() {
KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
JRootPane rootPane = new JRootPane();
rootPane.registerKeyboardAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
}, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
return rootPane;
}
Aggregations