• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JobPainter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.pentaho.di.job.JobPainter的典型用法代码示例。如果您正苦于以下问题:Java JobPainter类的具体用法?Java JobPainter怎么用?Java JobPainter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JobPainter类属于org.pentaho.di.job包,在下文中一共展示了JobPainter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: generateJobImage

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
/**
* 生成作业图 <br/>
* @author jingma
* @param jobMeta
* @return
* @throws Exception
*/
public static BufferedImage generateJobImage( JobMeta jobMeta ) throws Exception {
  float magnification = 1.0f;
  Point maximum = jobMeta.getMaximum();
  maximum.multiply( magnification );

  SwingGC gc = new SwingGC( null, maximum, 32, 0, 0 );
  JobPainter jobPainter =
    new JobPainter(
      gc, jobMeta, maximum, null, null, null, null, null, new ArrayList<AreaOwner>(),
      new ArrayList<JobEntryCopy>(), 32, 1, 0, 0, true, "Arial", 10 );
  jobPainter.setMagnification( magnification );
  jobPainter.drawJob();

  BufferedImage image = (BufferedImage) gc.getImage();

  return image;
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:25,代码来源:KettleUtils.java


示例2: generateJobImage

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
private BufferedImage generateJobImage( JobMeta jobMeta ) throws Exception {
  float magnification = 1.0f;
  Point maximum = jobMeta.getMaximum();
  maximum.multiply( magnification );

  SwingGC gc = new SwingGC( null, maximum, 32, 0, 0 );
  JobPainter jobPainter =
    new JobPainter(
      gc, jobMeta, maximum, null, null, null, null, null, new ArrayList<AreaOwner>(),
      new ArrayList<JobEntryCopy>(), 32, 1, 0, 0, true, "Arial", 10 );
  jobPainter.setMagnification( magnification );
  jobPainter.drawJob();

  BufferedImage image = (BufferedImage) gc.getImage();

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


示例3: callExtensionPoint

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
@Override
public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException {
  if ( !( object instanceof JobPainter ) ) {
    return;
  }
  int iconsize = PropsUI.getInstance().getIconSize();
  JobPainter painter = (JobPainter) object;
  Point offset = painter.getOffset();
  GCInterface gc = painter.getGc();
  JobMeta jobMeta = painter.getJobMeta();
  jobMeta.getJobCopies().stream().filter( je -> je.getAttribute( ATTR_GIT, ATTR_STATUS ) != null )
    .forEach( je -> {
      if ( jobMeta.getJobversion() == null ? false : jobMeta.getJobversion().startsWith( "git" ) ) {
        String status = je.getAttribute( ATTR_GIT, ATTR_STATUS );
        Point n = je.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 {
        je.getAttributesMap().remove( ATTR_GIT );
      }
    } );
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:32,代码来源:DrawDiffOnJobEntryExtensionPoint.java


示例4: loadValues

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
private JobInformationValues loadValues(ReportSubjectLocation location) throws KettleException {
	
	// Load the job
	//
	JobMeta jobMeta = loadJob(location);
	
	Point min = jobMeta.getMinimum();
	Point area = jobMeta.getMaximum();
	area.x+=30;
	area.y+=30;
	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);
	JobPainter painter = new JobPainter(gc, jobMeta, area, bar, bar, null, null, null, new ArrayList<AreaOwner>(), new ArrayList<JobEntryCopy>(), iconsize, 1, 0, 0, true, "FreeSans", 10);
	painter.setMagnification(0.25f);
	painter.drawJob();
    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
    	);

    JobInformationValues values = new JobInformationValues();
    values.jobMeta = jobMeta;
    values.image = image;
    
	return values;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:41,代码来源:JobInformation.java


示例5: drawImage

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
public void drawImage(final Graphics2D g2d, final Rectangle2D rectangle2d, ReportSubjectLocation location, boolean pixelateImages) throws KettleException {
  
  // Load the job
  //
  JobMeta jobMeta = loadJob(location);
  
  Point min = jobMeta.getMinimum();
  Point area = jobMeta.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);
  JobPainter painter = new JobPainter(gc, jobMeta, area, bar, bar, null, null, null, new ArrayList<AreaOwner>(), new ArrayList<JobEntryCopy>(), 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.drawJob();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:33,代码来源:JobInformation.java


示例6: generateJobImage

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
private BufferedImage generateJobImage(JobMeta jobMeta) throws Exception {
  float magnification = 1.0f;
  Point maximum = jobMeta.getMaximum();
  maximum.multiply(magnification);
  
  SwingGC gc = new SwingGC(null, maximum, 32, 0, 0);
  JobPainter jobPainter = new JobPainter(gc, jobMeta, maximum, null, null, 
      null, null, null, new ArrayList<AreaOwner>(), new ArrayList<JobEntryCopy>(), 32, 1, 0, 0, true, "Arial", 10);
  jobPainter.setMagnification(magnification);
  jobPainter.drawJob();
  
  BufferedImage image = (BufferedImage) gc.getImage();

  return image;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:16,代码来源:GetJobImageServlet.java


示例7: getJobImage

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
public Image getJobImage(Device device, int x, int y, float magnificationFactor) {
   GCInterface gc = new SWTGC(device, new Point(x, y), iconsize);

   JobPainter jobPainter = new JobPainter( gc,
   		jobMeta, new Point(x, y), new SwtScrollBar(hori), new SwtScrollBar(vert), hop_candidate, drop_candidate,
   		selectionRegion, 
   		areaOwners, 
   		mouseOverEntries,
		PropsUI.getInstance().getIconSize(),
		PropsUI.getInstance().getLineWidth(),
		PropsUI.getInstance().getCanvasGridSize(), 
		PropsUI.getInstance().getShadowSize(), 
		PropsUI.getInstance().isAntiAliasingEnabled(),
		PropsUI.getInstance().getNoteFont().getName(),
		PropsUI.getInstance().getNoteFont().getHeight()
   	);

   jobPainter.setMagnification(magnificationFactor);
   jobPainter.setEntryLogMap(entryLogMap);
   jobPainter.setStartHopEntry(startHopEntry);
   jobPainter.setEndHopLocation(endHopLocation);
   jobPainter.setEndHopEntry(endHopEntry);
   jobPainter.setNoInputEntry(noInputEntry);
   if (job!=null) {
   	jobPainter.setJobEntryResults(job.getJobEntryResults());
   } else {
   	jobPainter.setJobEntryResults(new ArrayList<JobEntryResult>());
   }
   
   List<JobEntryCopy> activeJobEntries = new ArrayList<JobEntryCopy>();
   if (job!=null) {
   	if (job.getActiveJobEntryJobs().size()>0) {
   	  activeJobEntries.addAll( job.getActiveJobEntryJobs().keySet() );
   	}
   	if (job.getActiveJobEntryTransformations().size()>0) {
   	  activeJobEntries.addAll( job.getActiveJobEntryTransformations().keySet() );
   	}
   }
   jobPainter.setActiveJobEntries(activeJobEntries);
   
   jobPainter.drawJob();
   
   return (Image) gc.getImage();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:45,代码来源:JobGraph.java


示例8: getJobImage

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
public Image getJobImage( 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;

  JobPainter jobPainter =
    new JobPainter(
      gc, jobMeta, new Point( x, y ), new SwtScrollBar( hori ), new SwtScrollBar( vert ), hop_candidate,
      drop_candidate, selectionRegion, areaOwners, mouseOverEntries, PropsUI.getInstance().getIconSize(),
      PropsUI.getInstance().getLineWidth(), gridSize, PropsUI
        .getInstance().getShadowSize(), PropsUI.getInstance().isAntiAliasingEnabled(), PropsUI
        .getInstance().getNoteFont().getName(), PropsUI.getInstance().getNoteFont().getHeight() );

  jobPainter.setMagnification( magnificationFactor );
  jobPainter.setEntryLogMap( entryLogMap );
  jobPainter.setStartHopEntry( startHopEntry );
  jobPainter.setEndHopLocation( endHopLocation );
  jobPainter.setEndHopEntry( endHopEntry );
  jobPainter.setNoInputEntry( noInputEntry );
  if ( job != null ) {
    jobPainter.setJobEntryResults( job.getJobEntryResults() );
  } else {
    jobPainter.setJobEntryResults( new ArrayList<JobEntryResult>() );
  }

  List<JobEntryCopy> activeJobEntries = new ArrayList<>();
  if ( job != null ) {
    if ( job.getActiveJobEntryJobs().size() > 0 ) {
      activeJobEntries.addAll( job.getActiveJobEntryJobs().keySet() );
    }
    if ( job.getActiveJobEntryTransformations().size() > 0 ) {
      activeJobEntries.addAll( job.getActiveJobEntryTransformations().keySet() );
    }
  }
  jobPainter.setActiveJobEntries( activeJobEntries );

  jobPainter.drawJob();

  return (Image) gc.getImage();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:42,代码来源:JobGraph.java


示例9: loadValues

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
private JobInformationValues loadValues( ReportSubjectLocation location ) throws KettleException {

    // Load the job
    //
    JobMeta jobMeta = loadJob( location );

    Point min = jobMeta.getMinimum();
    Point area = jobMeta.getMaximum();
    area.x += 30;
    area.y += 30;
    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>();
    JobPainter painter =
      new JobPainter(
        gc, jobMeta, area, bar, bar, null, null, null, areaOwners, new ArrayList<JobEntryCopy>(), iconsize, 1,
        0, 0, true, "FreeSans", 10 );
    painter.setMagnification( 0.25f );
    painter.drawJob();
    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 );

    JobInformationValues values = new JobInformationValues();
    values.jobMeta = jobMeta;
    values.image = image;
    values.areaOwners = areaOwners;

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


示例10: drawImage

import org.pentaho.di.job.JobPainter; //导入依赖的package包/类
public void drawImage( final Graphics2D g2d, final Rectangle2D rectangle2d, ReportSubjectLocation location,
  boolean pixelateImages ) throws KettleException {

  // Load the job
  //
  JobMeta jobMeta = loadJob( location );

  Point min = jobMeta.getMinimum();
  Point area = jobMeta.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 );
  List<AreaOwner> areaOwners = new ArrayList<AreaOwner>();
  JobPainter painter =
      new JobPainter( gc, jobMeta, area, bar, bar, null, null, null, areaOwners, new ArrayList<JobEntryCopy>(),
          iconsize, 1, 0, 0, true, "FreeSans", 10 );

  painter.setMagnification( magnification );

  painter.setTranslationX( ( -min.x ) * magnification );
  painter.setTranslationY( ( -min.y ) * magnification );

  painter.drawJob();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:46,代码来源:JobInformation.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EMChatOptions类代码示例发布时间:2022-05-23
下一篇:
Java AnnotationTag类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap