KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > WorkflowCell


1 package com.opensymphony.workflow.designer;
2
3 import java.awt.*;
4
5 import javax.swing.*;
6
7 import org.jgraph.graph.DefaultGraphCell;
8 import org.jgraph.graph.GraphConstants;
9
10 /**
11  * @author Harsh Vijaywargiya Mar 9, 2003 1:04:57 PM
12  */

13 public class WorkflowCell extends DefaultGraphCell
14 {
15   public static final Rectangle defaultBounds = new Rectangle(10, 10, 100, 30);
16   protected int id;
17   protected String JavaDoc name;
18
19   /**
20    * @param cellName
21    */

22   public WorkflowCell(Object JavaDoc cellName)
23   {
24     super(cellName);
25     GraphConstants.setBounds(attributes, (Rectangle)defaultBounds.clone());
26     GraphConstants.setOpaque(attributes, true);
27     GraphConstants.setBackground(attributes, Color.blue.darker());
28     GraphConstants.setForeground(attributes, Color.white);
29     GraphConstants.setBorder(attributes, BorderFactory.createRaisedBevelBorder());
30     GraphConstants.setEditable(attributes, false);
31     GraphConstants.setVerticalAlignment(attributes, SwingConstants.TOP);
32     //GraphConstants.setFont(attributes, GraphConstants.defaultFont.deriveFont(Font.BOLD, 12));
33
}
34
35   /**
36    * Returns the mId.
37    * @return int
38    */

39   public int getId()
40   {
41     return id;
42   }
43
44   /**
45    * Returns the mName.
46    * @return String
47    */

48   public String JavaDoc getName()
49   {
50     return name;
51   }
52
53 }
54
Popular Tags