Package org.eclipse.zest.layouts

Examples of org.eclipse.zest.layouts.LayoutAlgorithm


    lblProgress = new Label(mainShell, SWT.NONE);
    lblProgress.setLayoutData(progressGridData);
    lblProgress.setText("Progress: ");

    for (int i = 0; i < algorithms.size(); i++) {
      final LayoutAlgorithm algorithm = (LayoutAlgorithm) algorithms.get(i);
      String algorithmName = (String) algorithmNames.get(i);
      final boolean algorithmAnimate = ((Boolean) algorithmAnimates.get(i)).booleanValue();
      ToolItem algorithmButton = new ToolItem(toolBar, SWT.PUSH);
      algorithmButton.setText(algorithmName);

      new ToolItem(toolBar, SWT.SEPARATOR);

      algorithmButton.addSelectionListener(new SelectionListener() {
        public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
          currentLayoutAlgorithm = algorithm;
          algorithm.setEntityAspectRatio((double) mainComposite.getClientArea().width / (double) mainComposite.getClientArea().height);
          animate = algorithmAnimate;
          performLayout(false);
        }

        public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
View Full Code Here


          addAlgorithm(GRID, "Grid", false);
          addAlgorithm(HORIZ, "Horiz", false);
          addAlgorithm(VERT, "Vert", false);

          for (int i = 0; i < algorithms.size(); i++) {
            final LayoutAlgorithm algorithm = (LayoutAlgorithm) algorithms.get(i);
            final String algorithmName = (String) algorithmNames.get(i);
            //final boolean algorithmAnimate = ((Boolean)algorithmAnimates.get(i)).booleanValue();
            JButton algorithmButton = new JButton(algorithmName);
            algorithmButton.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                currentLayoutAlgorithm = algorithm;
                currentLayoutAlgorithmName = algorithmName;
                algorithm.setEntityAspectRatio((double) mainPanel.getWidth() / (double) mainPanel.getHeight());
                //animate = algorithmAnimate;
                performLayout();
              }
            });
            toolBar.add(algorithmButton);
View Full Code Here

    graphSeparator.setVisible(false);
    manager.add(graphSeparator);
  }
 
  private LayoutAlgorithm setLayout() {
    LayoutAlgorithm layout;
    layout = new CompositeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING,
        new  LayoutAlgorithm[] {
          new TreeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING),
          new HorizontalShift(LayoutStyles.NO_LAYOUT_NODE_RESIZING) });
    return layout;
View Full Code Here

    viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
    // switch off the animation
    viewer.setNodeStyle(ZestStyles.NODES_NO_ANIMATION);
   
    LayoutAlgorithm layout = new DirectedDiagramViewLayoutAlgorithm(SWT.VERTICAL | LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS);
    viewer.setLayoutAlgorithm(layout);
   
//    viewer.setLayoutAlgorithm(new CompositeLayoutAlgorithm(SWT.VERTICAL | LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS,
//        new LayoutAlgorithm[] {
//          new DirectedGraphLayoutAlgorithm(SWT.VERTICAL | LayoutStyles.NO_LAYOUT_NODE_RESIZING | LayoutStyles.ENFORCE_BOUNDS),
View Full Code Here

TOP

Related Classes of org.eclipse.zest.layouts.LayoutAlgorithm

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.