当前位置: 首页>>代码示例>>Java>>正文


Java Condition.toString方法代码示例

本文整理汇总了Java中org.pentaho.di.core.Condition.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Condition.toString方法的具体用法?Java Condition.toString怎么用?Java Condition.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.core.Condition的用法示例。


在下文中一共展示了Condition.toString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawCondition

import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
private Point drawCondition(GC gc, int x, int y, int nr, Condition condition)
{
	int opx, opy, opw, oph;
	int cx, cy, cw, ch;
	
	opx = x;
	opy = y;
	opw = size_and_not.width + 6;
	oph = size_and_not.height + 2;

	/*
	 * First draw the operator ...
	 */
	if (nr>0)
	{
		String operator = condition.getOperatorDesc();
		// Remember the size of the rectangle!
		size_oper[nr] = new Rectangle(opx, opy, opw, oph);
		if (nr==hover_operator)
		{
			gc.setBackground(gray);
			gc.fillRectangle(Real2Screen(size_oper[nr]));
			gc.drawRectangle(Real2Screen(size_oper[nr]));
			gc.setBackground(bg);
		}
		gc.drawText(operator, size_oper[nr].x+2+offsetx, size_oper[nr].y+2+offsety, SWT.DRAW_TRANSPARENT );
	}
		
	/*
	 * Then draw the condition below, possibly negated!
	 */
	String str = condition.toString(0, true, false); // don't show the operator!
	Point p = gc.textExtent(str);

	cx = opx + 23;
	cy = opy + oph+10;
	cw = p.x +  5;
	ch = p.y +  5;

	// Remember the size of the rectangle!
	size_cond[nr] = new Rectangle(cx, cy, cw, ch);

	if (nr==hover_condition)
	{
		gc.setBackground(gray);
		gc.fillRectangle(Real2Screen(size_cond[nr]));
		gc.drawRectangle(Real2Screen(size_cond[nr]));
		gc.setBackground(bg);
	}
	gc.drawText(str, size_cond[nr].x+2+offsetx, size_cond[nr].y+5+offsety, SWT.DRAW_DELIMITER | SWT.DRAW_TRANSPARENT | SWT.DRAW_TAB | SWT.DRAW_MNEMONIC);

	p.x+=0;
	p.y+=5;

	return p;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:57,代码来源:ConditionEditor.java

示例2: drawCondition

import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
private Point drawCondition( GC gc, int x, int y, int nr, Condition condition ) {
  int opx, opy, opw, oph;
  int cx, cy, cw, ch;

  opx = x;
  opy = y;
  opw = size_and_not.width + 6;
  oph = size_and_not.height + 2;

  /*
   * First draw the operator ...
   */
  if ( nr > 0 ) {
    String operator = condition.getOperatorDesc();
    // Remember the size of the rectangle!
    size_oper[nr] = new Rectangle( opx, opy, opw, oph );
    if ( nr == hover_operator ) {
      gc.setBackground( gray );
      gc.fillRectangle( Real2Screen( size_oper[nr] ) );
      gc.drawRectangle( Real2Screen( size_oper[nr] ) );
      gc.setBackground( bg );
    }
    gc.drawText( operator, size_oper[nr].x + 2 + offsetx, size_oper[nr].y + 2 + offsety, SWT.DRAW_TRANSPARENT );
  }

  /*
   * Then draw the condition below, possibly negated!
   */
  String str = condition.toString( 0, true, false ); // don't show the operator!
  Point p = gc.textExtent( str );

  cx = opx + 23;
  cy = opy + oph + 10;
  cw = p.x + 5;
  ch = p.y + 5;

  // Remember the size of the rectangle!
  size_cond[nr] = new Rectangle( cx, cy, cw, ch );

  if ( nr == hover_condition ) {
    gc.setBackground( gray );
    gc.fillRectangle( Real2Screen( size_cond[nr] ) );
    gc.drawRectangle( Real2Screen( size_cond[nr] ) );
    gc.setBackground( bg );
  }
  gc.drawText( str, size_cond[nr].x + 2 + offsetx, size_cond[nr].y + 5 + offsety, SWT.DRAW_DELIMITER
    | SWT.DRAW_TRANSPARENT | SWT.DRAW_TAB | SWT.DRAW_MNEMONIC );

  p.x += 0;
  p.y += 5;

  return p;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:54,代码来源:ConditionEditor.java


注:本文中的org.pentaho.di.core.Condition.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。