| 1 | |
package br.mia.test.view.graph; |
| 2 | |
|
| 3 | |
import java.awt.Color; |
| 4 | |
import java.awt.geom.Rectangle2D; |
| 5 | |
|
| 6 | |
import org.jgraph.graph.DefaultGraphCell; |
| 7 | |
import org.jgraph.graph.DefaultPort; |
| 8 | |
import org.jgraph.graph.GraphConstants; |
| 9 | |
|
| 10 | |
import br.mia.test.model.RegraNegocio; |
| 11 | |
import br.mia.test.model.Step; |
| 12 | |
|
| 13 | |
public class RuleCell extends DefaultGraphCell{ |
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
private static final long serialVersionUID = 1L; |
| 19 | |
|
| 20 | |
private RegraNegocio rule; |
| 21 | |
|
| 22 | |
private Step step; |
| 23 | |
|
| 24 | |
private RuleEdge edge; |
| 25 | |
|
| 26 | |
public RuleEdge getEdge() { |
| 27 | 0 | return edge; |
| 28 | |
} |
| 29 | |
|
| 30 | |
public void setEdge(RuleEdge edge) { |
| 31 | 0 | this.edge = edge; |
| 32 | 0 | } |
| 33 | |
|
| 34 | |
public RuleCell(String nome,RegraNegocio rule,Step step,int x,int y){ |
| 35 | 0 | super(nome); |
| 36 | 0 | this.rule=rule; |
| 37 | 0 | this.step=step; |
| 38 | 0 | GraphConstants.setBounds(this.getAttributes(), new Rectangle2D.Double( |
| 39 | 0 | x, y, 100, 20)); |
| 40 | |
|
| 41 | 0 | GraphConstants.setGradientColor(this.getAttributes(), Color.CYAN); |
| 42 | 0 | GraphConstants.setOpaque(this.getAttributes(), true); |
| 43 | 0 | DefaultPort port2 = new DefaultPort(); |
| 44 | 0 | this.add(port2); |
| 45 | 0 | port2.setParent(this); |
| 46 | |
|
| 47 | 0 | } |
| 48 | |
|
| 49 | |
public RegraNegocio getRule() { |
| 50 | 0 | return rule; |
| 51 | |
} |
| 52 | |
|
| 53 | |
public void setRule(RegraNegocio rule) { |
| 54 | 0 | this.rule = rule; |
| 55 | 0 | } |
| 56 | |
|
| 57 | |
public Step getStep() { |
| 58 | 0 | return step; |
| 59 | |
} |
| 60 | |
|
| 61 | |
public void setStep(Step step) { |
| 62 | 0 | this.step = step; |
| 63 | 0 | } |
| 64 | |
|
| 65 | |
} |