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

项目:wt-studio    文件:TableModelFigure.java   
public TableModelFigure()
{
    ToolbarLayout layout = new ToolbarLayout();
    layout.setHorizontal(true);
    layout.setSpacing(10);
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);

    setLayoutManager(new FillLayout());
    setOpaque(true);
    setBackgroundColor(ColorConstants.white);
    border = new FrameBorder("列表");
    border.setLabel("Block");
    this.setBorder(border);
    ScrollPane scrollpane = new ScrollPane();
    scrollpane.setHorizontalScrollBarVisibility(1);
    scrollpane.setVerticalScrollBarVisibility(0);
    headerFigure = new FreeformLayer();
    headerFigure.setLayoutManager(new ScrollAreaLayout());
    headerFigure.setBackgroundColor(ColorConstants.white);
    add(scrollpane);
    scrollpane.setViewport(new FreeformViewport());
    scrollpane.setContents(headerFigure);
}
项目:seg.jUCMNav    文件:ActorRefEditPart.java   
/**
 * Creates the figure for actor refs, and also adds evaluation labels / icons to the background.
 * 
 * @see seg.jUCMNav.editparts.ModelElementEditPart#createFigure()
 */
protected IFigure createFigure() {
    evaluationLabel = new Label();
    evaluationLabel.setForegroundColor(ColorManager.LINKREFLABEL);

    evaluationLabel.setSize(78, 16); // increased from 58,16
    evaluationImg = (JUCMNavPlugin.getImage("icons/Actor16.gif")); //$NON-NLS-1$
    evaluationLabel.setIcon(evaluationImg);
    evaluationLabel.setText(""); //$NON-NLS-1$
    evaluationLabel.setVisible(true);
    try {
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).add(evaluationLabel);
    } catch (Exception ex) {
        System.out.println("problem with scaling grl evaluation label"); //$NON-NLS-1$
        // bug 435: old code.. hoping new code is more robust.
        ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().add(evaluationLabel);
    }

    return new ActorFigure();
}
项目:seg.jUCMNav    文件:ActorRefEditPart.java   
/**
 * Overriding because we also have to listen to the Actor definition
 * 
 * @see org.eclipse.gef.EditPart#deactivate()
 */
public void deactivate() {
    if (isActive()) {
        // if (evaluationImg != null) {
        // evaluationImg.dispose();
        // evaluationImg = null;
        // }
        // ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().remove(evaluationLabel);
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).remove(evaluationLabel);
        if (getActorRef().getContDef() != null) {
            getActorRef().getContDef().eAdapters().remove(this);
        }
    }

    // stop listening to reference
    super.deactivate();
}
项目:ForgedUI-Eclipse    文件:PickerColumnFigure.java   
public PickerColumnFigure() {
    pane = new FreeformLayer();
    pane.setLayoutManager(new FreeformLayout());
    setLayoutManager(new StackLayout());
    container = new TitaniumFigure();
    container.setLayoutManager(new FreeformLayout());
    pane.add(container);

    scrollpane = new ScrollPane();
    scrollpane.setHorizontalScrollBarVisibility(ScrollPane.NEVER);
    scrollpane.setVerticalScrollBarVisibility(ScrollPane.NEVER);
    scrollpane.setViewport(new FreeformViewport());
    scrollpane.setContents(pane);
    add(scrollpane);
}
项目:ForgedUI-Eclipse    文件:ScrollViewFigure.java   
public ScrollViewFigure() {
    pane = new FreeformLayer();
    pane.setLayoutManager(new FreeformLayout());
    setLayoutManager(new StackLayout());
    container = new TitaniumFigure();
    container.setLayoutManager(new FreeformLayout());
    pane.add(container);

    scrollpane = new ScrollPane();
    scrollpane.setScrollBarVisibility(ScrollPane.AUTOMATIC);
    scrollpane.setViewport(new FreeformViewport());
    scrollpane.setContents(pane);
    add(scrollpane);
}
项目:gef-gwt    文件:FreeformGraphicalRootEditPart.java   
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
protected IFigure createFigure() {
    FreeformViewport viewport = new FreeformViewport();
    innerLayers = new FreeformLayeredPane();
    createLayers(innerLayers);
    viewport.setContents(innerLayers);
    return viewport;
}
项目:chrysalix    文件:FocusTreeLightweight.java   
FocusTreeLightweight( final FocusTree focusTree,
                      final Composite parent,
                      final int style ) {
    super( parent, style );
    this.focusTree = focusTree;
    setViewport( new FreeformViewport() );
    getViewport().setContentsTracksHeight( true );
    getViewport().setContentsTracksWidth( true );
    getHorizontalBar().setEnabled( false );
    setHorizontalScrollBarVisibility( NEVER );
}
项目:seg.jUCMNav    文件:IntentionalElementEditPart.java   
/**
 * Create the GrlNode figure and associated evaluation labels.
 * 
 * @see seg.jUCMNav.editparts.ModelElementEditPart#createFigure()
 */
protected IFigure createFigure() {
    IntentionalElementFigure fig = new IntentionalElementFigure();

    evaluationLabel = new Label();
    evaluationLabel.setForegroundColor(ColorManager.LINKREFLABEL);
    evaluationLabel.setVisible(false);

    evaluationLabel.setSize(100, 16); // resized from 60, 16
    evaluationLabel.setTextAlignment(PositionConstants.LEFT);
    kpiEvaluationValueLabel = new Label();
    kpiEvaluationValueLabel.setForegroundColor(ColorManager.BLUE);
    kpiEvaluationValueLabel.setVisible(false);
    kpiEvaluationValueLabel.setSize(70, 16);

    try {
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).add(evaluationLabel);
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).add(kpiEvaluationValueLabel);
    } catch (Exception ex) {
        System.out.println("problem with scaling grl evaluation label"); //$NON-NLS-1$
        // bug 435: old code.. hoping new code is more robust
        ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().add(evaluationLabel);
        ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().add(kpiEvaluationValueLabel);
    }
    return fig;
}
项目:seg.jUCMNav    文件:IntentionalElementEditPart.java   
/**
 * Overriding because we also have to listen to the Component definition
 * 
 * @see org.eclipse.gef.EditPart#deactivate()
 */
public void deactivate() {
    if (isActive()) {
        // bug 435: ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().remove(evaluationLabel);
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).remove(evaluationLabel);
        if (getNode() instanceof IntentionalElementRef && (getNode()).getDef() != null)
            (getNode()).getDef().eAdapters().remove(this);
    }
    super.deactivate();

}