本文整理汇总了Java中org.pentaho.di.trans.TransPainter类的典型用法代码示例。如果您正苦于以下问题:Java TransPainter类的具体用法?Java TransPainter怎么用?Java TransPainter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransPainter类属于org.pentaho.di.trans包,在下文中一共展示了TransPainter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateTransformationImage
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
/**
* 生成转换图 <br/>
* @author jingma
* @param transMeta
* @return
* @throws Exception
*/
public static BufferedImage generateTransformationImage( TransMeta transMeta ) throws Exception {
float magnification = 1.0f;
Point maximum = transMeta.getMaximum();
maximum.multiply( magnification );
SwingGC gc = new SwingGC( null, maximum, 32, 0, 0 );
TransPainter transPainter =
new TransPainter(
gc, transMeta, maximum, null, null, null, null, null, new ArrayList<AreaOwner>(),
new ArrayList<StepMeta>(), 32, 1, 0, 0, true, "Arial", 10 );
transPainter.setMagnification( magnification );
transPainter.buildTransformationImage();
BufferedImage image = (BufferedImage) gc.getImage();
return image;
}
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:25,代码来源:KettleUtils.java
示例2: callExtensionPoint
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
@Override
public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException {
if ( !( object instanceof TransPainter ) ) {
return;
}
int iconsize = PropsUI.getInstance().getIconSize();
TransPainter painter = (TransPainter) object;
Point offset = painter.getOffset();
GCInterface gc = painter.getGc();
TransMeta transMeta = painter.getTransMeta();
transMeta.getSteps().stream().filter( step -> step.getAttribute( ATTR_GIT, ATTR_STATUS ) != null )
.forEach( step -> {
if ( transMeta.getTransversion() == null ? false : transMeta.getTransversion().startsWith( "git" ) ) {
String status = step.getAttribute( ATTR_GIT, ATTR_STATUS );
Point n = step.getLocation();
String location = "org/pentaho/di/git/spoon/images/";
if ( status.equals( REMOVED ) ) {
location += "removed.svg";
} else if ( status.equals( CHANGED ) ) {
location += "changed.svg";
} else if ( status.equals( ADDED ) ) {
location += "added.svg";
} else { // Unchanged
return;
}
gc.drawImage( location, getClass().getClassLoader(), ( n.x + iconsize + offset.x ) - ( BasePainter.MINI_ICON_SIZE / 2 ), n.y + offset.y - ( BasePainter.MINI_ICON_SIZE / 2 ) );
} else {
step.getAttributesMap().remove( ATTR_GIT );
}
} );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:32,代码来源:DrawDiffOnStepExtensionPoint.java
示例3: callExtensionPoint
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
@Override
public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException {
if ( !( object instanceof TransPainter ) ) {
return;
}
TransPainter painter = (TransPainter) object;
TransMeta transMeta = painter.getTransMeta();
String testName = transMeta.getAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_TRANS_SELECTED_UNIT_TEST_NAME);
// System.out.println("Drawing unit test usage/editing : '"+testName+"'");
drawUnitTestName( painter, transMeta, testName );
}
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:13,代码来源:DrawUnitTestOnTransExtentionPoint.java
示例4: 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();
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:35,代码来源:TransformationInformation.java
示例5: addToolBar
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
private void addToolBar() {
try {
toolbar = (XulToolbar) getXulDomContainer().getDocumentRoot().getElementById("nav-toolbar");
ToolBar swtToolbar = (ToolBar) toolbar.getManagedObject();
swtToolbar.pack();
// Hack alert : more XUL limitations...
//
ToolItem sep = new ToolItem(swtToolbar, SWT.SEPARATOR);
zoomLabel = new Combo(swtToolbar, SWT.DROP_DOWN);
zoomLabel.setItems(TransPainter.magnificationDescriptions);
zoomLabel.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
readMagnification();
}
});
zoomLabel.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent event) {
if (event.character == SWT.CR) {
readMagnification();
}
}
});
setZoomLabel();
zoomLabel.pack();
sep.setWidth(80);
sep.setControl(zoomLabel);
swtToolbar.pack();
} catch (Throwable t) {
log.logError(Const.getStackTracker(t));
new ErrorDialog(shell, BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Title"),
BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Message", XUL_FILE_JOB_GRAPH), new Exception(t));
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:41,代码来源:JobGraph.java
示例6: getTransformationImage
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
public Image getTransformationImage(Device device, int x, int y, float magnificationFactor) {
GCInterface gc = new SWTGC(device, new Point(x, y), iconsize);
TransPainter transPainter = new TransPainter( gc,
transMeta, new Point(x, y), new SwtScrollBar(hori), new SwtScrollBar(vert), candidate, drop_candidate,
selectionRegion,
areaOwners,
mouseOverSteps,
PropsUI.getInstance().getIconSize(),
PropsUI.getInstance().getLineWidth(),
PropsUI.getInstance().getCanvasGridSize(),
PropsUI.getInstance().getShadowSize(),
PropsUI.getInstance().isAntiAliasingEnabled(),
PropsUI.getInstance().getNoteFont().getName(),
PropsUI.getInstance().getNoteFont().getHeight(),
trans,
PropsUI.getInstance().isIndicateSlowTransStepsEnabled()
);
transPainter.setMagnification(magnificationFactor);
transPainter.setStepLogMap(stepLogMap);
transPainter.setStartHopStep(startHopStep);
transPainter.setEndHopLocation(endHopLocation);
transPainter.setNoInputStep(noInputStep);
transPainter.setEndHopStep(endHopStep);
transPainter.setCandidateHopType(candidateHopType);
transPainter.setStartErrorHopStep(startErrorHopStep);
transPainter.setShowTargetStreamsStep(showTargetStreamsStep);
transPainter.buildTransformationImage();
Image img = (Image)gc.getImage();
gc.dispose();
return img;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:TransGraph.java
示例7: generateTransformationImage
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
private BufferedImage generateTransformationImage(TransMeta transMeta) throws Exception {
float magnification = 1.0f;
Point maximum = transMeta.getMaximum();
maximum.multiply(magnification);
SwingGC gc = new SwingGC(null, maximum, 32, 0, 0);
TransPainter transPainter = new TransPainter(gc, transMeta, maximum, null, null,
null, null, null, new ArrayList<AreaOwner>(), new ArrayList<StepMeta>(), 32, 1, 0, 0, true, "Arial", 10);
transPainter.setMagnification(magnification);
transPainter.buildTransformationImage();
BufferedImage image = (BufferedImage) gc.getImage();
return image;
}
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:16,代码来源:GetTransImageServlet.java
示例8: generateTransformationImage
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
private BufferedImage generateTransformationImage( TransMeta transMeta ) throws Exception {
float magnification = 1.0f;
Point maximum = transMeta.getMaximum();
maximum.multiply( magnification );
SwingGC gc = new SwingGC( null, maximum, 32, 0, 0 );
TransPainter transPainter =
new TransPainter(
gc, transMeta, maximum, null, null, null, null, null, new ArrayList<AreaOwner>(),
new ArrayList<StepMeta>(), 32, 1, 0, 0, true, "Arial", 10 );
transPainter.setMagnification( magnification );
transPainter.buildTransformationImage();
return (BufferedImage) gc.getImage();
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:16,代码来源:GetTransImageServlet.java
示例9: getTransformationImage
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
public Image getTransformationImage( Device device, int x, int y, float magnificationFactor ) {
GCInterface gc = new SWTGC( device, new Point( x, y ), iconsize );
int gridSize =
PropsUI.getInstance().isShowCanvasGridEnabled() ? PropsUI.getInstance().getCanvasGridSize() : 1;
TransPainter transPainter =
new TransPainter( gc, transMeta, new Point( x, y ), new SwtScrollBar( hori ), new SwtScrollBar( vert ),
candidate, drop_candidate, selectionRegion, areaOwners, mouseOverSteps,
PropsUI.getInstance().getIconSize(), PropsUI.getInstance().getLineWidth(), gridSize,
PropsUI.getInstance().getShadowSize(), PropsUI.getInstance()
.isAntiAliasingEnabled(), PropsUI.getInstance().getNoteFont().getName(), PropsUI.getInstance()
.getNoteFont().getHeight(), trans, PropsUI.getInstance().isIndicateSlowTransStepsEnabled() );
transPainter.setMagnification( magnificationFactor );
transPainter.setStepLogMap( stepLogMap );
transPainter.setStartHopStep( startHopStep );
transPainter.setEndHopLocation( endHopLocation );
transPainter.setNoInputStep( noInputStep );
transPainter.setEndHopStep( endHopStep );
transPainter.setCandidateHopType( candidateHopType );
transPainter.setStartErrorHopStep( startErrorHopStep );
transPainter.setShowTargetStreamsStep( showTargetStreamsStep );
transPainter.buildTransformationImage();
Image img = (Image) gc.getImage();
gc.dispose();
return img;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:33,代码来源:TransGraph.java
示例10: 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);
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(0.5f);
painter.setTranslationX(min.x);
painter.setTranslationX(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;
return values;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:44,代码来源:TransformationInformation.java
示例11: mouseDoubleClick
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
public void mouseDoubleClick(MouseEvent e) {
clearSettings();
Point real = screen2real(e.x, e.y);
// Hide the tooltip!
hideToolTips();
StepMeta stepMeta = transMeta.getStep(real.x, real.y, iconsize);
if (stepMeta != null) {
if (e.button == 1) {
editStep(stepMeta);
}
else {
editDescription(stepMeta);
}
} else {
// Check if point lies on one of the many hop-lines...
TransHopMeta online = findHop(real.x, real.y);
if (online != null) {
editHop(online);
} else {
NotePadMeta ni = transMeta.getNote(real.x, real.y);
if (ni != null) {
selectedNote = null;
editNote(ni);
} else {
// See if the double click was in one of the area's...
//
for (AreaOwner areaOwner : areaOwners) {
if (areaOwner.contains(real.x, real.y)) {
if (areaOwner.getParent() instanceof StepMeta
&& areaOwner.getOwner().equals(TransPainter.STRING_PARTITIONING_CURRENT_STEP)) {
StepMeta step = (StepMeta) areaOwner.getParent();
spoon.editPartitioning(transMeta, step);
break;
}
}
}
}
}
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:45,代码来源:TransGraph.java
示例12: addToolBar
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
private void addToolBar() {
try {
toolbar = (XulToolbar) getXulDomContainer().getDocumentRoot().getElementById("nav-toolbar"); //$NON-NLS-1$
ToolBar swtToolbar = (ToolBar) toolbar.getManagedObject();
swtToolbar.pack();
// Hack alert : more XUL limitations...
// TODO: no longer a limitation use toolbaritem
//
ToolItem sep = new ToolItem(swtToolbar, SWT.SEPARATOR);
zoomLabel = new Combo(swtToolbar, SWT.DROP_DOWN);
zoomLabel.setItems(TransPainter.magnificationDescriptions);
zoomLabel.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent arg0) {
readMagnification();
}
});
zoomLabel.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent event) {
if (event.character == SWT.CR) {
readMagnification();
}
}
});
setZoomLabel();
zoomLabel.pack();
sep.setWidth(80);
sep.setControl(zoomLabel);
swtToolbar.pack();
} catch (Throwable t) {
log.logError("Error loading the navigation toolbar for Spoon", t);
new ErrorDialog(shell, BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Title"), //$NON-NLS-1$
BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Message", XUL_FILE_TRANS_TOOLBAR), new Exception(t)); //$NON-NLS-1$
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:42,代码来源:TransGraph.java
示例13: mouseDoubleClick
import org.pentaho.di.trans.TransPainter; //导入依赖的package包/类
@Override
public void mouseDoubleClick( MouseEvent e ) {
clearSettings();
Point real = screen2real( e.x, e.y );
// Hide the tooltip!
hideToolTips();
try {
ExtensionPointHandler.callExtensionPoint( LogChannel.GENERAL, KettleExtensionPoint.TransGraphMouseDoubleClick.id,
new TransGraphExtension( this, e, real ) );
} catch ( Exception ex ) {
LogChannel.GENERAL.logError( "Error calling TransGraphMouseDoubleClick extension point", ex );
}
StepMeta stepMeta = transMeta.getStep( real.x, real.y, iconsize );
if ( stepMeta != null ) {
if ( e.button == 1 ) {
editStep( stepMeta );
} else {
editDescription( stepMeta );
}
} else {
// Check if point lies on one of the many hop-lines...
TransHopMeta online = findHop( real.x, real.y );
if ( online != null ) {
editHop( online );
} else {
NotePadMeta ni = transMeta.getNote( real.x, real.y );
if ( ni != null ) {
selectedNote = null;
editNote( ni );
} else {
// See if the double click was in one of the area's...
//
boolean hit = false;
for ( AreaOwner areaOwner : areaOwners ) {
if ( areaOwner.contains( real.x, real.y ) ) {
if ( areaOwner.getParent() instanceof StepMeta
&& areaOwner.getOwner().equals( TransPainter.STRING_PARTITIONING_CURRENT_STEP ) ) {
StepMeta step = (StepMeta) areaOwner.getParent();
spoon.editPartitioning( transMeta, step );
hit = true;
break;
}
}
}
if ( !hit ) {
settings();
}
}
}
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:58,代码来源:TransGraph.java
示例14: 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;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:48,代码来源:TransformationInformation.java
示例15: 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();
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:46,代码来源:TransformationInformation.java
注:本文中的org.pentaho.di.trans.TransPainter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论