Package net.sf.graphiti.model

Examples of net.sf.graphiti.model.ObjectType


   */
  private void updateSelection(IGraphTypeSettable page) {
    int index = listGraphTypes.getSelectionIndex();
    String graphType = listGraphTypes.getItem(index);

    ObjectType type = graphTypeNames.get(graphType);
    Configuration configuration = graphTypeConfigurations.get(type);
    page.setGraphType(configuration, type);
  }
View Full Code Here


   *            A {@link Graph}.
   */
  public void setGraph(Graph graph) {
    this.graph = graph;
    Configuration configuration = graph.getConfiguration();
    ObjectType type = graph.getType();
    String fileExt = configuration.getFileFormat().getFileExtension();
    setFileExtension(fileExt);
    if (fileName == null) {
      setFileName("New " + type.getName() + "." + fileExt);
    } else {
      setFileName(fileName + "." + fileExt);
    }
  }
View Full Code Here

    while (child != null) {
      if (child.getNodeName().equals("edge")) {
        Element element = (Element) child;

        String typeName = element.getAttribute("type");
        ObjectType type = configuration.getEdgeType(typeName);

        String sourceId = element.getAttribute("source");
        Vertex source = graph.findVertex(sourceId);

        String targetId = element.getAttribute("target");
View Full Code Here

   *             If <code>element</code> cannot be parsed.
   */
  private Graph parseGraph(Configuration configuration, Element element)
      throws TransformedDocumentParseError {
    String typeName = element.getAttribute("type");
    ObjectType type = configuration.getGraphType(typeName);
    Graph graph = new Graph(configuration, type, true);

    // parse different sections
    Node node = element.getFirstChild();
    node = parseParameters(graph, type, node);
View Full Code Here

    node = DomHelper.getFirstSiblingNamed(node, "vertices");
    Node child = node.getFirstChild();
    while (child != null) {
      if (child.getNodeName().equals("vertex")) {
        String typeName = ((Element) child).getAttribute("type");
        ObjectType type = configuration.getVertexType(typeName);
        Vertex vertex = new Vertex(type);

        // set layout information if present
        String xAttr = ((Element) child).getAttribute("x");
        String yAttr = ((Element) child).getAttribute("y");
View Full Code Here

  private Map<String, ObjectType> parseTypes(IConfigurationElement[] children) {
    Map<String, ObjectType> types = new TreeMap<String, ObjectType>();

    for (IConfigurationElement element : children) {
      String typeName = element.getAttribute("name");
      ObjectType type = new ObjectType(typeName);

      String isDirected = element.getAttribute("directed");
      if (isDirected != null) {
        boolean value = Boolean.parseBoolean(isDirected);
        type.addAttribute(ObjectType.ATTRIBUTE_DIRECTED, value);
      }
      types.put(typeName, type);
      parseType(type, element.getChildren());
    }
View Full Code Here

  private void convertEdgeTypes(Graph graph,
      Map<ObjectType, ObjectType> edgeTypes) {
    Set<Edge> edges = originalGraph.edgeSet();
    for (Edge edge : edges) {
      ObjectType newType = edgeTypes.get(edge.getType());
      if (newType != null) {
        edge = new Edge(edge);
        String sourceId = (String) edge.getSource().getValue(
            ObjectType.PARAMETER_ID);
        String targetId = (String) edge.getTarget().getValue(
View Full Code Here

  private void convertVertexTypes(Graph graph,
      Map<ObjectType, ObjectType> vertexTypes) {
    Set<Vertex> vertices = originalGraph.vertexSet();
    for (Vertex vertex : vertices) {
      ObjectType newType = vertexTypes.get(vertex.getType());
      if (newType != null) {
        vertex = new Vertex(vertex);
        vertex.setType(newType);
        graph.addVertex(vertex);
      }
View Full Code Here

      Combo combo = edgeComboList.get(i);
      i++;
      int index = combo.getSelectionIndex();
      if (index != -1) {
        String name = combo.getItem(index);
        ObjectType newType = newConfiguration.getEdgeType(name);
        edgeTypes.put(type, newType);
      }
    }

    return edgeTypes;
View Full Code Here

      Combo combo = vertexComboList.get(i);
      i++;
      int index = combo.getSelectionIndex();
      if (index != -1) {
        String name = combo.getItem(index);
        ObjectType newType = newConfiguration.getVertexType(name);
        vertexTypes.put(type, newType);
      }
    }

    return vertexTypes;
View Full Code Here

TOP

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

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.