Search in sources :

Example 26 with LightweightSystem

use of org.eclipse.draw2d.LightweightSystem in project archi by archimatetool.

the class OverviewOutlinePage method createControl.

@Override
public void createControl(Composite parent) {
    if (fEditPart == null) {
        return;
    }
    // create canvas and lws
    fCanvas = new Canvas(parent, SWT.NONE);
    LightweightSystem lws = new LightweightSystem(fCanvas);
    fThumbnail = new ScrollableThumbnail((Viewport) fEditPart.getFigure());
    fThumbnail.setUseScaledGraphics(false);
    fThumbnail.setSource(fEditPart.getLayer(LayerConstants.PRINTABLE_LAYERS));
    fThumbnail.setBorder(new MarginBorder(3));
    lws.setContents(fThumbnail);
    // Help
    PlatformUI.getWorkbench().getHelpSystem().setHelp(fCanvas, HELP_ID);
}
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 27 with LightweightSystem

use of org.eclipse.draw2d.LightweightSystem 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 28 with LightweightSystem

use of org.eclipse.draw2d.LightweightSystem 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 29 with LightweightSystem

use of org.eclipse.draw2d.LightweightSystem in project knime-workbench by knime.

the class NewOverviewOutlinePage method createControl.

/**
 * {@inheritDoc}
 */
@Override
public void createControl(final Composite parent) {
    // create canvas and lws
    m_overview = new Canvas(parent, SWT.NONE);
    LightweightSystem lws = new LightweightSystem(m_overview);
    // create thumbnail
    m_thumbnail = new ScrollableThumbnail((Viewport) m_rootEditPart.getFigure());
    m_thumbnail.setBorder(new MarginBorder(3));
    m_thumbnail.setSource(m_rootEditPart.getLayer(LayerConstants.PRINTABLE_LAYERS));
    lws.setContents(m_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 30 with LightweightSystem

use of org.eclipse.draw2d.LightweightSystem in project org.eclipse.linuxtools by eclipse-linuxtools.

the class CallgraphView method initializeView.

/**
 * Initializes the view by creating composites (if necessary) and canvases
 * Calls loadData(), and calls finishLoad() if not in realTime mode (otherwise
 * it is up to the user-defined update methods to finish loading).
 *
 * @return status
 */
@Override
public IStatus initializeView(Display targetDisplay, IProgressMonitor monitor) {
    if (targetDisplay == null && Display.getCurrent() == null) {
        Display.getDefault();
    }
    makeTreeComp();
    makeGraphComp();
    graphComp.setBackgroundMode(SWT.INHERIT_FORCE);
    // Create papa canvas
    Canvas papaCanvas = new Canvas(graphComp, SWT.BORDER);
    GridLayout papaLayout = new GridLayout(1, true);
    papaLayout.horizontalSpacing = 0;
    papaLayout.verticalSpacing = 0;
    papaLayout.marginHeight = 0;
    papaLayout.marginWidth = 0;
    papaCanvas.setLayout(papaLayout);
    GridData papaGD = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
    papaGD.widthHint = 160;
    papaCanvas.setLayoutData(papaGD);
    // Add first button
    // $NON-NLS-1$
    Image image = getImageDescriptor("icons/up.gif").createImage();
    Button up = new Button(papaCanvas, SWT.PUSH);
    GridData buttonData = new GridData(SWT.CENTER, SWT.CENTER, true, false);
    buttonData.widthHint = 150;
    buttonData.heightHint = 20;
    up.setData(buttonData);
    up.setImage(image);
    // $NON-NLS-1$
    up.setToolTipText(Messages.getString("CallgraphView.ThumbNailUp"));
    // Add thumb canvas
    Canvas thumbCanvas = new Canvas(papaCanvas, SWT.NONE);
    // Add second button
    // $NON-NLS-1$
    image = getImageDescriptor("icons/down.gif").createImage();
    Button down = new Button(papaCanvas, SWT.PUSH);
    buttonData = new GridData(SWT.CENTER, SWT.CENTER, true, false);
    buttonData.widthHint = 150;
    buttonData.heightHint = 0;
    down.setData(buttonData);
    down.setImage(image);
    // $NON-NLS-1$
    down.setToolTipText(Messages.getString("CallgraphView.ThumbNailDown"));
    // Initialize graph
    g = new StapGraph(graphComp, SWT.BORDER, treeComp, papaCanvas, this);
    g.setLayoutData(new GridData(masterComposite.getBounds().width, Display.getCurrent().getBounds().height - TREE_SIZE));
    up.addSelectionListener(new AutoScrollSelectionListener(AutoScrollSelectionListener.AUTO_SCROLL_UP, g));
    down.addSelectionListener(new AutoScrollSelectionListener(AutoScrollSelectionListener.AUTO_SCROLL_DOWN, g));
    // Initialize thumbnail
    GridData thumbGD = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
    thumbGD.widthHint = 160;
    thumbCanvas.setLayoutData(thumbGD);
    LightweightSystem lws = new LightweightSystem(thumbCanvas);
    ScrollableThumbnail thumb = new ScrollableThumbnail(g.getViewport());
    thumb.setSource(g.getContents());
    lws.setContents(thumb);
    loadData(monitor);
    return finishLoad(monitor);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) Canvas(org.eclipse.swt.widgets.Canvas) GridData(org.eclipse.swt.layout.GridData) LightweightSystem(org.eclipse.draw2d.LightweightSystem) Image(org.eclipse.swt.graphics.Image) AutoScrollSelectionListener(org.eclipse.linuxtools.internal.callgraph.graphlisteners.AutoScrollSelectionListener) ScrollableThumbnail(org.eclipse.draw2d.parts.ScrollableThumbnail)

Aggregations

LightweightSystem (org.eclipse.draw2d.LightweightSystem)55 Shell (org.eclipse.swt.widgets.Shell)33 Display (org.eclipse.swt.widgets.Display)32 Canvas (org.eclipse.swt.widgets.Canvas)23 XYGraph (org.eclipse.nebula.visualization.xygraph.figures.XYGraph)16 CircularBufferDataProvider (org.eclipse.nebula.visualization.xygraph.dataprovider.CircularBufferDataProvider)15 Trace (org.eclipse.nebula.visualization.xygraph.figures.Trace)15 ScrollableThumbnail (org.eclipse.draw2d.parts.ScrollableThumbnail)14 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)12 Viewport (org.eclipse.draw2d.Viewport)12 MarginBorder (org.eclipse.draw2d.MarginBorder)11 IXYGraph (org.eclipse.nebula.visualization.xygraph.figures.IXYGraph)11 ToolbarArmedXYGraph (org.eclipse.nebula.visualization.xygraph.figures.ToolbarArmedXYGraph)11 IManualValueChangeListener (org.eclipse.nebula.visualization.widgets.datadefinition.IManualValueChangeListener)7 SchemeBorder (org.eclipse.draw2d.SchemeBorder)6 GridData (org.eclipse.swt.layout.GridData)6 GridLayout (org.eclipse.swt.layout.GridLayout)6 GaugeFigure (org.eclipse.nebula.visualization.widgets.figures.GaugeFigure)5 KnobFigure (org.eclipse.nebula.visualization.widgets.figures.KnobFigure)5 TankFigure (org.eclipse.nebula.visualization.widgets.figures.TankFigure)5