Examples of IdentifiableDiagramElement


Examples of org.kite9.diagram.primitives.IdentifiableDiagramElement

    if (designItem.getDesignItem() instanceof Diagram) {
      DiagramElementVisitor dev = new DiagramElementVisitor();
      dev.visit((Diagram) designItem.getDesignItem(), new VisitorAction() {
        public void visit(DiagramElement de) {
          if (de instanceof IdentifiableDiagramElement) {
            IdentifiableDiagramElement rde = (IdentifiableDiagramElement) de;
            if (rde.getID().startsWith(PROJECT_JAVA_CLASS)) {
              createProjectJavaClassReference(designItem, rde);
            }
          }
        }

        private void createProjectJavaClassReference(final WorkItem designItem, IdentifiableDiagramElement rde) {
          String className = rde.getID().substring(PROJECT_JAVA_CLASS.length());
          int slashIndex = className.indexOf("/");
          if (slashIndex > -1) {
            className = className.substring(0, slashIndex);
          }
          try {
            Class<?> to = getContext().getUserClassLoader().loadClass(className);
            addReferenceToClass(designItem, to);
          } catch (Exception e) {
            getContext().getLogger().error("Could not find class: " + className + " for " + rde.getID());
          }
        }
      });
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.