本文整理汇总了Java中org.pentaho.di.core.gui.Point类的典型用法代码示例。如果您正苦于以下问题:Java Point类的具体用法?Java Point怎么用?Java Point使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point类属于org.pentaho.di.core.gui包,在下文中一共展示了Point类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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 };
}
示例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);
}
示例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();
}
示例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);
}
}
示例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;
}