本文整理汇总了Java中org.eclipse.draw2d.LightweightSystem类的典型用法代码示例。如果您正苦于以下问题:Java LightweightSystem类的具体用法?Java LightweightSystem怎么用?Java LightweightSystem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LightweightSystem类属于org.eclipse.draw2d包,在下文中一共展示了LightweightSystem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createControl
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void createControl(final Composite parent) {
sash = new SashForm(parent, SWT.VERTICAL);
// コンストラクタで指定したビューワの作成
viewer.createControl(sash);
// EditPartFactory の設定
final ERDiagramOutlineEditPartFactory editPartFactory = new ERDiagramOutlineEditPartFactory();
viewer.setEditPartFactory(editPartFactory);
// グラフィカル・エディタのルート・モデルをツリー・ビューワにも設定
viewer.setContents(diagram);
final Canvas canvas = new Canvas(sash, SWT.BORDER);
// サムネイル・フィギュアを配置する為の LightweightSystem
lws = new LightweightSystem(canvas);
resetView(registry);
final AbstractTransferDragSourceListener dragSourceListener = new ERDiagramTransferDragSourceListener(viewer, TemplateTransfer.getInstance());
viewer.addDragSourceListener(dragSourceListener);
diagram.refreshOutline();
}
示例2: createPartControl
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
/**
* This operation sets up the Composite that contains the VisIt canvas and
* create the VisIt widget.
*
* @param parent
* The parent Composite to create the Control in.
*/
@Override
public void createPartControl(Composite parent) {
// Create a top level composite to hold the canvas or text
vizComposite = new Composite(parent, SWT.NONE);
vizComposite.setLayout(new GridLayout(1, true));
// Set up the canvas where the graph is displayed
plotCanvas = new Canvas(vizComposite, SWT.BORDER);
plotCanvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
// MAGIC
lws = new LightweightSystem(plotCanvas);
return;
}
示例3: initializeOverview
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
/**
* Initialize overview.
*/
protected void initializeOverview() {
LightweightSystem lws = new J2DLightweightSystem(overview);
RootEditPart rep = editor.getGraphicalViewer().getRootEditPart();
if (rep instanceof MainDesignerRootEditPart) {
ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) rep;
thumbnail = new JSSScrollableThumbnail((Viewport) root.getFigure(), (MRoot)getViewer().getContents().getModel());
thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
lws.setContents(thumbnail);
disposeListener = new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
if (thumbnail != null) {
thumbnail.deactivate();
thumbnail = null;
}
}
};
editor.getEditor().addDisposeListener(disposeListener);
}
lws.setControl(overview);
}
示例4: createControl
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
this.sash = new SashForm(parent, SWT.VERTICAL);
viewer.createControl(sash);
editPartFactory = new ERDiagramOutlineEditPartFactory();
editPartFactory.setQuickMode(quickMode);
viewer.setEditPartFactory(editPartFactory);
viewer.setContents(diagram);
if (!quickMode) {
final Canvas canvas = new Canvas(sash, SWT.BORDER);
lws = new LightweightSystem(canvas);
}
resetView(registry);
final AbstractTransferDragSourceListener dragSourceListener =
new ERDiagramTransferDragSourceListener(viewer, TemplateTransfer.getInstance());
viewer.addDragSourceListener(dragSourceListener);
expandVirturalDiagramTree();
}
示例5: createGraph
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
private void createGraph(final Shell shell, final Map<Integer, Short> map, final BikeType bikeType) {
final Canvas canvas = new Canvas(shell, SWT.NONE);
final LightweightSystem lws = new LightweightSystem(canvas);
torqueGraph = new ComplexTorqueGraph(map, bikeType);
lws.setContents(torqueGraph.getToolbarArmedXYGraph());
GridDataFactory.fillDefaults().grab(true, true).applyTo(canvas);
final IXYGraph xyGraph = torqueGraph.getXyGraph();
canvas.addKeyListener(new ZoomInListener(xyGraph));
canvas.addKeyListener(new ZoomOutListener(xyGraph));
canvas.addKeyListener(new UndoListener(xyGraph.getOperationsManager()));
canvas.addKeyListener(new RedoListener(xyGraph.getOperationsManager()));
canvas.addKeyListener(new SaveSnapshotListener(shell, xyGraph));
canvas.addMouseWheelListener(new ZoomMouseWheelListener(xyGraph));
new ComplexTorqueGraphContextMenu(canvas, torqueGraph);
}
示例6: CustomFigureCanvas
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
public CustomFigureCanvas(int style, Composite parent, LightweightSystem lws, CustomPaletteViewer toolViewer, PaletteRoot paletteRoot,ELTGraphicalEditor editor) {
super(style | APPLY_STYLES, parent, lws);
containerForSearchTextBox = toolViewer.creatSearchTextBox(this, paletteRoot,editor);
if (containerForSearchTextBox != null && toolViewer != null) {
org.eclipse.swt.graphics.Point bounds = containerForSearchTextBox.computeSize(SWT.DEFAULT, SWT.DEFAULT);
if (containerHeight < bounds.y) {
containerHeight = bounds.y;
}
}
customLayoutViewPort();
}
示例7: createEyeViewControl
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
public void createEyeViewControl(Composite parent) {
Canvas canvas = new Canvas(parent, SWT.NONE);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
LightweightSystem liSystem = new LightweightSystem(canvas);
ScalableFreeformRootEditPart rootEditPart = ((ScalableFreeformRootEditPart) dbToolGefEditor.getGraphicalViewer().getRootEditPart());
ScrollableThumbnail thumbnail = new ScrollableThumbnail((Viewport) rootEditPart.getFigure());
thumbnail.setSource(rootEditPart.getLayer(LayerConstants.SCALABLE_LAYERS));
liSystem.setContents(thumbnail);
}
示例8: main
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
public static void main(String[] args) {
Shell shell = new Shell(new Display());
shell.setSize(1200, 500);
shell.setLayout(new GridLayout());
shell.setLocation(100, 150);
Figure root = new Figure();
root.setFont(shell.getFont());
// XYLayout layout = new XYLayout();
// root.setLayoutManager(layout);
org.eclipse.draw2d.GridLayout layout = new org.eclipse.draw2d.GridLayout(2,false);
layout.horizontalSpacing = 100;
root.setLayoutManager(layout);
Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
canvas.setBackground(ColorConstants.white);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
createDiagram(root);
LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(root);
Display display = shell.getDisplay();
shell.open();
while (!shell.isDisposed()) {
while (!display.readAndDispatch()) {
display.sleep();
}
}
}
示例9: main
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
public static void main(String[] args) {
Shell shell = new Shell(new Display());
shell.setSize(1200, 500);
shell.setLayout(new GridLayout());
shell.setLocation(100, 150);
Figure root = new Figure();
root.setFont(shell.getFont());
// XYLayout layout = new XYLayout();
// root.setLayoutManager(layout);
org.eclipse.draw2d.GridLayout layout = new org.eclipse.draw2d.GridLayout(2,false);
layout.horizontalSpacing = 100;
root.setLayoutManager(layout);
Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
canvas.setBackground(ColorConstants.white);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
MatrixWidget widget = new MatrixWidget();
MockArray array = new MockArray("int[]", new int[]{1,2,3}, new int[]{4,5,6}, new int[]{7,8,9}, new int[]{10,11,12});
root.add(widget.createFigure(array));
LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(root);
Display display = shell.getDisplay();
shell.open();
while (!shell.isDisposed()) {
while (!display.readAndDispatch()) {
display.sleep();
}
}
}
示例10: main
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
public static void main(String[] args) {
Shell shell = new Shell(new Display());
shell.setSize(365, 280);
shell.setLayout(new GridLayout());
Figure root = new Figure();
root.setFont(shell.getFont());
XYLayout layout = new XYLayout();
root.setLayoutManager(layout);
Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
canvas.setBackground(ColorConstants.white);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
VarParser parser = new VarParser("src/pt/iscte/pandionj/tests/Test.java");
parser.run();
System.out.println(parser.toText());
createDiagram(root, parser);
LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(root);
Display display = shell.getDisplay();
shell.open();
while (!shell.isDisposed()) {
while (!display.readAndDispatch()) {
display.sleep();
}
}
}
示例11: createControl
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
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);
}
示例12: main
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
private static void main() throws FileNotFoundException {
try {
shell.setSize(100, 100);
final LightweightSystem lws = new LightweightSystem(shell);
final IFigure panel = new Figure();
panel.setLayoutManager(new ToolbarLayout());
initialize(panel);
lws.setContents(panel);
shell.open();
final Display display = Display.getDefault();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
} finally {
if (image != null) {
image.dispose();
}
}
}
示例13: createControl
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void createControl(Composite parent) {
this.sash = new SashForm(parent, SWT.VERTICAL);
// コンストラクタで指定したビューワの作成
this.viewer.createControl(this.sash);
// EditPartFactory の設定
ERDiagramOutlineEditPartFactory editPartFactory = new ERDiagramOutlineEditPartFactory();
this.viewer.setEditPartFactory(editPartFactory);
// グラフィカル・エディタのルート・モデルをツリー・ビューワにも設定
this.viewer.setContents(this.diagram);
Canvas canvas = new Canvas(this.sash, SWT.BORDER);
// サムネイル・フィギュアを配置する為の LightweightSystem
this.lws = new LightweightSystem(canvas);
this.resetView(this.registry);
AbstractTransferDragSourceListener dragSourceListener = new ERDiagramTransferDragSourceListener(
this.viewer, TemplateTransfer.getInstance());
this.viewer.addDragSourceListener(dragSourceListener);
this.diagram.refreshOutline();
}
示例14: main
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
private static void main() throws FileNotFoundException {
try {
shell.setSize(100, 100);
LightweightSystem lws = new LightweightSystem(shell);
IFigure panel = new Figure();
panel.setLayoutManager(new ToolbarLayout());
initialize(panel);
lws.setContents(panel);
shell.open();
Display display = Display.getDefault();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
} finally {
if (image != null) {
image.dispose();
}
}
}
示例15: createControl
import org.eclipse.draw2d.LightweightSystem; //导入依赖的package包/类
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);
}