You must create the window in which the
Workflow will be displayed :
public HelloWorldFrame()
{
Container content = getContentPane();
content.setLayout(new BorderLayout());
setSize(400, 300);
setTitle("Hello World");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
Don't
forget the main :
public static
void main(String args[]) {
HelloWorldFrame frame
= new HelloWorldFrame();
frame.setVisible(true);
}
You
must create a GraphJ object
which offer the display zone of the Workflow :
IRegisterer register
= new Registerer();
content.add(graph, "Center");
Attributs atts
= new Attributs("AttHW", new
Color(141, 90, 99), Attributs.TASK,
new Dimension(80,
100));
atts.putAtt(Attributs.GRADIENTCOLOR,
new
GradientPaint(0, 0, new Color(141, 90, 99), 175,175, new Color(255,
255, 255,
200), true));
register.putAtt("CatHW",
atts);
Creation of a descriptor for “Hello
World” and adding to the
registry :
TaskDescriptor desc = new
TaskDescriptor("Hello World",
"CatHW");
register.putDescriptor("Helloworld",
desc);
The task is now known from the graph and it can be inserted with insert
method (of GraphJ) :
graph.insert(new Point(10,10), "Helloworld");
©ULP/CNRS - CDS, 11 rue de l'Université, 67000 Strasbourg, France |