Package org.freeplane.features.styles

Examples of org.freeplane.features.styles.MapStyle$XmlWriter


      repaint();
    }
  }

  private void loadBackgroundImage() {
    final MapStyle mapStyle = getModeController().getExtension(MapStyle.class);
    final String uriString = mapStyle.getProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE);
    backgroundComponent = null;
    if (uriString != null) {
      URI uri = assignAbsoluteURI(uriString);
      final ViewerController vc = getModeController().getExtension(ViewerController.class);
      final IViewerFactory factory = vc.getCombiFactory();
View Full Code Here


      selected.repaintSelected();
    }
  }

  private Color requiredBackground() {
    final MapStyle mapStyle = getModeController().getExtension(MapStyle.class);
    final Color mapBackground = mapStyle.getBackground(model);
    return mapBackground;
  }
View Full Code Here

    super("MapBackgroundClearAction");
  }

  public void actionPerformed(final ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final MapStyle mapStyle = controller.getModeController().getExtension(MapStyle.class);
    final MapModel model = controller.getMap();
    mapStyle.setProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE, null);
  }
View Full Code Here

  public void actionPerformed(ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final NodeModel node = controller.getSelection().getSelected();
    final ModeController modeController = controller.getModeController();
    final MapStyle mapStyleController = MapStyle.getController(modeController);
    final MapModel map = node.getMap();
    final String value = mapStyleController.getPropertySetDefault(map, propertyName);
    boolean set = ! Boolean.parseBoolean(value);
    mapStyleController.setProperty(map, propertyName, Boolean.toString(set));
    setSelected(set);
    }
View Full Code Here

  public void setSelected() {
    try {
      final Controller controller = Controller.getCurrentController();
      final NodeModel node = controller.getSelection().getSelected();
      final ModeController modeController = controller.getModeController();
      final MapStyle mapStyleController = MapStyle.getController(modeController);
      final String value = mapStyleController.getPropertySetDefault(node.getMap(), propertyName);
      boolean isSet = Boolean.parseBoolean(value);
      setSelected(isSet);
    }
    catch (Exception e) {
      setSelected(false);
View Full Code Here

  }

    // MapRO: R
    public Color getBackgroundColor() {
        // see MapBackgroundColorAction
        final MapStyle mapStyle = (MapStyle) Controller.getCurrentModeController().getExtension(MapStyle.class);
        final MapStyleModel model = (MapStyleModel) mapStyle.getMapHook();
        if (model != null) {
            return model.getBackgroundColor();
        }
        else {
            final String colorPropertyString = ResourceController.getResourceController().getProperty(
View Full Code Here

    Controller.getCurrentModeController().getMapController().setSaved(getDelegate(), isSaved);
  }

    // Map: R/W
    public void setBackgroundColor(Color color) {
        final MapStyle mapStyle = (MapStyle) Controller.getCurrentModeController().getExtension(MapStyle.class);
        final MapStyleModel model = (MapStyleModel) mapStyle.getMapHook();
        mapStyle.setBackgroundColor(model, color);
    }
View Full Code Here

      return;
    }
    try {
          final URL url = Compat.fileToUrl(file);
      final MapModel map = controller.getMap();
      MapStyle mapStyleController = MapStyle.getController(modeController);
      mapStyleController.copyStyle(url, map, true);
        }
        catch (MalformedURLException e1) {
          e1.printStackTrace();
        }
   
View Full Code Here

    super("MapBackgroundColorAction");
  }

  public void actionPerformed(final ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    MapStyle mapStyle = (MapStyle) controller.getModeController().getExtension(MapStyle.class);
    final MapStyleModel model = (MapStyleModel) mapStyle.getMapHook();
    final Color oldBackgroundColor;
    final String colorPropertyString = ResourceController.getResourceController().getProperty(
        MapStyle.RESOURCES_BACKGROUND_COLOR);
    final Color defaultBgColor = ColorUtils.stringToColor(colorPropertyString);
    if (model != null) {
      oldBackgroundColor = model.getBackgroundColor();
    }
    else {
      oldBackgroundColor = defaultBgColor;
    }
    final Color actionColor = ColorTracker.showCommonJColorChooserDialog(controller.getSelection()
        .getSelected(), TextUtils.getText("choose_map_background_color"), oldBackgroundColor, defaultBgColor);
    mapStyle.setBackgroundColor(model, actionColor);
  }
View Full Code Here

    final ViewerController vc = controller.getModeController().getExtension(ViewerController.class);
    final NodeModel selectedNode = mapController.getSelectedNode();
    if (selectedNode == null) {
      return;
    }
    final MapStyle mapStyle = controller.getModeController().getExtension(MapStyle.class);
    final URI uri = vc.createURI(selectedNode);
    if (uri == null) {
      return;
    }
    final MapModel model = controller.getMap();
    mapStyle.setProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE, uri.toString());
  }
View Full Code Here

TOP

Related Classes of org.freeplane.features.styles.MapStyle$XmlWriter

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.