use of org.pentaho.di.core.gui.Point in project pentaho-kettle by pentaho.
the class JobEntryCopy method replaceMeta.
public void replaceMeta(JobEntryCopy jobEntryCopy) {
entry = (JobEntryInterface) jobEntryCopy.entry.clone();
// Copy nr. 0 is the base copy...
nr = jobEntryCopy.nr;
selected = jobEntryCopy.selected;
if (jobEntryCopy.location != null) {
location = new Point(jobEntryCopy.location.x, jobEntryCopy.location.y);
}
launchingInParallel = jobEntryCopy.launchingInParallel;
draw = jobEntryCopy.draw;
id = jobEntryCopy.id;
setChanged();
}
use of org.pentaho.di.core.gui.Point in project pentaho-kettle by pentaho.
the class JobMeta method getMaximum.
/**
* Gets the maximum.
*
* @return the maximum
*/
public Point getMaximum() {
int maxx = 0, maxy = 0;
for (int i = 0; i < nrJobEntries(); i++) {
JobEntryCopy entry = getJobEntry(i);
Point loc = entry.getLocation();
if (loc.x > maxx) {
maxx = loc.x;
}
if (loc.y > maxy) {
maxy = loc.y;
}
}
for (int i = 0; i < nrNotes(); i++) {
NotePadMeta ni = getNote(i);
Point loc = ni.getLocation();
if (loc.x + ni.width > maxx) {
maxx = loc.x + ni.width;
}
if (loc.y + ni.height > maxy) {
maxy = loc.y + ni.height;
}
}
return new Point(maxx + 100, maxy + 100);
}
use of org.pentaho.di.core.gui.Point in project pentaho-kettle by pentaho.
the class JobMeta method getMinimum.
/**
* Get the minimum point on the canvas of a job
*
* @return Minimum coordinate of a step in the job
*/
public Point getMinimum() {
int minx = Integer.MAX_VALUE;
int miny = Integer.MAX_VALUE;
for (int i = 0; i < nrJobEntries(); i++) {
JobEntryCopy jobEntryCopy = getJobEntry(i);
Point loc = jobEntryCopy.getLocation();
if (loc.x < minx) {
minx = loc.x;
}
if (loc.y < miny) {
miny = loc.y;
}
}
for (int i = 0; i < nrNotes(); i++) {
NotePadMeta notePadMeta = getNote(i);
Point loc = notePadMeta.getLocation();
if (loc.x < minx) {
minx = loc.x;
}
if (loc.y < miny) {
miny = loc.y;
}
}
if (minx > BORDER_INDENT && minx != Integer.MAX_VALUE) {
minx -= BORDER_INDENT;
} else {
minx = 0;
}
if (miny > BORDER_INDENT && miny != Integer.MAX_VALUE) {
miny -= BORDER_INDENT;
} else {
miny = 0;
}
return new Point(minx, miny);
}
use of org.pentaho.di.core.gui.Point in project pentaho-kettle by pentaho.
the class JobMeta method getSelectedLocations.
/**
* Gets the selected locations.
*
* @return the selected locations
*/
public Point[] getSelectedLocations() {
List<JobEntryCopy> selectedEntries = getSelectedEntries();
Point[] retval = new Point[selectedEntries.size()];
for (int i = 0; i < retval.length; i++) {
JobEntryCopy si = selectedEntries.get(i);
Point p = si.getLocation();
// explicit copy of location
retval[i] = new Point(p.x, p.y);
}
return retval;
}
use of org.pentaho.di.core.gui.Point in project pentaho-kettle by pentaho.
the class JobMeta method getJobEntryCopy.
/**
* Gets the job entry copy.
*
* @param x the x
* @param y the y
* @param iconsize the iconsize
* @return the job entry copy
*/
public JobEntryCopy getJobEntryCopy(int x, int y, int iconsize) {
int i, s;
s = nrJobEntries();
for (i = s - 1; i >= 0; i--) {
// Back to front because drawing goes from start to end
JobEntryCopy je = getJobEntry(i);
Point p = je.getLocation();
if (p != null) {
if (x >= p.x && x <= p.x + iconsize && y >= p.y && y <= p.y + iconsize) {
return je;
}
}
}
return null;
}
Aggregations