| 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.Step; |
| 11 | |
import br.mia.test.testcase.DadosTeste; |
| 12 | |
|
| 13 | |
public class DataCell extends DefaultGraphCell { |
| 14 | |
|
| 15 | |
private Step step; |
| 16 | |
|
| 17 | |
private DadoEdge dadoEdge; |
| 18 | |
|
| 19 | |
|
| 20 | |
public DadoEdge getDadoEdge() { |
| 21 | 0 | return dadoEdge; |
| 22 | |
} |
| 23 | |
|
| 24 | |
public void setDadoEdge(DadoEdge dadoEdge) { |
| 25 | 0 | this.dadoEdge = dadoEdge; |
| 26 | 0 | } |
| 27 | |
|
| 28 | |
public Step getStep() { |
| 29 | 0 | return step; |
| 30 | |
} |
| 31 | |
|
| 32 | |
public void setStep(Step step) { |
| 33 | 0 | this.step = step; |
| 34 | 0 | } |
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
private static final long serialVersionUID = 1L; |
| 40 | |
private DadosTeste data; |
| 41 | |
int x; |
| 42 | |
int y; |
| 43 | |
|
| 44 | |
public int getX() { |
| 45 | 0 | return x; |
| 46 | |
} |
| 47 | |
|
| 48 | |
public void setX(int x) { |
| 49 | 0 | this.x = x; |
| 50 | 0 | } |
| 51 | |
|
| 52 | |
public int getY() { |
| 53 | 0 | return y; |
| 54 | |
} |
| 55 | |
|
| 56 | |
public void setY(int y) { |
| 57 | 0 | this.y = y; |
| 58 | 0 | } |
| 59 | |
|
| 60 | |
public DataCell(String nome, DadosTeste data,int x,int y,Step step) { |
| 61 | 0 | super(nome); |
| 62 | 0 | this.data = data; |
| 63 | 0 | this.step=step; |
| 64 | 0 | GraphConstants.setBounds(this.getAttributes(), new Rectangle2D.Double( |
| 65 | 0 | x, y, 100, 20)); |
| 66 | |
|
| 67 | 0 | GraphConstants.setGradientColor(this.getAttributes(), Color.RED); |
| 68 | 0 | GraphConstants.setOpaque(this.getAttributes(), true); |
| 69 | 0 | DefaultPort port2 = new DefaultPort(); |
| 70 | 0 | this.add(port2); |
| 71 | 0 | port2.setParent(this); |
| 72 | 0 | this.x=x; |
| 73 | 0 | this.y=y; |
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | 0 | } |
| 78 | |
|
| 79 | |
public DadosTeste getData() { |
| 80 | 0 | return data; |
| 81 | |
} |
| 82 | |
|
| 83 | |
public void setData(DadosTeste data) { |
| 84 | 0 | this.data = data; |
| 85 | 0 | } |
| 86 | |
|
| 87 | |
} |