Package org.eclipse.draw2d

Examples of org.eclipse.draw2d.LightweightSystem


    }

    private void createOverview(Composite parent) {
        ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) editor.getGraphicalViewer().getRootEditPart();
        overview = new Canvas(parent, SWT.NONE);
        LightweightSystem lws = new LightweightSystem(overview);
        thumbnail = new ScrollableThumbnail((Viewport) rootEditPart.getFigure());
        thumbnail.setBorder(new MarginBorder(3));
        thumbnail.setSource(rootEditPart.getLayer(LayerConstants.PRINTABLE_LAYERS));
        lws.setContents(thumbnail);
    }
View Full Code Here


    }
    serviceBuilder = new ModelServiceBuilder(sourceViewId);
    Composite containerComposite = new Composite(parentComposite, SWT.NONE);
    containerComposite.setLayout(new FillLayout());
    Canvas canvas = new Canvas(containerComposite, SWT.NULL);
    figureSystem = new LightweightSystem(canvas);
    getSite().getPage().addSelectionListener(this);
  }
View Full Code Here

    this.editor = editor;
  }

  public void createControl(Composite parent) {
    canvas = new Canvas(parent, SWT.BORDER);
    LightweightSystem lws = new LightweightSystem(canvas);

    RootEditPart root = editor.getGraphicalViewer().getRootEditPart();
    ScalableFreeformRootEditPart scalable = (ScalableFreeformRootEditPart) root;
    thumbnail = new ScrollableThumbnail((Viewport) scalable.getFigure());
    thumbnail.setSource(scalable.getLayer(LayerConstants.PRINTABLE_LAYERS));

    lws.setContents(thumbnail);

    disposeListener = new DisposeListener() {
      @Override
      public void widgetDisposed(DisposeEvent e) {
        if (thumbnail != null) {
View Full Code Here

   
    protected LightweightSystem lws;
    public TrayButtonCanvas(Composite parent) {
      super(parent, SWT.NO_REDRAW_RESIZE);
      setCursor(SharedCursors.ARROW);
      lws = new LightweightSystem();
      lws.setControl(this);
      lws.setContents(new TrayArrowButton());
    }
View Full Code Here

    public void addSelectionChangedListener(ISelectionChangedListener listener) {
    }

    public void createControl(Composite parent) {
        overview = new Canvas(parent, SWT.NONE);
        LightweightSystem lws = new LightweightSystem(overview);
        thumbnail = new ScrollableThumbnail((Viewport) rootEditPart.getFigure());
        thumbnail.setBorder(new MarginBorder(3));
        thumbnail.setSource(rootEditPart
                .getLayer(LayerConstants.PRINTABLE_LAYERS));
        lws.setContents(thumbnail);
    }
View Full Code Here

  @Override
  public void createControl(Composite parent)
  {
      // create canvas and lws
      overview = new Canvas(parent, SWT.NONE);
      LightweightSystem lws = new LightweightSystem(overview);
 
      // create thumbnail
      thumbnail =
          new ScrollableThumbnail((Viewport) rootEditPart.getFigure());
      thumbnail.setBorder(new MarginBorder(3));
      thumbnail.setSource(
          rootEditPart.getLayer(LayerConstants.PRINTABLE_LAYERS));
      lws.setContents(thumbnail);
  }
View Full Code Here

    onModelChange();
    editor.getSelectionSyncer().addViewer(getViewer());

    // Creation de la miniature.
    Canvas canvas = new Canvas(sash, SWT.BORDER);
    LightweightSystem lws = new LightweightSystem(canvas);
    GraphicalViewer graphicalViewer = editor.getGraphicalViewer();
    if (graphicalViewer == null)
      return;
   
    RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
   
    // TODO Graphiti - not a ScalableRootEditPart but some kind of DiagramEditPart
    if (rootEditPart instanceof ScalableRootEditPartAnimated) {
      ScalableRootEditPartAnimated diagramEditPart = (ScalableRootEditPartAnimated) rootEditPart;
      IFigure figure = diagramEditPart.getFigure();
      thumbnail = new ScrollableThumbnail( (Viewport) figure);
      IFigure source = diagramEditPart.getLayer(LayerConstants.PRINTABLE_LAYERS);
      thumbnail.setSource(source);
      lws.setContents(thumbnail);
    } else if (rootEditPart instanceof ScalableRootEditPart) {
      thumbnail = new ScrollableThumbnail( (Viewport) ((ScalableRootEditPart) rootEditPart).getFigure());
      thumbnail.setSource(((ScalableRootEditPart) rootEditPart).getLayer(LayerConstants.PRINTABLE_LAYERS));
      lws.setContents(thumbnail);
    }
    disposeListener = new DisposeListener() {
      /*
       * (non-Javadoc)
       * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
View Full Code Here

  /**
   * Creates the graphical Thumbnail viewer.
   */
  protected void createThumbnailViewer() {
    LightweightSystem lws = new LightweightSystem(_overview);
    ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) _graphicalViewer
        .getRootEditPart();
    _thumbnail = new FixedScrollableThumbnail(
        (Viewport) rootEditPart.getFigure());
    _thumbnail.setBorder(new MarginBorder(3));
    _thumbnail.setSource(rootEditPart
        .getLayer(LayerConstants.PRINTABLE_LAYERS));
    lws.setContents(_thumbnail);
  }
View Full Code Here

  protected void initializeOutlineViewer(){
    setContents(getLogicDiagram());
  }
 
  protected void initializeOverview() {
    LightweightSystem lws = new LightweightSystem(overview);
    RootEditPart rep = getGraphicalViewer().getRootEditPart();
    if (rep instanceof ScalableFreeformRootEditPart) {
      ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart)rep;
      thumbnail = new ScrollableThumbnail((Viewport)root.getFigure());
      thumbnail.setBorder(new MarginBorder(3));
      thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
      lws.setContents(thumbnail);
      disposeListener = new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
          if (thumbnail != null) {
            thumbnail.deactivate();
            thumbnail = null;
View Full Code Here

  @Override
  public void createControl(Composite parent) {
    overview = new Canvas(parent, SWT.NONE);
    overview.setBackground(ColorConstants.listBackground);
    LightweightSystem lws = new LightweightSystem(overview);
    thumbnail = new ScrollableThumbnail((Viewport) rootEditPart.getFigure());
    thumbnail.setBorder(new MarginBorder(3));
    thumbnail.setSource(rootEditPart.getLayer(LayerConstants.PRINTABLE_LAYERS));
    lws.setContents(thumbnail);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.LightweightSystem

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.