예제 #1
0
  /**
   * Reads the location of the views of all known <code>Note</code>s.
   *
   * @param element the xml-element to read from
   */
  public void readXML(XElement element) {
    PropertyTransformer transformer = new PropertyTransformer();

    for (XElement xnote : element.getElements("note")) {
      Note note = model.getNote(xnote.getString("id"));
      DockStation station = manager.getStation(xnote.getString("station"));
      DockableProperty property = transformer.readXML(xnote);
      if (note != null) {
        locations.put(note, new Tuple<DockStation, DockableProperty>(station, property));
      }
    }
  }
  public <B> void read(XElement element, ModeSettingsConverter<Location, B> converter) {
    lastMaximizedLocation = new HashMap<String, Location>();
    lastMaximizedMode = new HashMap<String, Path>();

    XElement xmaximized = element.getElement("maximized");

    if (xmaximized != null) {
      for (XElement xitem : xmaximized.getElements("item")) {
        String key = xitem.getString("id");

        XElement xmode = xitem.getElement("mode");
        if (xmode != null) {
          lastMaximizedMode.put(key, new Path(xmode.getString()));
        }

        XElement xlocation = xitem.getElement("location");
        if (xlocation != null) {
          lastMaximizedLocation.put(
              key, converter.convertToWorld(converter.readPropertyXML(xlocation)));
        }
      }
    }
  }