@Override protected Point getInitialSize() { return new Point( DIALOG_WIDTH, DIALOG_HEIGHT ); }
private Point getButtonPosition() { return new Point( buttonColnr, buttonRownr ); }
@Override protected Point getInitialSize() { return new Point( DIALOG_WIDTH, DIALOG_HEIGHT ); }
private Point getThumb( Point area, Point max ) { Point thumb = new Point( 0, 0 ); if ( max.x <= area.x ) { thumb.x = 100; } else { thumb.x = Math.round( 100 * area.x / max.x ); } if ( max.y <= area.y ) { thumb.y = 100; } else { thumb.y = Math.round( 100 * area.y / max.y ); } return thumb; }
private Point getThumb( Point area, Point max ) { Point thumb = new Point( 0, 0 ); if ( max.x <= area.x ) { thumb.x = 100; } else { thumb.x = Math.round( 100 * area.x / max.x ); } if ( max.y <= area.y ) { thumb.y = 100; } else { thumb.y = Math.round( 100 * area.y / max.y ); } return thumb; }
private Point getMaximum() { int maxx = 0; int maxy = ( rows.size() + 10 ) * ( fontheight + 2 ); for ( int i = 0; i < rows.size(); i++ ) { String str = rows.get( i ); int len = ( str.length() + 10 ) * fontwidth; if ( maxx < len ) { maxx = len; } } return new Point( maxx, maxy ); }
private Point getMaximum() { int maxx = 0; int maxy = ( rows.size() + 10 ) * ( fontheight + 2 ); for ( int i = 0; i < rows.size(); i++ ) { String str = rows.get( i ); int len = ( str.length() + 10 ) * fontwidth; if ( maxx < len ) { maxx = len; } } return new Point( maxx, maxy ); }
private Point getArea() { Rectangle rect = getClientArea(); Point area = new Point( rect.width, rect.height ); return area; }
private Point getOffset( Point thumb, Point area ) { Point p = new Point( 0, 0 ); Point sel = new Point( hori.getSelection(), vert.getSelection() ); if ( thumb.x == 0 || thumb.y == 0 ) { return p; } p.x = Math.round( -sel.x * area.x / thumb.x ); p.y = Math.round( -sel.y * area.y / thumb.y ); return p; }
private Point getOffset( Point thumb, Point area ) { Point p = new Point( 0, 0 ); Point sel = new Point( hori.getSelection(), vert.getSelection() ); if ( thumb.x == 0 || thumb.y == 0 ) { return p; } p.x = Math.round( -sel.x * area.x / thumb.x ); p.y = Math.round( -sel.y * area.y / thumb.y ); return p; }
private Point getArea() { Rectangle rect = getClientArea(); Point area = new Point( rect.width, rect.height ); return area; }
public EnterPrintDialog( Shell parent, int nrcols, int nrrows, int scale, double factorX, double factorY, Rectangle m, double marginLeft, double marginRigth, double marginTop, double marginBottom, Image image ) { super( parent, SWT.NONE ); props = PropsUI.getInstance(); this.nrcols = nrcols; this.nrrows = nrrows; this.scale = scale; this.image = image; this.factorx = factorX; this.factory = factorY; this.leftMargin = marginLeft; this.rightMargin = marginRigth; this.topMargin = marginTop; this.bottomMargin = marginBottom; page = new Point( m.width, m.height ); }
private boolean willLicenseTextFit( String licenseText, GC gc ) { Point splashSize = splash.getSize(); Point licenseDrawLocation = new Point( 290, 290 ); Point requiredSize = gc.textExtent( licenseText ); int width = splashSize.x - licenseDrawLocation.x; int height = splashSize.y - licenseDrawLocation.y; boolean fitsVertically = width >= requiredSize.x; boolean fitsHorizontally = height >= requiredSize.y; return ( fitsVertically && fitsHorizontally ); }
private void showHelpTip( int x, int y, String tipTitle, String tipMessage ) { helpTip.setTitle( tipTitle ); helpTip.setMessage( tipMessage.replaceAll( "\n", Const.CR ) ); helpTip .setCheckBoxMessage( BaseMessages.getString( PKG, "TransGraph.HelpToolTip.DoNotShowAnyMoreCheckBox.Message" ) ); // helpTip.hide(); // int iconSize = spoon.props.getIconSize(); org.eclipse.swt.graphics.Point location = new org.eclipse.swt.graphics.Point( x - 5, y - 5 ); helpTip.show( location ); }
public void showTooltip( String label, Image image, int screenX, int screenY ) { toolTip.setImage( image ); toolTip.setText( label ); toolTip.hide(); toolTip.show( new org.eclipse.swt.graphics.Point( screenX, screenY ) ); }
private void showHelpTip( int x, int y, String tipTitle, String tipMessage ) { helpTip.setTitle( tipTitle ); helpTip.setMessage( tipMessage ); helpTip.setCheckBoxMessage( BaseMessages.getString( PKG, "JobGraph.HelpToolTip.DoNotShowAnyMoreCheckBox.Message" ) ); // helpTip.hide(); // int iconSize = spoon.props.getIconSize(); org.eclipse.swt.graphics.Point location = new org.eclipse.swt.graphics.Point( x - 5, y - 5 ); helpTip.show( location ); }
public void widgetSelected( SelectionEvent event ) { if ( list.getSelectionCount() <= 0 ) { return; } String name = list.getSelection()[0]; String value = variables.getVariable( name ); Rectangle shellBounds = shell.getBounds(); String message = BaseMessages.getString( PKG, "TextVar.VariableValue.Message", name, value ); if ( name.startsWith( Const.INTERNAL_VARIABLE_PREFIX ) ) { message += BaseMessages.getString( PKG, "TextVar.InternalVariable.Message" ); } toolTip.setText( message ); toolTip.hide(); toolTip.show( new Point( shellBounds.width, 0 ) ); } } );
private void treeDblClick( Event event ) { StyledTextComp wScript = getStyledTextComp(); Point point = new Point( event.x, event.y ); TreeItem item = wTree.getItem( point ); // Qualification where the Click comes from if ( item != null && item.getParentItem() != null ) { if ( item.getParentItem().equals( wTreeClassesItem ) ) { setActiveCtab( item.getText() ); } else if ( !item.getData().equals( "Snippit" ) ) { int iStart = wScript.getCaretOffset(); int selCount = wScript.getSelectionCount(); // this selection // will be replaced // by wScript.insert iStart = iStart - selCount; // when a selection is already there // we need to subtract the position if ( iStart < 0 ) { iStart = 0; // just safety } String strInsert = (String) item.getData(); wScript.insert( strInsert ); wScript.setSelection( iStart, iStart + strInsert.length() ); } } }
public void newFileDropDown() { // Drop down a list below the "New" icon (new.png) // First problem: where is that icon? XulToolbarbutton button = (XulToolbarbutton) this.mainToolbar.getElementById( "file-new" ); Object object = button.getManagedObject(); if ( object instanceof ToolItem ) { // OK, let's determine the location of this widget... // ToolItem item = (ToolItem) object; Rectangle bounds = item.getBounds(); org.eclipse.swt.graphics.Point p = item.getParent().toDisplay( new org.eclipse.swt.graphics.Point( bounds.x, bounds.y ) ); fileMenus.setLocation( p.x, p.y + bounds.height ); fileMenus.setVisible( true ); } }