Package de.fu_berlin.inf.dpp.whiteboard.sxe.records

Examples of de.fu_berlin.inf.dpp.whiteboard.sxe.records.ElementRecord


  public void insertRecord(ElementRecord record) {

    if (subtreeRecords.contains(record) || rootRecords.contains(record)) {
      return;
    } else {
      ElementRecord tmp;
      Collection<ElementRecord> children = record
          .getAllVisibleDescendantElements();

      Iterator<ElementRecord> it = rootRecords.iterator();
      while (it.hasNext()) {
View Full Code Here


  public static DocumentRecord getEmptyDocument(
      ISXERecordFactory recordFactory) {

    SXEController controller = new SXEController(recordFactory);
    DocumentRecord document = recordFactory.createDocument(controller);
    ElementRecord root = recordFactory.createRoot(document);
    root.apply(document);

    return document;
  }
View Full Code Here

  @Override
  public ElementRecord createElementRecord(DocumentRecord documentRecord,
      String ns, String tag) {

    ElementRecord r = null;
    if (tag.equals(SVGConstants.SVG_RECT_TAG)) {
      r = new SVGRectRecord(documentRecord);
    } else if (tag.equals(SVGConstants.SVG_POLYLINE_TAG)) {
      r = new SVGPolylineRecord(documentRecord);
    } else if (tag.equals(SVGConstants.SVG_ELLIPSE_TAG)) {
View Full Code Here

      throw new MalformedRecordException("target rid missing");

    NodeRecord target = document.getRecordById(tmp);
    int version = getInt(RecordEntry.VERSION);

    ElementRecord parent = null;

    tmp = getString(RecordEntry.PARENT);

    if (tmp != null) {
      parent = document.getElementRecordById(tmp);
View Full Code Here

  }

  @Override
  public void execute() {
    if (canExecute()) {
      ElementRecord copy;
      for (ElementRecord er : recordsToCopy.getRootRecords()) {
        copy = er.getCopy(true);
        /*
         * it is undesirable to add anything with the same primary
         * weight to the same parent, thus it is reset.
         */
        copy.setPrimaryWeight(null);
        copiedRecords.add((LayoutElementRecord) copy);
      }
      Clipboard.getDefault().setContents(copiedRecords);
    }
  }
View Full Code Here

    records.add(copy);
    records.addAll(getMergedAttributes(toCopy.getVisibleAttributes(),
        layoutAttributes));

    // add all other sub nodes
    ElementRecord childCopy;
    for (ElementRecord er : toCopy.getVisibleChildElements()) {
      childCopy = er.getCopy();
      childCopy.setParent(copy);
      records.add(childCopy);
      records.addAll(er.getCopiedSubtreeRecords(childCopy));
    }

    return records;
View Full Code Here

  @Override
  public boolean canExecute() {
    if (recordsToCopy == null || recordsToCopy.isEmpty())
      return false;
    Iterator<ElementRecord> it = recordsToCopy.getRootRecords().iterator();
    ElementRecord er;
    while (it.hasNext()) {
      er = it.next();
      if (!isCopyableNode(er))
        return false;
      if (!er.getParent().isPartOfVisibleDocument())
        return false;
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.whiteboard.sxe.records.ElementRecord

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.