use of org.pentaho.di.core.NotePadMeta in project pentaho-kettle by pentaho.
the class AbstractMeta method clear.
public void clear() {
setName(null);
setFilename(null);
notes = new ArrayList<NotePadMeta>();
databases = new ArrayList<DatabaseMeta>();
slaveServers = new ArrayList<SlaveServer>();
channelLogTable = ChannelLogTable.getDefault(this, this);
attributesMap = new HashMap<String, Map<String, String>>();
max_undo = Const.MAX_UNDO;
clearUndo();
clearChanged();
setChanged(false);
channelLogTable = ChannelLogTable.getDefault(this, this);
createdUser = "-";
createdDate = new Date();
modifiedUser = "-";
modifiedDate = new Date();
directory = new RepositoryDirectory();
description = null;
extendedDescription = null;
}
use of org.pentaho.di.core.NotePadMeta in project pentaho-kettle by pentaho.
the class AbstractMeta method getNote.
/**
* 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;
}
use of org.pentaho.di.core.NotePadMeta in project pentaho-kettle by pentaho.
the class JobMeta method realClone.
/**
* Perform a real clone of the job meta-data object, including cloning all lists and copying all values. If the
* doClear parameter is true, the clone will be cleared of ALL values before the copy. If false, only the copied
* fields will be cleared.
*
* @param doClear Whether to clear all of the clone's data before copying from the source object
* @return a real clone of the calling object
*/
public Object realClone(boolean doClear) {
try {
JobMeta jobMeta = (JobMeta) super.clone();
if (doClear) {
jobMeta.clear();
} else {
jobMeta.jobcopies = new ArrayList<JobEntryCopy>();
jobMeta.jobhops = new ArrayList<JobHopMeta>();
jobMeta.notes = new ArrayList<NotePadMeta>();
jobMeta.databases = new ArrayList<DatabaseMeta>();
jobMeta.slaveServers = new ArrayList<SlaveServer>();
jobMeta.namedParams = new NamedParamsDefault();
}
for (JobEntryCopy entry : jobcopies) {
jobMeta.jobcopies.add((JobEntryCopy) entry.clone_deep());
}
for (JobHopMeta entry : jobhops) {
jobMeta.jobhops.add((JobHopMeta) entry.clone());
}
for (NotePadMeta entry : notes) {
jobMeta.notes.add((NotePadMeta) entry.clone());
}
for (DatabaseMeta entry : databases) {
jobMeta.databases.add((DatabaseMeta) entry.clone());
}
for (SlaveServer slave : slaveServers) {
jobMeta.getSlaveServers().add((SlaveServer) slave.clone());
}
for (String key : listParameters()) {
jobMeta.addParameterDefinition(key, getParameterDefault(key), getParameterDescription(key));
}
return jobMeta;
} catch (Exception e) {
return null;
}
}
use of org.pentaho.di.core.NotePadMeta in project pentaho-kettle by pentaho.
the class JobMeta method selectAll.
/**
* Select all.
*/
public void selectAll() {
int i;
for (i = 0; i < nrJobEntries(); i++) {
JobEntryCopy ce = getJobEntry(i);
ce.setSelected(true);
}
for (i = 0; i < nrNotes(); i++) {
NotePadMeta ni = getNote(i);
ni.setSelected(true);
}
setChanged();
notifyObservers("refreshGraph");
}
use of org.pentaho.di.core.NotePadMeta in project pentaho-kettle by pentaho.
the class JobMeta method getSelectedNoteLocations.
/**
* Get all the selected note locations
*
* @return The selected step and notes locations.
*/
public Point[] getSelectedNoteLocations() {
List<Point> points = new ArrayList<Point>();
for (NotePadMeta ni : getSelectedNotes()) {
Point p = ni.getLocation();
// explicit copy of location
points.add(new Point(p.x, p.y));
}
return points.toArray(new Point[points.size()]);
}
Aggregations