Java 类org.eclipse.draw2d.parts.ScrollableThumbnail 实例源码

项目:ermaster-k    文件:ERDiagramOutlinePage.java   
private void showThumbnail() {
    // RootEditPartのビューをソースとしてサムネイルを作成
    ScalableFreeformRootEditPart editPart = (ScalableFreeformRootEditPart) this.graphicalViewer
            .getRootEditPart();

    if (this.thumbnail != null) {
        this.thumbnail.deactivate();
    }

    this.thumbnail = new ScrollableThumbnail((Viewport) editPart
            .getFigure());
    this.thumbnail.setSource(editPart
            .getLayer(LayerConstants.PRINTABLE_LAYERS));

    this.lws.setContents(this.thumbnail);

}
项目:ermaster-nhit    文件:ERDiagramOutlinePage.java   
private void showThumbnail() {
    // RootEditPartのビューをソースとしてサムネイルを作成
    ScalableFreeformRootEditPart editPart = (ScalableFreeformRootEditPart) this.graphicalViewer
            .getRootEditPart();

    if (this.thumbnail != null) {
        this.thumbnail.deactivate();
    }

    this.thumbnail = new ScrollableThumbnail((Viewport) editPart
            .getFigure());
    this.thumbnail.setSource(editPart
            .getLayer(LayerConstants.PRINTABLE_LAYERS));

    this.lws.setContents(this.thumbnail);

}
项目:bdf2    文件:DbToolGefEditorOutlinePage.java   
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);
}
项目:subclipse    文件:OverviewOutlinePage.java   
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);
}
项目:ForgedUI-Eclipse    文件:DiagramOutlinePage.java   
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);
}
项目:ForgedUI-Eclipse    文件:DiagramOutlinePage2.java   
protected void initializeOverview() {
    LightweightSystem lws = new LightweightSystem(overview);
    if (rep instanceof ScalableFreeformRootEditPart) {
        ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart)rep;
        thumbnail = new ScrollableThumbnail((Viewport)root.getFigure());
        thumbnail.setBorder(new MarginBorder(3));
        thumbnail.setSource(root.getLayer(LayerConstants.PRINTABLE_LAYERS));
        lws.setContents(thumbnail);
    }
}
项目:NEXCORE-UML-Modeler    文件:AbstractDiagramEditor.java   
public void createControl(Composite parent) {
    control = new SashForm(parent, SWT.NONE);

    getViewer().createControl(parent);

    getViewer().setEditDomain(getEditDomain());
    getSelectionSynchronizer().addViewer(getViewer());

    Canvas canvas = new Canvas(control, SWT.BORDER);
    LightweightSystem lws = new LightweightSystem(canvas);

    thumbnail = new ScrollableThumbnail((Viewport) ((ScalableFreeformRootEditPart) getGraphicalViewer().getRootEditPart()).getFigure());
    thumbnail.setSource(((ScalableFreeformRootEditPart) getGraphicalViewer().getRootEditPart()).getLayer(LayerConstants.PRINTABLE_LAYERS));

    lws.setContents(thumbnail);

    disposeListener = new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
            if (thumbnail != null) {
                thumbnail.deactivate();
                thumbnail = null;
            }
        }
    };
    getGraphicalViewer().getControl().addDisposeListener(disposeListener);

}
项目:erflute    文件:ERDiagramOutlinePage.java   
private void showThumbnail() {
    if (quickMode) {
        return;
    }
    final ScalableFreeformRootEditPart editPart = (ScalableFreeformRootEditPart) graphicalViewer.getRootEditPart();
    if (thumbnail != null) {
        thumbnail.deactivate();
    }
    this.thumbnail = new ScrollableThumbnail((Viewport) editPart.getFigure());
    thumbnail.setSource(editPart.getLayer(LayerConstants.PRINTABLE_LAYERS));
    lws.setContents(thumbnail);
}
项目:ant-ivyde    文件:ResolveVisualizerForm.java   
private void createZoomableCanvas(Composite parent) {
    FormData data = new FormData();
    data.top = new FormAttachment(100, -100);
    data.left = new FormAttachment(100, -100);
    data.right = new FormAttachment(100, 0);
    data.bottom = new FormAttachment(100, 0);

    thumbnail = new FigureCanvas(parent, SWT.NONE);
    thumbnail.setBackground(ColorConstants.white);
    thumbnail.setLayoutData(data);

    tb = new ScrollableThumbnail();
    tb.setBorder(new LineBorder(1));
    thumbnail.setContents(tb);
}
项目:olca-app    文件:SankeyMiniViewAction.java   
@Override
protected Control createContents(Composite parent) {
    Composite composite = createForm(parent);
    createScale(composite);
    Canvas canvas = new Canvas(composite, SWT.BORDER);
    canvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    LightweightSystem lws = new LightweightSystem(canvas);
    ScrollableThumbnail thumbnail = createThumbnail();
    lws.setContents(thumbnail);
    viewer.getControl().addDisposeListener((e) -> {
        if (!closed)
            close();
    });
    return super.createContents(parent);
}
项目:olca-app    文件:SankeyMiniViewAction.java   
private ScrollableThumbnail createThumbnail() {
    Viewport port = (Viewport) part.getFigure();
    IFigure figure = part.getLayer(LayerConstants.PRINTABLE_LAYERS);
    ScrollableThumbnail thumbnail = new ScrollableThumbnail(port);
    thumbnail.setSource(figure);
    return thumbnail;
}
项目:olca-app    文件:OpenMiniatureViewAction.java   
private void refresh() {
    thumbnail = new ScrollableThumbnail(port);
    thumbnail.setSource(figure);
    lws.setContents(thumbnail);
}
项目:olca-app    文件:OpenMiniatureViewAction.java   
@Override
protected Control createContents(final Composite parent) {
    FormToolkit toolkit = new FormToolkit(Display.getCurrent());
    ScrolledForm scrolledForm = toolkit.createScrolledForm(parent);
    Composite body = scrolledForm.getBody();
    body.setLayout(new FillLayout());
    toolkit.paintBordersFor(body);

    SashForm sashForm = new SashForm(body, SWT.VERTICAL);
    toolkit.adapt(sashForm, true, true);

    Section categorySection = toolkit
            .createSection(sashForm, ExpandableComposite.NO_TITLE
                    | ExpandableComposite.EXPANDED);
    categorySection.setText("");
    Composite composite = toolkit.createComposite(categorySection,
            SWT.NONE);
    composite.setLayout(new GridLayout());
    categorySection.setClient(composite);
    toolkit.paintBordersFor(composite);
    final Scale scale = new Scale(composite, SWT.NONE);
    scale.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    final double[] values = GraphConfig.ZOOM_LEVELS;
    final int increment = 100 / (values.length - 1);
    scale.setIncrement(increment);
    scale.setMinimum(0);
    scale.setMaximum(100);
    Controls.onSelect(scale, (e) -> {
        zoomManager.setZoom(values[scale.getSelection() / increment]);
    });
    scale.setSelection(increment * (values.length - 1) / 2);
    Canvas canvas = new Canvas(composite, SWT.BORDER);
    canvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    lws = new LightweightSystem(canvas);
    thumbnail = new ScrollableThumbnail(port);
    thumbnail.setSource(figure);
    lws.setContents(thumbnail);
    disposeListener = new DisposeListener() {

        @Override
        public void widgetDisposed(final DisposeEvent e) {
            if (thumbnail != null) {
                thumbnail.deactivate();
                thumbnail = null;
            }
            if (control != null && !control.isDisposed())
                control.removeDisposeListener(disposeListener);
            close();
        }
    };
    control.addDisposeListener(disposeListener);
    return super.createContents(parent);
}