Java 类org.eclipse.draw2d.DefaultRangeModel 实例源码

项目:gef-gwt    文件:GwtRulerComposite.java   
private void disposeRulerViewer(GraphicalViewer viewer) {
    if (viewer == null)
        return;
    /*
     * There's a tie from the editor's range model to the RulerViewport (via
     * a listener) to the RulerRootEditPart to the RulerViewer. Break this
     * tie so that the viewer doesn't leak and can be garbage collected.
     */

    dockLayoutPanel.remove(northPanel);
    dockLayoutPanel.remove(westPanel);
    dockLayoutPanel.forceLayout();

    RangeModel rModel = new DefaultRangeModel();
    Viewport port = ((FigureCanvas) viewer.getControl()).getViewport();
    port.setHorizontalRangeModel(rModel);
    port.setVerticalRangeModel(rModel);
    rulerEditDomain.removeViewer(viewer);
    viewer.getRootEditPart().deactivate();
    // viewer.getControl().dispose();
}
项目:birt    文件:EditorRulerComposite.java   
private void disposeRulerViewer( GraphicalViewer viewer )
{
    if ( viewer == null )
        return;
    /*
     * There's a tie from the editor's range model to the RulerViewport (via
     * a listener) to the RulerRootEditPart to the RulerViewer. Break this
     * tie so that the viewer doesn't leak and can be garbage collected.
     */

    RangeModel rModel = new DefaultRangeModel( );
    Viewport port = ( (FigureCanvas) viewer.getControl( ) ).getViewport( );
    port.setHorizontalRangeModel( new RulerDefaultRangeModel( rModel ) );
    port.setVerticalRangeModel( new RulerDefaultRangeModel( rModel ) );
    rulerEditDomain.removeViewer( viewer );
    viewer.getControl( ).dispose( );
}
项目:PDFReporter-Studio    文件:JDRulerComposite.java   
private void disposeRulerViewer(GraphicalViewer viewer) {
    if (viewer == null)
        return;
    /*
     * There's a tie from the editor's range model to the RulerViewport (via a listener) to the RulerRootEditPart to the
     * RulerViewer. Break this tie so that the viewer doesn't leak and can be garbage collected.
     */
    RangeModel rModel = new DefaultRangeModel();
    Viewport port = ((FigureCanvas) viewer.getControl()).getViewport();
    port.setHorizontalRangeModel(rModel);
    port.setVerticalRangeModel(rModel);
    rulerEditDomain.removeViewer(viewer);
    viewer.getControl().dispose();
}
项目:OpenSPIFe    文件:Timeline.java   
private Control createTimelineRegion(Composite parent) {
    Composite timelineRegion = new EnsembleComposite(parent, SWT.NONE);
    timelineRegion.setData("debug", Timeline.class.getSimpleName() + ".timelineRegion");
    timelineRegion.setLayout(new BorderLayout());

    // create the range model first
    final RangeModel rangeModel = new DefaultRangeModel();
    setHorizontalRangeModel(rangeModel);

    // frozen top timeline contents
    // date/time ruler (scale)
    Composite timelineTopComposite = buildTopTimeline(timelineRegion);
    timelineTopComposite.setLayoutData(SWT.TOP);

    // timeline contents
    ScrolledComposite scroller = buildTimelineContents(timelineRegion);
    scroller.setLayoutData(SWT.CENTER);

    // scroller
    TimelineViewer timelineHScroller = buildTimeline(timelineRegion, getTimelineModel(), new SplitScrollEditPartFactory<T>());
    timelineHScroller.getControl().setLayoutData(SWT.BOTTOM);

    scroller.getContent().addListener(SWT.MouseHorizontalWheel, new Listener() {
        @Override
        public void handleEvent(Event event) {
            int value = rangeModel.getValue();
            value -= 5 * event.count;
            rangeModel.setValue(value);
        }
    });

    return timelineRegion;
}
项目:gef-gwt    文件:RulerComposite.java   
private void disposeRulerViewer(GraphicalViewer viewer) {
    if (viewer == null)
        return;
    /*
     * There's a tie from the editor's range model to the RulerViewport (via
     * a listener) to the RulerRootEditPart to the RulerViewer. Break this
     * tie so that the viewer doesn't leak and can be garbage collected.
     */
    RangeModel rModel = new DefaultRangeModel();
    Viewport port = ((FigureCanvas) viewer.getControl()).getViewport();
    port.setHorizontalRangeModel(rModel);
    port.setVerticalRangeModel(rModel);
    rulerEditDomain.removeViewer(viewer);
    viewer.getControl().dispose();
}