本文整理汇总了Java中org.pentaho.di.core.gui.Point类的典型用法代码示例。如果您正苦于以下问题:Java Point类的具体用法?Java Point怎么用?Java Point使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point类属于org.pentaho.di.core.gui包,在下文中一共展示了Point类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateTransformationImage
import org.pentaho.di.core.gui.Point; //导入依赖的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: getNote
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
/**
* Find the note that is located on a certain point on the canvas.
*
* @param x the x-coordinate of the point queried
* @param y the y-coordinate of the point queried
* @return The note information if a note is located at the point. Otherwise, if nothing was found: null.
*/
public NotePadMeta getNote(int x, int y)
{
int i, s;
s = notes.size();
for (i = s - 1; i >= 0; i--) // Back to front because drawing goes from start to end
{
NotePadMeta ni = notes.get(i);
Point loc = ni.getLocation();
Point p = new Point(loc.x, loc.y);
if (x >= p.x && x <= p.x + ni.width + 2 * Const.NOTE_MARGIN && y >= p.y && y <= p.y + ni.height + 2 * Const.NOTE_MARGIN) { return ni; }
}
return null;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:21,代码来源:TransMeta.java
示例3: generateJobImage
import org.pentaho.di.core.gui.Point; //导入依赖的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
示例4: runLayout
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
public void runLayout( String id ) {
Spoon spoon = Spoon.getInstance();
// Either a Job or Transformation is active, both are AbstractGraphs
EngineMetaInterface meta = spoon.getActiveMeta();
if ( meta != null ) {
Point canvasDimensions = LayoutUtils.getGraphDimensions( meta );
Graph g = GraphUtils.createGraph( meta );
for ( LayoutProvider provider : providers ) {
if ( id.equals( provider.getId() ) ) {
provider.applyLayout( g, canvasDimensions.x, canvasDimensions.y );
LayoutUtils.applyGraphToMeta( g );
// Normalize layout so all steps/entries are visible on the canvas
LayoutUtils.fitToBounds( g );
return;
}
}
}
}
开发者ID:mattyb149,项目名称:pdi-layout,代码行数:22,代码来源:PdiLayoutManager.java
示例5: applyGraphToMeta
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
public static void applyGraphToMeta( Graph g ) {
if ( g != null ) {
for ( Vertex v : g.getVertices() ) {
GUIPositionInterface meta = v.getProperty( GraphUtils.PROPERTY_REF );
Point originaLocation = meta.getLocation();
int newX = v.getProperty( GraphUtils.PROPERTY_X );
int newY = v.getProperty( GraphUtils.PROPERTY_Y );
boolean changed = ( originaLocation.x != newX || originaLocation.y != newY );
if ( changed ) {
meta.setLocation( newX, newY );
( (StepMeta) meta ).setChanged( true );
}
}
}
getActiveGraph().redraw();
}
开发者ID:mattyb149,项目名称:pdi-layout,代码行数:20,代码来源:LayoutUtils.java
示例6: getRealPosition
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
public Point getRealPosition(Composite canvas, int x, int y) {
Point p = new Point(0, 0);
Composite follow = canvas;
while (follow != null) {
org.eclipse.swt.graphics.Point loc = follow.getLocation();
Point xy = new Point(loc.x, loc.y);
p.x += xy.x;
p.y += xy.y;
follow = follow.getParent();
}
int offsetX = -16;
int offsetY = -64;
if (Const.isOSX()) {
offsetX = -2;
offsetY = -24;
}
p.x = x - p.x + offsetX;
p.y = y - p.y + offsetY;
return screen2real(p.x, p.y);
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:TransGraph.java
示例7: getNote
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
public NotePadMeta getNote(int x, int y) {
int i, s;
s = notes.size();
for (i = s - 1; i >= 0; i--) // Back to front because drawing goes
// from start to end
{
NotePadMeta ni = notes.get(i);
Point loc = ni.getLocation();
Point p = new Point(loc.x, loc.y);
if (x >= p.x && x <= p.x + ni.width + 2 * Const.NOTE_MARGIN && y >= p.y
&& y <= p.y + ni.height + 2 * Const.NOTE_MARGIN) {
return ni;
}
}
return null;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:JobMeta.java
示例8: getStep
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
/**
* Find the step that is located on a certain point on the canvas, taking into account the icon size.
*
* @param x the x-coordinate of the point queried
* @param y the y-coordinate of the point queried
* @return The step information if a step is located at the point. Otherwise, if no step was found: null.
*/
public StepMeta getStep(int x, int y, int iconsize)
{
int i, s;
s = steps.size();
for (i = s - 1; i >= 0; i--) // Back to front because drawing goes from start to end
{
StepMeta stepMeta = steps.get(i);
if (partOfTransHop(stepMeta) || stepMeta.isDrawn()) // Only consider steps from active or inactive hops!
{
Point p = stepMeta.getLocation();
if (p != null)
{
if (x >= p.x && x <= p.x + iconsize && y >= p.y && y <= p.y + iconsize + 20) { return stepMeta; }
}
}
}
return null;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:26,代码来源:TransMeta.java
示例9: drawRect
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
protected void drawRect(Rectangle rect)
{
if (rect == null) return;
gc.setLineStyle(ELineStyle.DASHDOT);
gc.setLineWidth(linewidth);
gc.setForeground(EColor.GRAY);
// PDI-2619: SWT on Windows doesn't cater for negative rect.width/height so handle here.
Point s = real2screen(rect.x, rect.y);
if (rect.width < 0) {
s.x = s.x + rect.width;
}
if (rect.height < 0) {
s.y = s.y + rect.height;
}
gc.drawRectangle(s.x, s.y, Math.abs(rect.width), Math.abs(rect.height));
gc.setLineStyle(ELineStyle.SOLID);
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:BasePainter.java
示例10: getThumb
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
protected Point getThumb(Point area, Point transMax) {
Point resizedMax = magnifyPoint(transMax);
Point thumb = new Point(0, 0);
if (resizedMax.x <= area.x)
thumb.x = 100;
else
thumb.x = 100 * area.x / resizedMax.x;
if (resizedMax.y <= area.y)
thumb.y = 100;
else
thumb.y = 100 * area.y / resizedMax.y;
return thumb;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:17,代码来源:AbstractGraph.java
示例11: getLine
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
protected int[] getLine(JobEntryCopy fs, JobEntryCopy ts) {
if (fs == null || ts == null)
return null;
Point from = fs.getLocation();
Point to = ts.getLocation();
offset = getOffset();
int x1 = from.x + iconsize / 2;
int y1 = from.y + iconsize / 2;
int x2 = to.x + iconsize / 2;
int y2 = to.y + iconsize / 2;
return new int[] { x1, y1, x2, y2 };
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:JobGraph.java
示例12: drawRect
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
protected void drawRect(GC gc, Rectangle rect) {
if (rect == null)
return;
gc.setLineStyle(SWT.LINE_DASHDOT);
gc.setLineWidth(1);
gc.setForeground(GUIResource.getInstance().getColorDarkGray());
// PDI-2619: SWT on Windows doesn't cater for negative rect.width/height so handle here.
Point s = new Point(rect.x + offset.x, rect.y + offset.y);
if (rect.width < 0) {
s.x = s.x + rect.width;
}
if (rect.height < 0) {
s.y = s.y + rect.height;
}
gc.drawRectangle(s.x, s.y, Math.abs(rect.width), Math.abs(rect.height));
gc.setLineStyle(SWT.LINE_SOLID);
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:JobGraph.java
示例13: paintControl
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
public void paintControl(PaintEvent e) {
Point area = getArea();
if (area.x == 0 || area.y == 0)
return; // nothing to do!
Display disp = shell.getDisplay();
if (disp.isDisposed())
return; // Nothing to do!
Image img = new Image(disp, area.x, area.y);
GC gc = new GC(img);
drawJob(disp, gc, PropsUI.getInstance().isBrandingActive());
e.gc.drawImage(img, 0, 0);
gc.dispose();
img.dispose();
// spoon.setShellText();
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:JobGraph.java
示例14: newFileDropDown
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
public void newFileDropDown() {
// Drop down a list below the "New" icon (new.png)
// First problem: where is that icon?
XulToolbarbutton button = (XulToolbarbutton) this.mainToolbar.getElementById("file-new"); // = usedToolBar.getButtonById("file-new");
Object object = button.getManagedObject();
if (object instanceof ToolItem) {
// OK, let's determine the location of this widget...
//
ToolItem item = (ToolItem) object;
Rectangle bounds = item.getBounds();
org.eclipse.swt.graphics.Point p = item.getParent().toDisplay(
new org.eclipse.swt.graphics.Point(bounds.x, bounds.y));
fileMenus.setLocation(p.x, p.y + bounds.height);
fileMenus.setVisible(true);
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:Spoon.java
示例15: getThumb
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
private Point getThumb(Point area, Point transMax) {
Point resizedMax = magnifyPoint(transMax);
Point thumb = new Point(0, 0);
if (resizedMax.x <= area.x)
thumb.x = 100;
else
thumb.x = 100 * area.x / resizedMax.x;
if (resizedMax.y <= area.y)
thumb.y = 100;
else
thumb.y = 100 * area.y / resizedMax.y;
return thumb;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:JobGraph.java
示例16: printTransFile
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
private void printTransFile(TransMeta transMeta) {
TransGraph transGraph = getActiveTransGraph();
if (transGraph == null)
return;
PrintSpool ps = new PrintSpool();
Printer printer = ps.getPrinter(shell);
// Create an image of the screen
Point max = transMeta.getMaximum();
Image img = transGraph.getTransformationImage(printer, max.x, max.y, false, 1.0f);
ps.printImage(shell, img);
img.dispose();
ps.dispose();
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:Spoon.java
示例17: StepMeta
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
/**
* @param stepname The name of the new step
* @param stepMetaInterface The step metadata interface to use (TextFileInputMeta, etc)
*/
public StepMeta(String stepname, StepMetaInterface stepMetaInterface)
{
if (stepMetaInterface!=null)
{
this.stepid = PluginRegistry.getInstance().getPluginId(StepPluginType.class, stepMetaInterface);
}
this.stepname = stepname;
setStepMetaInterface( stepMetaInterface );
selected = false;
distributes = true;
copies = 1;
location = new Point(0,0);
drawstep = false;
description = null;
stepPartitioningMeta = new StepPartitioningMeta();
// targetStepPartitioningMeta = new StepPartitioningMeta();
clusterSchema = null; // non selected by default.
remoteInputSteps = new ArrayList<RemoteStep>();
remoteOutputSteps = new ArrayList<RemoteStep>();
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:28,代码来源:StepMeta.java
示例18: selectInRect
import org.pentaho.di.core.gui.Point; //导入依赖的package包/类
public void selectInRect(JobMeta jobMeta, org.pentaho.di.core.gui.Rectangle rect) {
int i;
for (i = 0; i < jobMeta.nrJobEntries(); i++) {
JobEntryCopy je = jobMeta.getJobEntry(i);
Point p = je.getLocation();
if (((p.x >= rect.x && p.x <= rect.x + rect.width) || (p.x >= rect.x + rect.width && p.x <= rect.x))
&& ((p.y >= rect.y && p.y <= rect.y + rect.height) || (p.y >= rect.y + rect.height && p.y <= rect.y)))
je.setSelected(true);
}
for (i = 0; i < jobMeta.nrNotes(); i++) {
NotePadMeta ni = jobMeta.getNote(i);
Point a = ni.getLocation();
Point b = new Point(a.x + ni.width, a.y + ni.height);
if (rect.contains(a.x, a.y) && rect.contains(b.x, b.y))
ni.setSelected(true);
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:JobGraph.java
示例19: callExtensionPoint
import org.pentaho.di.core.gui.Point; //导入依赖的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
示例20: callExtensionPoint
import org.pentaho.di.core.gui.Point; //导入依赖的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
注:本文中的org.pentaho.di.core.gui.Point类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论