01: package com.opensymphony.workflow.designer;
02:
03: import java.awt.*;
04:
05: import javax.swing.*;
06:
07: import org.jgraph.graph.DefaultGraphCell;
08: import org.jgraph.graph.GraphConstants;
09:
10: /**
11: * @author Harsh Vijaywargiya Mar 9, 2003 1:04:57 PM
12: */
13: public class WorkflowCell extends DefaultGraphCell {
14: public static final Rectangle defaultBounds = new Rectangle(10, 10,
15: 100, 30);
16: protected int id;
17: protected String name;
18: private transient int selectedPort;
19:
20: /**
21: * @param cellName
22: */
23: public WorkflowCell(Object cellName) {
24: super (cellName);
25: GraphConstants.setBounds(attributes, (Rectangle) defaultBounds
26: .clone());
27: GraphConstants.setOpaque(attributes, true);
28: GraphConstants.setBackground(attributes, Color.blue.darker());
29: GraphConstants.setForeground(attributes, Color.white);
30: GraphConstants.setBorder(attributes, BorderFactory
31: .createRaisedBevelBorder());
32: GraphConstants.setEditable(attributes, false);
33: GraphConstants.setVerticalAlignment(attributes,
34: SwingConstants.TOP);
35: //GraphConstants.setFont(attributes, GraphConstants.defaultFont.deriveFont(Font.BOLD, 12));
36: }
37:
38: /**
39: * Returns the mId.
40: * @return int
41: */
42: public int getId() {
43: return id;
44: }
45:
46: /**
47: * Returns the mName.
48: * @return String
49: */
50: public String getName() {
51: return name;
52: }
53:
54: public int getSelectedPort() {
55: return selectedPort;
56: }
57:
58: public void setSelectedPort(int selectedPort) {
59: this.selectedPort = selectedPort;
60: }
61: }
|