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

项目:seg.jUCMNav    文件:URNDiagramEditPart.java   
/**
 * Had to be overridden to take into account the fact that components are at the end of the children list of editpart. Since this function is called with a
 * different index for normal child and components, we had to change this.
 * 
 * @see #addChild(EditPart child, int index)
 * @see org.eclipse.gef.editparts.AbstractEditPart#reorderChild(org.eclipse.gef.EditPart, int)
 */
protected void reorderChild(EditPart child, int index) {
    editPartInProcess = child;
    int i = index;
    if (child.getModel() instanceof IURNContainerRef)
        i += getSpecificationNodeEditParts().size();

    // Save the constraint of the child so that it does not
    // get lost during the remove and re-add.
    IFigure childFigure = ((GraphicalEditPart) child).getFigure();
    LayoutManager layout = getContentPane().getLayoutManager();
    Object constraint = null;
    if (layout != null)
        constraint = layout.getConstraint(childFigure);

    removeChildVisual(child);
    List children = getChildren();
    children.remove(child);
    children.add(i, child);
    addChildVisual(child, index);

    setLayoutConstraint(child, childFigure, constraint);

    editPartInProcess = null;
}
项目:ForgedUI-Eclipse    文件:ScrollViewEditPart.java   
@Override
protected void reorderChild(EditPart child, int index) {
    IFigure childFigure = ((GraphicalEditPart) child).getFigure();
    LayoutManager layout = getContainer().getLayoutManager();
    Object constraint = null;
    if (layout != null)
        constraint = layout.getConstraint(childFigure);

    super.reorderChild(child, index);
    setLayoutConstraint(child, childFigure, constraint);
}
项目:NEXCORE-UML-Modeler    文件:ActivityDiagramEditPart.java   
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    Figure fiugre = new FreeformLayer();
    fiugre.setBorder(new MarginBorder(10));
    fiugre.setLayoutManager(new FreeformLayout());
    fiugre.setOpaque(false);

    LayoutManager layout = new ActivityDiagramLayout();
    fiugre.setLayoutManager(layout);

    return fiugre;
}
项目:OpenSPIFe    文件:TemporalNodeDecoratorTextEditPolicy.java   
private void refreshFeedbackInDisplayThread() {
    GEFUtils.runLaterInDisplayThread(getHost(), new Runnable() {
        @Override
        public void run() {
            IFigure f = getHostFigure();
            LayoutManager layout = f.getParent().getLayoutManager();
            layout.invalidate();
            f.getParent().repaint();
            textOverlayFigure.revalidate();
            textOverlayFigure.repaint();
        }
    });
}
项目:gef-gwt    文件:AbstractGraphicalEditPart.java   
/**
 * This method is extended to preserve a LayoutManager constraint if one
 * exists.
 * 
 * @see org.eclipse.gef.editparts.AbstractEditPart#reorderChild(EditPart,
 *      int)
 */
protected void reorderChild(EditPart child, int index) {
    // Save the constraint of the child so that it does not
    // get lost during the remove and re-add.
    IFigure childFigure = ((GraphicalEditPart) child).getFigure();
    LayoutManager layout = getContentPane().getLayoutManager();
    Object constraint = null;
    if (layout != null)
        constraint = layout.getConstraint(childFigure);

    super.reorderChild(child, index);
    setLayoutConstraint(child, childFigure, constraint);
}
项目:birt    文件:MultipleLayout.java   
protected Dimension calculatePreferredSize( IFigure container, int wHint,
        int hHint )
{       
    Rectangle rect = container.getParent( ).getClientArea( ).getCopy( );
    List list = container.getChildren( );
    if (list.size( ) == 0)
    {
        return Dimension.SINGLETON;
    }

    Figure child = (Figure)list.get( 0 );

    wHint = Math.max( -1, wHint - container.getInsets( ).getWidth( ) );
    hHint = Math.max( -1, hHint - container.getInsets( ).getHeight( ) );

    wHint = Math.max( wHint,rect.width - container.getInsets( ).getWidth( ) );
    hHint = Math.max( hHint, rect.height - container.getInsets( ).getHeight( ) );

    if (child instanceof TableFigure && needlayout)
    {
        IFigure tablePane = ( (LayeredPane) ( (LayeredPane) ( (TableFigure) child ).getContents( ) ).getLayer( LayerConstants.PRINTABLE_LAYERS ) ).getLayer( LayerConstants.PRIMARY_LAYER );
        LayoutManager layoutManager = tablePane.getLayoutManager( );

        ( (TableLayout) layoutManager ).markDirty( );
        container.getBounds( ).width = wHint;
        container.getBounds( ).height = hHint;
        //child.invalidateTree( );
        child.validate( );

        //dim = getPreferredSize( container, wHint, hHint ).expand( container.getInsets( ).getWidth( ), container.getInsets( ).getHeight( ) );;
        needlayout = false;
    }

    Dimension dim = child.getPreferredSize(wHint, hHint ).expand( container.getInsets( ).getWidth( ), container.getInsets( ).getHeight( ) );

    return dim;
}
项目:statecharts    文件:FixedSizeShapeNodeEditPart.java   
protected LayoutManager getLayoutManager() {
    return new StackLayout();
}
项目:limpet    文件:DirectionalShape.java   
/**
 * Not intended to be called
 */
@Override
public void setLayoutManager(LayoutManager manager)
{
  throw new UnsupportedOperationException("Layout manager is read-only");
}
项目:antlr4ide    文件:RailroadTrack.java   
@Override
protected LayoutManager createLayoutManager() {
  return new SequenceLayout();
}
项目:antlr4ide    文件:LoopSegment.java   
@Override
protected LayoutManager createLayoutManager() {
  return new ParallelLayout(ILayoutConstants.connectionRadius());
}
项目:antlr4ide    文件:RailroadDiagram.java   
@Override
protected LayoutManager createLayoutManager() {
  ToolbarLayout layout = new ToolbarLayout();
  layout.setSpacing(ILayoutConstants.vSpaceBetweenTracks());
  return layout;
}
项目:antlr4ide    文件:SequenceSegment.java   
@Override
protected LayoutManager createLayoutManager() {
  return new SequenceLayout();
}
项目:antlr4ide    文件:NodeSegment.java   
@Override
protected LayoutManager createLayoutManager() {
  return new SequenceLayout();
}
项目:antlr4ide    文件:ParallelSegment.java   
@Override
protected LayoutManager createLayoutManager() {
  return new ParallelLayout();
}
项目:antlr4ide    文件:CompartmentSegment.java   
@Override
protected LayoutManager createLayoutManager() {
  return new CompartmentLayout();
}
项目:antlr4ide    文件:BypassSegment.java   
@Override
protected LayoutManager createLayoutManager() {
  return new ParallelLayout();
}
项目:chrysalix    文件:FocusTreeCanvas.java   
@Override
public LayoutManager getLayoutManager() {
    return delegate.getLayoutManager();
}
项目:chrysalix    文件:FocusTreeCanvas.java   
@Override
public void setLayoutManager( final LayoutManager manager ) {
    delegate.setLayoutManager( manager );
}
项目:antlr4ide    文件:AbstractSegmentFigure.java   
protected abstract LayoutManager createLayoutManager();