Esempio n. 1
0
  /**
   * Creates the inner controls
   *
   * @param parent the parent composite
   */
  public void createControl(Composite parent) {
    // An swt canvas and lws drawing the figure.
    overview = new Canvas(parent, SWT.NONE);
    overview.setLayoutData(new GridData(GridData.FILL_BOTH));
    // A draw2d object linking swt and draw2d
    LightweightSystem lightweightSystem = new LightweightSystem(overview);

    // create the thumbnail
    thumbnail = new ScrollableThumbnail((Viewport) rootEditPart.getFigure());
    thumbnail.setBorder(new MarginBorder(3));
    thumbnail.setSource(
        rootEditPart.getLayer(LayerConstants.PRINTABLE_LAYERS /* SCALABLE_LAYERS */));
    lightweightSystem.setContents(thumbnail);
  }