Exemplo n.º 1
0
 public XmlAction unMarshall(String inputString) {
   try {
     // unmarshall:
     Unmarshaller u = JaxbTools.getInstance().createUnmarshaller();
     StringBuffer xmlStr = new StringBuffer(inputString);
     XmlAction doAction =
         (XmlAction) u.unmarshal(new StreamSource(new StringReader(xmlStr.toString())));
     return doAction;
   } catch (JAXBException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return null;
   }
 }
Exemplo n.º 2
0
 public String marshall(XmlAction action) {
   try {
     // marshall:
     // marshal to StringBuffer:
     StringWriter writer = new StringWriter();
     Marshaller m = JaxbTools.getInstance().createMarshaller();
     m.marshal(action, writer);
     String result = writer.toString();
     return result;
   } catch (JAXBException e) {
     logger.severe(e.toString());
     e.printStackTrace();
     return "";
   }
 }
Exemplo n.º 3
0
  public Controller(FreeMindMain frame) {
    checkJavaVersion();

    this.frame = frame;
    if (logger == null) {
      logger = frame.getLogger(this.getClass().getName());
    }
    // new object factory for xml actions:
    actionXmlFactory = JaxbTools.getInstance().getObjectFactory();

    lastOpened = new LastOpenedList(this, getProperty("lastOpened"));
    mapModuleManager = new MapModuleManager(this, history, lastOpened);

    nodeMouseMotionListener = new NodeMouseMotionListener(this);
    nodeMotionListener = new NodeMotionListener(this);
    nodeKeyListener = new NodeKeyListener(this);
    nodeDragListener = new NodeDragListener(this);
    nodeDropListener = new NodeDropListener(this);

    mapMouseMotionListener = new MapMouseMotionListener(this);
    mapMouseWheelListener = new MapMouseWheelListener(this);

    close = new CloseAction(this);

    print = new PrintAction(this, true);
    printDirect = new PrintAction(this, false);
    page = new PageAction(this);
    quit = new QuitAction(this);
    background = new BackgroundAction(this, bswatch);
    about = new AboutAction(this);
    faq = new OpenFAQAction(this);
    documentation = new DocumentationAction(this);
    license = new LicenseAction(this);
    historyPreviousMap = new HistoryPreviousMapAction(this);
    historyNextMap = new HistoryNextMapAction(this);
    navigationPreviousMap = new NavigationPreviousMapAction(this);
    navigationNextMap = new NavigationNextMapAction(this);
    toggleMenubar = new ToggleMenubarAction(this);
    toggleToolbar = new ToggleToolbarAction(this);
    // ICON AOP
    // toggleLeftToolbar = new ToggleLeftToolbarAction(this);
    optionAntialiasAction = new OptionAntialiasAction(this);
    optionHTMLExportFoldingAction = new OptionHTMLExportFoldingAction(this);
    optionSelectionMechanismAction = new OptionSelectionMechanismAction(this);

    zoomIn = new ZoomInAction(this);
    zoomOut = new ZoomOutAction(this);
    propertyAction = new PropertyAction(this);

    moveToRoot = new MoveToRootAction(this);

    // Create the ToolBar
    toolbar = new MainToolBar(this);
    getFrame().getContentPane().add(toolbar, BorderLayout.NORTH);

    setAllActions(false);

    if (!Tools.isAvailableFontFamily(getProperty("standardfont"))) {
      System.out.println(
          "Warning: the font you have set as standard - "
              + getProperty("standardfont")
              + " - is not available.");
      frame.setProperty("standardfont", "SansSerif");
    }
  }