Exemplo 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);
  }
Exemplo n.º 2
0
  /** {@inheritDoc} */
  @Override
  public void dispose() {
    if (null != thumbnail) {
      thumbnail.deactivate();
      thumbnail = null;
    }

    super.dispose();
  }
Exemplo n.º 3
0
 /** {@inheritDoc} */
 @Override
 public void setVisible(boolean state) {
   thumbnail.setVisible(state);
   super.setVisible(state);
 }