Package org.eclipse.draw2d

Examples of org.eclipse.draw2d.FreeformLayer


private IFigure pane;

public CircuitFigure() {
  setBorder(new CircuitBorder());
  ScrollPane scrollpane = new ScrollPane();
  pane = new FreeformLayer();
  pane.setLayoutManager(new FreeformLayout());
  setLayoutManager(new StackLayout());
  add(scrollpane);
  scrollpane.setViewport(new FreeformViewport());
  scrollpane.setContents(pane);
View Full Code Here


    installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
  }

  @Override
  protected IFigure createFigure() {
    Figure f = new FreeformLayer() {
      @Override
      public void setBounds(Rectangle rect) {
        int x = bounds.x, y = bounds.y;

        boolean resize = (rect.width != bounds.width) || (rect.height != bounds.height), translate = (rect.x != x)
            || (rect.y != y);

        if (isVisible() && (resize || translate)) {
          erase();
        }
        if (translate) {
          int dx = rect.x - x;
          int dy = rect.y - y;
          primTranslate(dx, dy);
        }
        bounds.width = rect.width;
        bounds.height = rect.height;
        if (resize || translate) {
          fireFigureMoved();
          fireCoordinateSystemChanged();
          repaint();
        }
      }
    };

    delegatingLayoutManager = new DelegatingLayoutManager(this);
    f.setLayoutManager(delegatingLayoutManager);
    f.setOpaque(true);
    ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    cLayer.setAntialias(SWT.ON);

    FanRouter fanRouter = new FanRouter();
    fanRouter.setSeparation(20);
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.FreeformLayer

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.