use of org.cristalise.kernel.lifecycle.instance.Activity in project kernel by cristal-ise.
the class ActivityDef method instantiate.
public WfVertex instantiate(String name) throws ObjectNotFoundException, InvalidDataException {
Activity act = new Activity();
act.setName(name);
configureInstance(act);
if (getItemPath() != null)
act.setType(getItemID());
return act;
}
use of org.cristalise.kernel.lifecycle.instance.Activity in project kernel by cristal-ise.
the class ActivityRenderer method draw.
/**
* Draws the Activity as a 3D rectangle without borders, with text lines for Name, DefinitionName, State, WaitTime and errors
*/
@Override
public void draw(Graphics2D g2d, Vertex vertex) {
Activity activity = (Activity) vertex;
boolean hasError = !activity.verify();
drawOutline3DRect(g2d, vertex, getActColor(activity, hasError));
// String description = activity.getDescription();
ArrayList<String> linesOfText = new ArrayList<String>();
String type = activity.getTypeName();
if (type != null)
linesOfText.add("(" + type + ")");
linesOfText.add(activity.getName());
if (hasError) {
linesOfText.add(activity.getErrors());
} else {
String stateName = "Invalid State";
try {
stateName = activity.getStateName();
} catch (InvalidDataException | NullPointerException ex) {
}
linesOfText.add(stateName + (" " + getWaitTime(activity.getStateDate())));
}
drawLinesOfTexts(g2d, vertex, linesOfText, mTextPaint);
}
Aggregations