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 ); } }
public void setPreferredWidth ( final double value ) { final PrecisionDimension dim = new PrecisionDimension (); dim.setPreciseWidth ( value ); dim.setPreciseHeight ( getPropertyFigure ().getPreferredSize ().preciseHeight () ); getPropertyFigure ().setPreferredSize ( dim ); }
public void setPreferredHeight ( final double value ) { final PrecisionDimension dim = new PrecisionDimension (); dim.setPreciseWidth ( getPropertyFigure ().getPreferredSize ().preciseWidth () ); dim.setPreciseHeight ( value ); getPropertyFigure ().setPreferredSize ( dim ); }
protected org.eclipse.draw2d.geometry.Dimension create ( final Dimension dimension ) { if ( dimension == null ) { return null; } return new PrecisionDimension ( dimension.getWidth (), dimension.getHeight () ); }
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; }
public void setDimension ( final double width, final double height ) { this.rect.setSize ( new PrecisionDimension ( width, height ) ); this.figure.getParent ().setConstraint ( this.figure, this.rect ); }
public void setPreferredSize ( final double width, final double height ) { setPreferredSize ( new PrecisionDimension ( width, height ) ); }