Search in sources :

Example 6 with ScrollableThumbnail

use of org.eclipse.draw2d.parts.ScrollableThumbnail in project cubrid-manager by CUBRID.

the class ERDThumbnailViewPart method drawThumbnail.

/**
	 * Draw the thumbnail
	 * 
	 * @param rootEditPart
	 */
private void drawThumbnail(ScalableFreeformRootEditPart rootEditPart) {
    canvas = new Canvas(container, SWT.None);
    canvas.setLayout(new FillLayout());
    canvas.setBackground(ResourceManager.getColor(SWT.COLOR_WHITE));
    liSystem = new LightweightSystem(canvas);
    thumbnail = new ScrollableThumbnail((Viewport) rootEditPart.getFigure());
    thumbnail.setViewport((Viewport) rootEditPart.getFigure());
    thumbnail.setSource(rootEditPart.getLayer(LayerConstants.SCALABLE_LAYERS));
    liSystem.setContents(thumbnail);
    container.layout();
}
Also used : Canvas(org.eclipse.swt.widgets.Canvas) Viewport(org.eclipse.draw2d.Viewport) LightweightSystem(org.eclipse.draw2d.LightweightSystem) FillLayout(org.eclipse.swt.layout.FillLayout) ScrollableThumbnail(org.eclipse.draw2d.parts.ScrollableThumbnail)

Example 7 with ScrollableThumbnail

use of org.eclipse.draw2d.parts.ScrollableThumbnail in project dbeaver by dbeaver.

the class ERDOutlinePage method createControl.

/* (non-Javadoc)
     * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite)
     */
@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);
}
Also used : Canvas(org.eclipse.swt.widgets.Canvas) MarginBorder(org.eclipse.draw2d.MarginBorder) Viewport(org.eclipse.draw2d.Viewport) LightweightSystem(org.eclipse.draw2d.LightweightSystem) ScrollableThumbnail(org.eclipse.draw2d.parts.ScrollableThumbnail)

Example 8 with ScrollableThumbnail

use of org.eclipse.draw2d.parts.ScrollableThumbnail in project jbosstools-hibernate by jbosstools.

the class DiagramContentOutlinePage method initializeOverview.

/**
 */
protected void initializeOverview() {
    LightweightSystem lws = new LightweightSystem(overview);
    RootEditPart rep = getGraphicalViewer().getRootEditPart();
    if (rep instanceof ScalableFreeformRootEditPart) {
        ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) rep;
        if (this.thumbnail != null) {
            this.thumbnail.deactivate();
        }
        thumbnail = new ScrollableThumbnail((Viewport) root.getFigure());
        thumbnail.setBorder(new MarginBorder(3));
        thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
        lws.setContents(thumbnail);
    }
}
Also used : ScalableFreeformRootEditPart(org.eclipse.gef.editparts.ScalableFreeformRootEditPart) MarginBorder(org.eclipse.draw2d.MarginBorder) Viewport(org.eclipse.draw2d.Viewport) LightweightSystem(org.eclipse.draw2d.LightweightSystem) RootEditPart(org.eclipse.gef.RootEditPart) ScalableFreeformRootEditPart(org.eclipse.gef.editparts.ScalableFreeformRootEditPart) ScrollableThumbnail(org.eclipse.draw2d.parts.ScrollableThumbnail)

Aggregations

LightweightSystem (org.eclipse.draw2d.LightweightSystem)8 ScrollableThumbnail (org.eclipse.draw2d.parts.ScrollableThumbnail)8 Viewport (org.eclipse.draw2d.Viewport)7 Canvas (org.eclipse.swt.widgets.Canvas)7 MarginBorder (org.eclipse.draw2d.MarginBorder)6 RootEditPart (org.eclipse.gef.RootEditPart)1 ScalableFreeformRootEditPart (org.eclipse.gef.editparts.ScalableFreeformRootEditPart)1 AutoScrollSelectionListener (org.eclipse.linuxtools.internal.callgraph.graphlisteners.AutoScrollSelectionListener)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 Image (org.eclipse.swt.graphics.Image)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1