Package net.sf.graphiti.model

Examples of net.sf.graphiti.model.Graph


   */
  private List<String> getPorts(IFile sourceFile, String[] portTypes) {
    // refinement graph
    GenericGraphParser parser = new GenericGraphParser(GraphitiModelPlugin
        .getDefault().getConfigurations());
    Graph graph = null;
    try {
      graph = parser.parse(sourceFile);
    } catch (IncompatibleConfigurationFile e) {
      System.out.println(e.getMessage());
    }

    // get ports from graph
    if (graph == null) {
      return new ArrayList<String>();
    } else {
      Set<Vertex> vertices = graph.vertexSet();
      List<String> ports = new ArrayList<String>();
      for (Vertex vertex : vertices) {
        // check the vertex type against all accepted port types.
        for (String portType : portTypes) {
          if (vertex.getType().getName().equals(portType)) {
View Full Code Here


      if (obj instanceof VertexEditPart) {
        VertexEditPart part = (VertexEditPart) obj;
        Vertex vertex = (Vertex) part.getModel();

        // remove from parent
        Graph parent = vertex.getParent();
        parent.removeVertex(vertex);

        // copy and add to cut list
        vertex = new Vertex(vertex);
        vertices.add(vertex);
View Full Code Here

    Iterator<Graph> it = parents.iterator();
    for (Object obj : list) {
      if (obj instanceof VertexEditPart) {
        VertexEditPart part = (VertexEditPart) obj;
        Vertex vertex = (Vertex) part.getModel();
        Graph parent = it.next();
        parent.addVertex(vertex);

        // update bounds
        Rectangle bounds = (Rectangle) vertex
            .getValue(Vertex.PROPERTY_SIZE);
        vertex.firePropertyChange(Vertex.PROPERTY_SIZE, null, bounds);
View Full Code Here

TOP

Related Classes of net.sf.graphiti.model.Graph

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.