本文整理汇总了Java中org.pentaho.di.trans.TransPainter.setTranslationY方法的典型用法代码示例。如果您正苦于以下问题:Java TransPainter.setTranslationY方法的具体用法?Java TransPainter.setTranslationY怎么用?Java TransPainter.setTranslationY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.trans.TransPainter
的用法示例。
在下文中一共展示了TransPainter.setTranslationY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawImage
import org.pentaho.di.trans.TransPainter; //导入方法依赖的package包/类
public void drawImage(final Graphics2D g2d, final Rectangle2D rectangle2d, ReportSubjectLocation location, boolean pixelateImages) throws KettleException {
// Load the transformation
//
TransMeta transMeta = loadTransformation(location);
Point min = transMeta.getMinimum();
Point area = transMeta.getMaximum();
int iconsize = 32;
ScrollBarInterface bar = new ScrollBarInterface() {
public void setThumb(int thumb) {}
public int getSelection() { return 0; }
};
// Paint the transformation...
//
Rectangle rect = new java.awt.Rectangle(0,0,area.x, area.y);
double magnificationX = rectangle2d.getWidth()/rect.getWidth();
double magnificationY = rectangle2d.getHeight()/rect.getHeight();
double magnification = Math.min(magnificationX, magnificationY);
SwingGC gc = new SwingGC(g2d, rect, iconsize, 0, 0);
gc.setDrawingPixelatedImages(pixelateImages);
TransPainter painter = new TransPainter(gc, transMeta, area, bar, bar, null, null, null, new ArrayList<AreaOwner>(), new ArrayList<StepMeta>(),
iconsize, 1, 0, 0, true, "FreeSans", 10);
painter.setMagnification((float)Math.min(magnification, 1));
if (pixelateImages) {
painter.setTranslationX(100+min.x);
painter.setTranslationY(100+min.y);
}
painter.buildTransformationImage();
}
示例2: loadValues
import org.pentaho.di.trans.TransPainter; //导入方法依赖的package包/类
private TransformationInformationValues loadValues( ReportSubjectLocation location ) throws KettleException {
// Load the transformation
//
TransMeta transMeta = loadTransformation( location );
Point min = transMeta.getMinimum();
Point area = transMeta.getMaximum();
area.x += 100;
area.y += 100;
int iconsize = 32;
ScrollBarInterface bar = new ScrollBarInterface() {
public void setThumb( int thumb ) {
}
public int getSelection() {
return 0;
}
};
// Paint the transformation...
//
GCInterface gc = new SwingGC( null, area, iconsize, 50, 20 );
List<AreaOwner> areaOwners = new ArrayList<AreaOwner>();
TransPainter painter =
new TransPainter(
gc, transMeta, area, bar, bar, null, null, null, areaOwners, new ArrayList<StepMeta>(), iconsize, 1,
0, 0, true, "FreeSans", 10 );
painter.setMagnification( 0.5f );
painter.setTranslationX( min.x );
painter.setTranslationY( min.y );
painter.buildTransformationImage();
BufferedImage bufferedImage = (BufferedImage) gc.getImage();
int newWidth = bufferedImage.getWidth() - min.x;
int newHeigth = bufferedImage.getHeight() - min.y;
BufferedImage image = new BufferedImage( newWidth, newHeigth, bufferedImage.getType() );
image.getGraphics().drawImage(
bufferedImage, 0, 0, newWidth, newHeigth, min.x, min.y, min.x + newWidth, min.y + newHeigth, null );
TransformationInformationValues values = new TransformationInformationValues();
values.transMeta = transMeta;
values.image = image;
values.areaOwners = areaOwners;
return values;
}
示例3: drawImage
import org.pentaho.di.trans.TransPainter; //导入方法依赖的package包/类
public void drawImage( final Graphics2D g2d, final Rectangle2D rectangle2d, ReportSubjectLocation location,
boolean pixelateImages ) throws KettleException {
// Load the transformation
//
TransMeta transMeta = loadTransformation( location );
Point min = transMeta.getMinimum();
Point area = transMeta.getMaximum();
area.x -= min.x;
area.y -= min.y;
int iconsize = 32;
ScrollBarInterface bar = new ScrollBarInterface() {
public void setThumb( int thumb ) {
}
public int getSelection() {
return 0;
}
};
// Paint the transformation...
//
Rectangle rect = new java.awt.Rectangle( 0, 0, area.x, area.y );
double magnificationX = rectangle2d.getWidth() / rect.getWidth();
double magnificationY = rectangle2d.getHeight() / rect.getHeight();
float magnification = (float) Math.min( 1, Math.min( magnificationX, magnificationY ) );
SwingGC gc = new SwingGC( g2d, rect, iconsize, 0, 0 );
gc.setDrawingPixelatedImages( pixelateImages );
TransPainter painter =
new TransPainter( gc, transMeta, area, bar, bar, null, null, null, new ArrayList<AreaOwner>(),
new ArrayList<StepMeta>(), iconsize, 1, 0, 0, true, "FreeSans", 10 );
painter.setMagnification( magnification );
painter.setTranslationX( ( -min.x ) * magnification );
painter.setTranslationY( ( -min.y ) * magnification );
painter.buildTransformationImage();
}