use of org.eclipse.draw2d.LightweightSystem in project linuxtools by eclipse.
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);
}
use of org.eclipse.draw2d.LightweightSystem in project knime-core 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);
}
use of org.eclipse.draw2d.LightweightSystem in project dbeaver by serge-rider.
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);
}
use of org.eclipse.draw2d.LightweightSystem in project yamcs-studio by yamcs.
the class OverviewOutlinePage method createControl.
@Override
public void createControl(Composite parent) {
overview = new Canvas(parent, SWT.NONE);
var lws = new LightweightSystem(overview);
thumbnail = new ScrollableThumbnail((Viewport) rootEP.getFigure());
thumbnail.setBorder(new MarginBorder(3));
thumbnail.setSource(rootEP.getLayer(LayerConstants.PRINTABLE_LAYERS));
lws.setContents(thumbnail);
disposeListener = e -> {
if (thumbnail != null) {
thumbnail.deactivate();
thumbnail = null;
}
};
rootEP.getViewer().getControl().addDisposeListener(disposeListener);
}
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);
}
Aggregations