本文整理汇总了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;
}
示例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;
}