Search in sources :

Example 41 with NotePadMeta

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;
}
Also used : RepositoryDirectory(org.pentaho.di.repository.RepositoryDirectory) NotePadMeta(org.pentaho.di.core.NotePadMeta) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) SlaveServer(org.pentaho.di.cluster.SlaveServer) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) Map(java.util.Map) HashMap(java.util.HashMap) Date(java.util.Date)

Example 42 with NotePadMeta

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;
}
Also used : NotePadMeta(org.pentaho.di.core.NotePadMeta) Point(org.pentaho.di.core.gui.Point) Point(org.pentaho.di.core.gui.Point)

Example 43 with NotePadMeta

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;
    }
}
Also used : NamedParamsDefault(org.pentaho.di.core.parameters.NamedParamsDefault) SlaveServer(org.pentaho.di.cluster.SlaveServer) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleFileException(org.pentaho.di.core.exception.KettleFileException) UnknownParamException(org.pentaho.di.core.parameters.UnknownParamException) LookupReferencesException(org.pentaho.di.core.exception.LookupReferencesException) FileSystemException(org.apache.commons.vfs2.FileSystemException) KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException) IdNotFoundException(org.pentaho.di.core.exception.IdNotFoundException) JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) NotePadMeta(org.pentaho.di.core.NotePadMeta)

Example 44 with NotePadMeta

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");
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) NotePadMeta(org.pentaho.di.core.NotePadMeta) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint)

Example 45 with NotePadMeta

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()]);
}
Also used : ArrayList(java.util.ArrayList) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) NotePadMeta(org.pentaho.di.core.NotePadMeta)

Aggregations

NotePadMeta (org.pentaho.di.core.NotePadMeta)63 Point (org.pentaho.di.core.gui.Point)39 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)34 StepMeta (org.pentaho.di.trans.step.StepMeta)26 KettleException (org.pentaho.di.core.exception.KettleException)25 JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)23 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)15 TransHopMeta (org.pentaho.di.trans.TransHopMeta)14 JobHopMeta (org.pentaho.di.job.JobHopMeta)11 ArrayList (java.util.ArrayList)10 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)10 SlaveServer (org.pentaho.di.cluster.SlaveServer)9 KettleStepException (org.pentaho.di.core.exception.KettleStepException)8 StepMetaInterface (org.pentaho.di.trans.step.StepMetaInterface)8 KettleRepositoryLostException (org.pentaho.di.repository.KettleRepositoryLostException)7 TransMeta (org.pentaho.di.trans.TransMeta)7 FileSystemException (org.apache.commons.vfs2.FileSystemException)6 KettleFileException (org.pentaho.di.core.exception.KettleFileException)6 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)6 StepErrorMeta (org.pentaho.di.trans.step.StepErrorMeta)6