public class TaskLayoutUtils
extends java.lang.Object
Constructor and Description |
---|
TaskLayoutUtils() |
Modifier and Type | Method and Description |
---|---|
static TRectangle |
getBoundingBox(Task[] tasks) |
static TPoint |
getPosition(Tool task) |
static TPoint |
getPosition(Tool task,
TaskLayoutDetails layout) |
static Task |
replaceTask(Task curtask,
Tool newtool,
boolean rename)
Replaces a current task with a new tool (instance id is preserved)
|
static Task |
replaceTask(Task curtask,
Tool newtool,
boolean rename,
boolean preserveinst)
Replaces a current task with a new tool.
|
static void |
resolveGroupNodes(TaskGraph taskgraph)
Sets unconnected task nodes as group input/output nodes.
|
static void |
setPosition(Task task,
TPoint pos)
Sets the position of the specified task using Triana's co-ordinate system.
|
static void |
setPosition(Task task,
TPoint pos,
TaskLayoutDetails details)
Sets the position of the specified task on the triana workspace using the specified task layout details.
|
static void |
setPosition(Tool tool,
TPoint pos)
Sets the position of the specified task using Triana's co-ordinate system.
|
static void |
setPosition(Tool tool,
TPoint pos,
TaskLayoutDetails details)
Sets the position of the specified task on the triana workspace using the specified task layout details.
|
static void |
translate(Task[] tasks,
double xdist,
double ydist)
Translates the specified tasks by the specified x and y distances
|
static void |
translate(Task[] tasks,
int xdist,
int ydist,
TaskLayoutDetails details)
Translates the specified tasks by the specified x and y distances
|
static void |
translate(Task task,
double xdist,
double ydist)
Translates the task by the specified x and y distances
|
static void |
translateTo(Task[] tasks,
TPoint point)
Translates the specified tasks so that the top lefthand corner is at the specified point
|
static void |
translateToOrigin(Task[] tasks)
Translates the specified tasks so that the top lefthand corner is at the origin (x=0, y=0).
|
static void |
translateToOrigin(Task[] tasks,
int border) |
public static TPoint getPosition(Tool task)
public static TPoint getPosition(Tool task, TaskLayoutDetails layout)
public static void setPosition(Task task, TPoint pos)
public static void setPosition(Task task, TPoint pos, TaskLayoutDetails details)
public static void setPosition(Tool tool, TPoint pos)
public static void setPosition(Tool tool, TPoint pos, TaskLayoutDetails details)
public static void translate(Task task, double xdist, double ydist)
public static void translate(Task[] tasks, double xdist, double ydist)
public static void translate(Task[] tasks, int xdist, int ydist, TaskLayoutDetails details)
public static void translateToOrigin(Task[] tasks)
public static void translateToOrigin(Task[] tasks, int border)
public static void translateTo(Task[] tasks, TPoint point)
public static TRectangle getBoundingBox(Task[] tasks)
public static Task replaceTask(Task curtask, Tool newtool, boolean rename) throws TaskGraphException
TaskGraphException
public static Task replaceTask(Task curtask, Tool newtool, boolean rename, boolean preserveinst) throws TaskGraphException
curtask
- the task being replacednewtool
- the tool used to replace the existing taskrename
- true if the new task should take the same name as the existing taskpreserveinst
- true if the new task should preseve the instance id of newtoolTaskGraphException
public static void resolveGroupNodes(TaskGraph taskgraph) throws TaskGraphException
TaskGraphException