Package com.eteks.sweethome3d.swing

Examples of com.eteks.sweethome3d.swing.ControllerAction


  private void createActions(EditorController controller,
                             UserPreferences preferences) {
    ActionMap actionMap = getActionMap();
    try {
      actionMap.put(ActionType.NEW_LIBRARY, new ControllerAction(
          preferences, EditorPane.class, ActionType.NEW_LIBRARY.name(), true,
          controller, "newLibrary"));
      actionMap.put(ActionType.OPEN, new ControllerAction(
          preferences, EditorPane.class, ActionType.OPEN.name(), true,
          controller, "open"));
      actionMap.put(ActionType.SAVE, new ControllerAction(
          preferences, EditorPane.class, ActionType.SAVE.name(), true,
          controller, "save"));
      actionMap.put(ActionType.SAVE_AS, new ControllerAction(
          preferences, EditorPane.class, ActionType.SAVE_AS.name(), true,
          controller, "saveAs"));
      actionMap.put(ActionType.PREFERENCES, new ControllerAction(
          preferences, EditorPane.class, ActionType.PREFERENCES.name(), true,
          controller, "editPreferences"));
      actionMap.put(ActionType.EXIT, new ControllerAction(
          preferences, EditorPane.class, ActionType.EXIT.name(), true,
          controller, "exit"));
      FurnitureLibraryController furnitureLibraryController = controller.getFurnitureLibraryController();
      actionMap.put(ActionType.IMPORT_FURNITURE, new ControllerAction(
          preferences, EditorPane.class, ActionType.IMPORT_FURNITURE.name(), true,
          furnitureLibraryController, "importFurniture"));
      boolean selectionEmpty = furnitureLibraryController.getSelectedFurniture().isEmpty();
      actionMap.put(ActionType.MODIFY_FURNITURE, new ControllerAction(
          preferences, EditorPane.class, ActionType.MODIFY_FURNITURE.name(), !selectionEmpty,
          furnitureLibraryController, "modifySelectedFurniture"));
      actionMap.put(ActionType.DELETE, new ControllerAction(
          preferences, EditorPane.class, ActionType.DELETE.name(), !selectionEmpty,
          furnitureLibraryController, "deleteSelectedFurniture"));
      actionMap.put(ActionType.SELECT_ALL, new ControllerAction(
          preferences, EditorPane.class, ActionType.SELECT_ALL.name(), true,
          furnitureLibraryController, "selectAll"));
      actionMap.put(ActionType.ABOUT, new ControllerAction(
          preferences, EditorPane.class, ActionType.ABOUT.name(), true,
          controller, "about"));
    } catch (NoSuchMethodException ex) {
      throw new IllegalArgumentException(ex);
    }
View Full Code Here


    }
   
    if (getAppletBooleanParameter(this.applet, ENABLE_EXPORT_TO_SH3D)) {
      try {
        // Add export to SH3D action
        Action exportToSH3DAction = new ControllerAction(getUserPreferences(),
            AppletApplication.class, "EXPORT_TO_SH3D", controller, "exportToSH3D");
        exportToSH3DAction.setEnabled(true);
        toolBar.add(new ResourceAction.ToolBarAction(exportToSH3DAction));
      } catch (NoSuchMethodException ex) {
        ex.printStackTrace();
      }
    }
View Full Code Here

TOP

Related Classes of com.eteks.sweethome3d.swing.ControllerAction

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.