1
14 package demo.view.flowchart.painters;
15
16
17 import y.view.NodeRealizer;
18
19 import java.awt.geom.GeneralPath;
20
21
24 public class FlowchartDataBasePainter extends AbstractFlowchartPainter {
25
26 double X_OFFSET_1 = 0.03;
27 double Y_OFFSET_1 = 0.2;
28
29 public FlowchartDataBasePainter() {
30 super();
31 this.outline = new GeneralPath();
32 this.innerShape = new GeneralPath();
33 }
34
35
36 protected void updateOutline(NodeRealizer context) {
37
38 GeneralPath shapePath = (GeneralPath) getOutline();
39 shapePath.reset();
40
41 double x = context.getX();
42 double y = context.getY();
43 double height = context.getHeight();
44 double width = context.getWidth();
45
46 shapePath.moveTo((float)x, (float)(y + Y_OFFSET_1 *height));
47 shapePath.curveTo((float)(x+ X_OFFSET_1 *width), (float)y, (float)(x+width- X_OFFSET_1 *width), (float)y, (float) (x+width), (float)(y + Y_OFFSET_1 *height));
48 shapePath.lineTo((float)(x + width), (float)(y + height - Y_OFFSET_1 *height));
49 shapePath.curveTo((float)(x + width - X_OFFSET_1 *width), (float)(y+height), (float)(x + X_OFFSET_1 *width), (float) (y+height), (float)x, (float)(y + height - Y_OFFSET_1 *height));
50 shapePath.closePath();
51 }
52
53 public void updateInsideShape(NodeRealizer context) {
54 GeneralPath shapePath = (GeneralPath) getInnerShape();
55 shapePath.reset();
56 double x = context.getX();
57 double y = context.getY();
58 double height = context.getHeight();
59 double width = context.getWidth();
60
61 shapePath.moveTo((float) (x+width), (float)(y + Y_OFFSET_1 *height));
62 shapePath.curveTo((float)(x + width- X_OFFSET_1 *width), (float) (y+2* Y_OFFSET_1 *height), (float)(x + X_OFFSET_1 *width), (float) (y+2* Y_OFFSET_1 *height), (float)x, (float)(y + Y_OFFSET_1 *height));
63 }
64
65 }