org.eclipse.swt.graphics.Point.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.eclipse.swt.graphics.Point.<init>()方法的一些代码示例,展示了Point.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.<init>()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Point
类名称:Point
方法名:<init>

Point.<init>介绍

[英]Constructs a new point with the given x and y coordinates.
[中]用给定的x和y坐标构造一个新点。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

@Override
protected Point getInitialSize() {
 return new Point( DIALOG_WIDTH, DIALOG_HEIGHT );
}

代码示例来源:origin: pentaho/pentaho-kettle

private Point getButtonPosition() {
 return new Point( buttonColnr, buttonRownr );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
protected Point getInitialSize() {
 return new Point( DIALOG_WIDTH, DIALOG_HEIGHT );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public void menuDetected( MenuDetectEvent e ) {
 Point screen = new Point( e.x, e.y );
 Point widgetScreen = widget.toDisplay( 1, 1 );
 Point wRel = new Point( screen.x - widgetScreen.x, screen.y - widgetScreen.y );
 int area = getAreaCode( wRel );
 setMenu( area, wRel );
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
}

代码示例来源:origin: pentaho/pentaho-kettle

private Point getArea() {
 Rectangle rect = getClientArea();
 Point area = new Point( rect.width, rect.height );
 return area;
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

private Point getArea() {
 Rectangle rect = getClientArea();
 Point area = new Point( rect.width, rect.height );
 return area;
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
}

代码示例来源:origin: pentaho/pentaho-kettle

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 ) );
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
}

代码示例来源:origin: pentaho/pentaho-kettle

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 ) );
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

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() );
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
 }
}

相关文章