Package org.eclipse.draw2d.graph

Examples of org.eclipse.draw2d.graph.DirectedGraph


    }

    private void execute() {
        editor.doSave(null);
        Map<Long, Node> mapping = new HashMap<Long, Node>();
        DirectedGraph graph = createDirectedGraph(mapping);
        DirectedGraphLayout layout = new DirectedGraphLayout();
        layout.visit(graph);
        for (Map.Entry<Long, Node> entry: mapping.entrySet()) {
            Node node = entry.getValue();
            DefaultElementWrapper elementWrapper = (DefaultElementWrapper)
View Full Code Here


        // TODO: implement changes as a command, so we can support undo
        editor.doSave(null);
    }
   
    protected DirectedGraph createDirectedGraph(Map<Long, Node> mapping) {
        DirectedGraph graph = new DirectedGraph();
        WorkflowProcess process = (WorkflowProcess) ((ProcessWrapper) ((GenericModelEditor) editor).getModel()).getProcess();
        for (org.kie.api.definition.process.Node processNode: process.getNodes()) {
            Node node = new Node();
            Integer width = (Integer) processNode.getMetaData().get("width");
            Integer height = (Integer) processNode.getMetaData().get("height");
View Full Code Here

    layout(diagramEditor, false);
  }

  public void layout(final SapphireDiagramEditor diagramEditor, boolean autoLayout)
  {
    final DirectedGraph graph = mapDiagramToGraph(diagramEditor);
    graph.setDefaultPadding(new Insets(PADDING));
    new NodeJoiningDirectedGraphLayout().visit(graph);
    mapGraphCoordinatesToDiagram(graph, diagramEditor, autoLayout);   
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  private DirectedGraph mapDiagramToGraph(final SapphireDiagramEditor diagramEditor)
  {
    DiagramModel diagramModel = diagramEditor.getDiagramModel();
    Map<DiagramNodeModel, Node> shapeToNode = new HashMap<DiagramNodeModel, Node>();
    DirectedGraph dg = new DirectedGraph();
    dg.setDirection(getGraphDirection());
    EdgeList edgeList = new EdgeList();
    NodeList nodeList = new NodeList();
    List<DiagramNodeModel> children = diagramModel.getNodes();
    for (DiagramNodeModel child : children)
    {
View Full Code Here

  }

  @Override
  protected void applyLayoutInternal(InternalNode[] entitiesToLayout, InternalRelationship[] relationshipsToConsider, double boundsX, double boundsY, double boundsWidth, double boundsHeight) {
    HashMap mapping = new HashMap(entitiesToLayout.length);
    DirectedGraph graph = new DirectedGraph();
   
    graph.setDirection(PositionConstants.SOUTH);
    graph.setMargin(new Insets(20, 60, 20, 60));
    graph.setDefaultPadding(new Insets(30, 50, 30, 50));
   
    for (int i = 0; i < entitiesToLayout.length; i++) {
      InternalNode internalNode = entitiesToLayout[i];
      Node node = new Node(internalNode);
      node.setSize(new Dimension(10, 10));
View Full Code Here

  private String elementId;

  private String contextId;

  public Graph() {
    graph = new DirectedGraph();
  }
View Full Code Here

    createBeansMap();
    createReferences();
    extendGraphContent();

    graph = new DirectedGraph();

    for (Bean bean : beans.values()) {
      graph.nodes.add(bean);
    }
View Full Code Here

      // If an error occured during layouting (graph contains cylces,
      // graph not fully connected, ...) then clear graph, invalidate
      // editor input (not saved when Eclipse is closed) and display an
      // error message
      graph = new DirectedGraph();
      input.setHasError(true);
      MessageDialog.openError(BeansGraphPlugin.getActiveWorkbenchWindow().getShell(),
          BeansGraphPlugin.getResourceString(ERROR_TITLE), e.getMessage());

    }
View Full Code Here

      double boundsX, double boundsY, double boundsWidth, double boundsHeight) {
    HashMap mapping = new HashMap(entitiesToLayout.length);
    // Difference from DGLA; use the unmodified Draw2D DirectedGraph since
    // the extended one from the superclass does not handle the horizontal
    // use case properly.
    DirectedGraph graph = new DirectedGraph();
    for (InternalNode internalNode : entitiesToLayout) {
      Node node = new Node(internalNode);
      // Difference from DGLA; get the height/width from the InternalNode
      // and apply it to the Draw2D Node. Take orientation into account.
      int height = new Double(internalNode.getHeightInLayout()).intValue();
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.graph.DirectedGraph

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.