Search in sources :

Example 16 with RootPaneContainer

use of javax.swing.RootPaneContainer in project pcgen by PCGen.

the class CursorControlUtilities method stopWaitCursor.

public static void stopWaitCursor(JComponent component) {
    RootPaneContainer root = ((RootPaneContainer) component.getTopLevelAncestor());
    root.getGlassPane().setCursor(DEFAULT_CURSOR);
    root.getGlassPane().removeMouseListener(CLICK_CONSUMER);
    root.getGlassPane().setVisible(false);
    root.getRootPane().validate();
}
Also used : RootPaneContainer(javax.swing.RootPaneContainer)

Example 17 with RootPaneContainer

use of javax.swing.RootPaneContainer in project JWildfire by thargor6.

the class EnvelopeController method clearCrosshairCursor.

private void clearCrosshairCursor() {
    RootPaneContainer root = (RootPaneContainer) envelopePanel.getTopLevelAncestor();
    root.getGlassPane().setCursor(DEFAULT_CURSOR);
    root.getGlassPane().setVisible(false);
}
Also used : RootPaneContainer(javax.swing.RootPaneContainer)

Example 18 with RootPaneContainer

use of javax.swing.RootPaneContainer in project freeplane by freeplane.

the class NoteDialogStarter method editNoteInDialog.

void editNoteInDialog(final NodeModel nodeModel) {
    final Controller controller = Controller.getCurrentController();
    stopEditing();
    Controller.getCurrentModeController().setBlocked(true);
    String text = NoteModel.getNoteText(nodeModel);
    if (text == null) {
        text = "";
    }
    final EditNodeBase.IEditControl editControl = new EditNodeBase.IEditControl() {

        public void cancel() {
            Controller.getCurrentModeController().setBlocked(false);
            mCurrentEditDialog = null;
        }

        public void ok(final String newText) {
            setHtmlText(nodeModel, newText);
            cancel();
        }

        public void split(final String newText, final int position) {
        }

        public boolean canSplit() {
            return false;
        }

        public EditedComponent getEditType() {
            return EditedComponent.NOTE;
        }
    };
    final IEditBaseCreator textFieldCreator = (IEditBaseCreator) Controller.getCurrentController().getMapViewManager();
    mCurrentEditDialog = textFieldCreator.createEditor(nodeModel, editControl, text, true);
    final RootPaneContainer frame = (RootPaneContainer) SwingUtilities.getWindowAncestor(controller.getMapViewManager().getMapViewComponent());
    mCurrentEditDialog.show(frame);
}
Also used : EditNodeBase(org.freeplane.features.text.mindmapmode.EditNodeBase) IEditBaseCreator(org.freeplane.features.text.mindmapmode.IEditBaseCreator) RootPaneContainer(javax.swing.RootPaneContainer) Controller(org.freeplane.features.mode.Controller)

Example 19 with RootPaneContainer

use of javax.swing.RootPaneContainer in project freeplane by freeplane.

the class MTextController method editDetails.

public void editDetails(final NodeModel nodeModel, InputEvent e, final boolean editLong) {
    final Controller controller = Controller.getCurrentController();
    stopEditing();
    Controller.getCurrentModeController().setBlocked(true);
    String text = DetailTextModel.getDetailTextText(nodeModel);
    final boolean isNewNode = text == null;
    if (isNewNode) {
        final MTextController textController = MTextController.getController();
        textController.setDetails(nodeModel, "<html>");
        text = "";
    }
    final EditNodeBase.IEditControl editControl = new EditNodeBase.IEditControl() {

        @Override
        public void cancel() {
            if (isNewNode) {
                final String detailText = DetailTextModel.getDetailTextText(nodeModel);
                final MModeController modeController = (MModeController) Controller.getCurrentModeController();
                if (detailText != null)
                    modeController.undo();
                modeController.resetRedo();
            }
            stop();
        }

        @Override
        public void ok(final String newText) {
            if (HtmlUtils.isEmpty(newText))
                if (isNewNode) {
                    final MModeController modeController = (MModeController) Controller.getCurrentModeController();
                    modeController.undo();
                    modeController.resetRedo();
                } else {
                    keepNodePosition();
                    setDetailsHtmlText(nodeModel, null);
                }
            else {
                keepNodePosition();
                setDetailsHtmlText(nodeModel, newText);
            }
            stop();
        }

        private void keepNodePosition() {
            Controller.getCurrentController().getSelection().keepNodePosition(nodeModel, 0, 0);
        }

        @Override
        public void split(final String newText, final int position) {
        }

        private void stop() {
            Controller.getCurrentModeController().setBlocked(false);
            mCurrentEditor = null;
        }

        @Override
        public boolean canSplit() {
            return false;
        }

        @Override
        public EditedComponent getEditType() {
            return EditedComponent.DETAIL;
        }
    };
    mCurrentEditor = createEditor(nodeModel, editControl, text, false, editLong, true);
    final RootPaneContainer frame = (RootPaneContainer) SwingUtilities.getWindowAncestor(controller.getMapViewManager().getMapViewComponent());
    mCurrentEditor.show(frame);
}
Also used : RootPaneContainer(javax.swing.RootPaneContainer) MMapController(org.freeplane.features.map.mindmapmode.MMapController) MapController(org.freeplane.features.map.MapController) MIconController(org.freeplane.features.icon.mindmapmode.MIconController) IconController(org.freeplane.features.icon.IconController) Controller(org.freeplane.features.mode.Controller) TextController(org.freeplane.features.text.TextController) MLinkController(org.freeplane.features.link.mindmapmode.MLinkController) NodeStyleController(org.freeplane.features.nodestyle.NodeStyleController) FormatController(org.freeplane.features.format.FormatController) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) ResourceController(org.freeplane.core.resources.ResourceController) ViewController(org.freeplane.features.ui.ViewController) LinkController(org.freeplane.features.link.LinkController) ModeController(org.freeplane.features.mode.ModeController) MNodeStyleController(org.freeplane.features.nodestyle.mindmapmode.MNodeStyleController) MModeController(org.freeplane.features.mode.mindmapmode.MModeController) ScannerController(org.freeplane.features.format.ScannerController) IEditControl(org.freeplane.features.text.mindmapmode.EditNodeBase.IEditControl) IEditControl(org.freeplane.features.text.mindmapmode.EditNodeBase.IEditControl) MModeController(org.freeplane.features.mode.mindmapmode.MModeController)

Example 20 with RootPaneContainer

use of javax.swing.RootPaneContainer in project freeplane by freeplane.

the class FilterConditionEditor method setSearchingDefaultCursor.

public void setSearchingDefaultCursor() {
    RootPaneContainer root = (RootPaneContainer) getTopLevelAncestor();
    root.getGlassPane().setCursor(Cursor.getDefaultCursor());
    root.getGlassPane().setVisible(false);
}
Also used : RootPaneContainer(javax.swing.RootPaneContainer)

Aggregations

RootPaneContainer (javax.swing.RootPaneContainer)25 Component (java.awt.Component)5 Window (java.awt.Window)5 Controller (org.freeplane.features.mode.Controller)4 JComponent (javax.swing.JComponent)3 ResourceController (org.freeplane.core.resources.ResourceController)3 IconController (org.freeplane.features.icon.IconController)3 MIconController (org.freeplane.features.icon.mindmapmode.MIconController)3 LinkController (org.freeplane.features.link.LinkController)3 MLinkController (org.freeplane.features.link.mindmapmode.MLinkController)3 MapController (org.freeplane.features.map.MapController)3 MMapController (org.freeplane.features.map.mindmapmode.MMapController)3 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)3 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)3 MNodeStyleController (org.freeplane.features.nodestyle.mindmapmode.MNodeStyleController)3 LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)3 ViewController (org.freeplane.features.ui.ViewController)3 Container (java.awt.Container)2 Cursor (java.awt.Cursor)2 ImageIcon (javax.swing.ImageIcon)2