Java 类org.eclipse.draw2d.geometry.PrecisionDimension 实例源码

项目:neoscada    文件:VisualInterfaceViewer.java   
private Dimension getPreferredSize ( final Rectangle bounds )
{
    if ( this.symbol != null && this.symbol.getDesignSize () != null )
    {
        return new PrecisionDimension ( this.symbol.getDesignSize ().getWidth (), this.symbol.getDesignSize ().getHeight () );
    }
    else if ( this.figure != null )
    {
        return this.figure.getPreferredSize ( bounds.width, bounds.height );
    }
    else
    {
        return new PrecisionDimension ( bounds.width, bounds.height );
    }
}
项目:neoscada    文件:FigureController.java   
public void setPreferredWidth ( final double value )
{
    final PrecisionDimension dim = new PrecisionDimension ();
    dim.setPreciseWidth ( value );
    dim.setPreciseHeight ( getPropertyFigure ().getPreferredSize ().preciseHeight () );

    getPropertyFigure ().setPreferredSize ( dim );
}
项目:neoscada    文件:FigureController.java   
public void setPreferredHeight ( final double value )
{
    final PrecisionDimension dim = new PrecisionDimension ();
    dim.setPreciseWidth ( getPropertyFigure ().getPreferredSize ().preciseWidth () );
    dim.setPreciseHeight ( value );

    getPropertyFigure ().setPreferredSize ( dim );
}
项目:neoscada    文件:FigureController.java   
protected org.eclipse.draw2d.geometry.Dimension create ( final Dimension dimension )
{
    if ( dimension == null )
    {
        return null;
    }
    return new PrecisionDimension ( dimension.getWidth (), dimension.getHeight () );
}
项目:birt    文件:AbstractPageFlowLayout.java   
protected Result getReportBounds( Rectangle reportSize )
{
    Result revValue = new Result( );
    revValue.reportSize.y = MINTOPSPACE;
    revValue.reportSize.width = reportSize.width;
    revValue.reportSize.height = reportSize.height;

    EditPartViewer viewer = owner.getViewer( );
    Scrollable control = viewer == null ? null : (Scrollable)viewer.getControl( );
    Rectangle containerSize = control == null ? new Rectangle( )
            : new Rectangle( control.getClientArea( ) );

    PrecisionDimension dim = new PrecisionDimension( containerSize.width,
            containerSize.height );

    double scale = getZoomManager( ).getZoom( );
    dim.performScale( 1 / scale );
    if ( dim.width > reportSize.width + MINLEFTSPACE + MINRIGHTSPACE )
    {
        revValue.reportSize.x = ( dim.width - reportSize.width ) / 2;
        revValue.rightSpace = ( dim.width - reportSize.width ) / 2;
    }
    else
    {
        revValue.reportSize.x = MINLEFTSPACE;
        revValue.rightSpace = MINRIGHTSPACE;
    }

    if ( dim.height > reportSize.height + MINTOPSPACE + MINBOTTOMSPACE )
    {
        revValue.bottomSpace = dim.height - reportSize.height
                - revValue.reportSize.y;
    }
    else
    {
        revValue.bottomSpace = MINBOTTOMSPACE;
    }

    return revValue;
}
项目:neoscada    文件:XYChildController.java   
public void setDimension ( final double width, final double height )
{
    this.rect.setSize ( new PrecisionDimension ( width, height ) );
    this.figure.getParent ().setConstraint ( this.figure, this.rect );
}
项目:neoscada    文件:FigureController.java   
public void setPreferredSize ( final double width, final double height )
{
    setPreferredSize ( new PrecisionDimension ( width, height ) );
}