Package org.freeplane.features.styles.mindmapmode

Examples of org.freeplane.features.styles.mindmapmode.SetBooleanMapPropertyAction


    modeController.addAction(new SetNoteWindowPosition("top"));
    modeController.addAction(new SetNoteWindowPosition( "left"));
    modeController.addAction(new SetNoteWindowPosition("right"));
    modeController.addAction(new SetNoteWindowPosition("bottom"));
    modeController.addAction(new RemoveNoteAction(this));
    modeController.addAction(new SetBooleanMapPropertyAction(SHOW_NOTE_ICONS));
    }
View Full Code Here


    modeController.addAction(new AssignAttributesAction());
    modeController.addAction(new ShowAttributeDialogAction());
    modeController.addAction(new CopyAttributes());
    modeController.addAction(new PasteAttributes());
    modeController.addAction(new AddStyleAttributes());
    modeController.addAction(new SetBooleanMapPropertyAction(SHOW_ICON_FOR_ATTRIBUTES));
  }
View Full Code Here

            final JCommandToggleMenuButton showNotedsInMapButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showNotesInMapAction);
            showNotesInMapAction.setSelected();
            showNotedsInMapButton.getActionModel().setSelected(showNotesInMapAction.isSelected());
              popupmenu.addMenuButton(showNotedsInMapButton);
             
            final SetBooleanMapPropertyAction showIconAction = (SetBooleanMapPropertyAction) context.getBuilder().getMode().getAction("SetBooleanMapPropertyAction.show_note_icons");
              final JCommandToggleMenuButton toggleButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showIconAction);
              showIconAction.setSelected();
              toggleButton.getActionModel().setSelected(showIconAction.isSelected());
              popupmenu.addMenuButton(toggleButton);
             
              JCommandMenuButton button = new JCommandMenuButton(TextUtils.removeTranslateComment(TextUtils.getText("note_window_location")), null);
              button.setDisplayState(CommandButtonDisplayState.MEDIUM);
              button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
              button.setPopupCallback(new PopupPanelCallback() {
                public JPopupPanel getPopupPanel(JCommandButton commandButton) {
                  JCommandPopupMenu popupmenu = new JCommandPopupMenu();
               
                  final SetNoteWindowPosition posTopAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.top");
                  final JCommandToggleMenuButton posTopButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posTopAction);             
                  popupmenu.addMenuButton(posTopButton);
                  posTopAction.setSelected();
                  posTopButton.getActionModel().setSelected(posTopAction.isSelected());
                 
                  final SetNoteWindowPosition posLeftAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.left");
                  final JCommandToggleMenuButton posLeftButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posLeftAction);             
                  popupmenu.addMenuButton(posLeftButton);
                  posLeftAction.setSelected();
                  posLeftButton.getActionModel().setSelected(posLeftAction.isSelected());
                 
                  final SetNoteWindowPosition posRightAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.right");
                  final JCommandToggleMenuButton posRightButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posRightAction);             
                  popupmenu.addMenuButton(posRightButton);
                  posRightAction.setSelected();
                  posRightButton.getActionModel().setSelected(posRightAction.isSelected());
                 
                  final SetNoteWindowPosition posBottomAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.bottom");
                  final JCommandToggleMenuButton posBottomButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posBottomAction);             
                  popupmenu.addMenuButton(posBottomButton);
                  posBottomAction.setSelected();
                  posBottomButton.getActionModel().setSelected(posBottomAction.isSelected());
                 
                  return popupmenu;
                }
              });             
              popupmenu.addMenuButton(button);
             
            return popupmenu;
          }
        });
        band.addCommandButton(displayNotesButton, RibbonElementPriority.MEDIUM);
      }

      private void createAttributeViewMenu(final RibbonBuildContext context, JRibbonBand band) {
        JCommandButton button = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("menu_displayAttributes")));
        button.setDisplayState(CommandButtonDisplayState.MEDIUM);
        button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        button.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
           
            final AttributeViewTypeAction showSelectedAttributesAction = (AttributeViewTypeAction) context.getBuilder().getMode().getAction("ShowSelectedAttributesAction");
            final JCommandToggleMenuButton showSelectedAttributesButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showSelectedAttributesAction);             
            popupmenu.addMenuButton(showSelectedAttributesButton);
            showSelectedAttributesAction.setSelected();
            showSelectedAttributesButton.getActionModel().setSelected(showSelectedAttributesAction.isSelected());
           
            final AttributeViewTypeAction showAllAttributesAction = (AttributeViewTypeAction) context.getBuilder().getMode().getAction("ShowAllAttributesAction");
            final JCommandToggleMenuButton showAllAttributesButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showAllAttributesAction);           
            popupmenu.addMenuButton(showAllAttributesButton);
            showAllAttributesAction.setSelected();
            showAllAttributesButton.getActionModel().setSelected(showAllAttributesAction.isSelected());
           
            final AttributeViewTypeAction hideAllAttributesAction = (AttributeViewTypeAction) context.getBuilder().getMode().getAction("HideAllAttributesAction");           
            final JCommandToggleMenuButton hideAllAttributesButton = RibbonActionContributorFactory.createCommandToggleMenuButton(hideAllAttributesAction);           
            popupmenu.addMenuButton(hideAllAttributesButton);
            hideAllAttributesAction.setSelected();
            hideAllAttributesButton.getActionModel().setSelected(hideAllAttributesAction.isSelected());
                       
              final SetBooleanMapPropertyAction showIconAction = (SetBooleanMapPropertyAction) context.getBuilder().getMode().getAction("SetBooleanMapPropertyAction.show_icon_for_attributes");
              final JCommandToggleMenuButton toggleButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showIconAction);
              showIconAction.setSelected();
              toggleButton.getActionModel().setSelected(showIconAction.isSelected());
              popupmenu.addMenuButton(toggleButton);
           
            context.getBuilder().getMapChangeAdapter().addListener(new IChangeObserver() {             
              public void updateState(CurrentState state) {
                showSelectedAttributesAction.setSelected();
                showSelectedAttributesButton.getActionModel().setSelected(showSelectedAttributesAction.isSelected());
                showAllAttributesAction.setSelected();
                showAllAttributesButton.getActionModel().setSelected(showAllAttributesAction.isSelected());
                hideAllAttributesAction.setSelected();
                hideAllAttributesButton.getActionModel().setSelected(hideAllAttributesAction.isSelected());
                showIconAction.setSelected();
                toggleButton.getActionModel().setSelected(showIconAction.isSelected());
              }
            });
           
            JCommandMenuButton button = RibbonActionContributorFactory.createCommandMenuButton(context.getBuilder().getMode().getAction("ShowAttributeDialogAction"));
            popupmenu.addMenuButton(button);
View Full Code Here

TOP

Related Classes of org.freeplane.features.styles.mindmapmode.SetBooleanMapPropertyAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.