Initial version, add analysis · SysMLinJavaModeler/SysMLinJava@f98a18b · GitHub
Skip to content

Commit f98a18b

Browse files
Initial version, add analysis
1 parent 31bdafc commit f98a18b

89 files changed

Lines changed: 7544 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 135 additions & 0 deletions
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
package sysmlinjava.analysis.animatedareadisplay;
2+
3+
import java.io.Serializable;
4+
import java.util.ArrayList;
5+
import sysmlinjava.analysis.common.ColorEnum;
6+
import sysmlinjava.analysis.common.XYData;
7+
8+
/**
9+
* Representation of a line object in an area display. Contains the parameters
10+
* needed to display the object as a "polyline" in the display that connects a
11+
* specified set of x,y points in the area display.
12+
*
13+
* @author ModelerOne
14+
*
15+
*/
16+
public class AALine extends AAObject implements Serializable
17+
{
18+
/** Serializable ID*/
19+
/** Serializable ID*/private static final long serialVersionUID = 4525775059514772367L;
20+
21+
/**
22+
* List of the x,y points to be connected for the line
23+
*/
24+
public ArrayList<XYData> points;
25+
/**
26+
* Color of the line
27+
*/
28+
public ColorEnum color;
29+
/**
30+
* Width (in points) of the line
31+
*/
32+
public Integer width;
33+
/**
34+
* Order of the line in the layers of objects in the area display. Lower number
35+
* is closer to viewer.
36+
*/
37+
public Integer zOrder;
38+
39+
/**
40+
* Constructor for all attributes
41+
*
42+
* @param uid unique identifier
43+
* @param action action to be performed on the line
44+
* @param points set of x,y points to be connected for the line
45+
* @param color Color of the line
46+
* @param width width, in points, of the line
47+
* @param zOrder order of the line in the layers of objects in the area display.
48+
* Lower number is closer to viewer.
49+
*/
50+
public AALine(String uid, Action action, ArrayList<XYData> points, ColorEnum color, Integer width, Integer zOrder)
51+
{
52+
super(uid, action);
53+
switch (action)
54+
{
55+
case create:
56+
this.points = points != null ? points : new ArrayList<>();
57+
this.color = color != null ? color : ColorEnum.BLACK;
58+
this.width = width != null ? width : 2;
59+
this.zOrder = zOrder != null ? zOrder : 0;
60+
break;
61+
case delete:
62+
break;
63+
case update:
64+
this.points = points;
65+
this.color = color;
66+
this.width = width;
67+
this.zOrder = zOrder;
68+
break;
69+
default:
70+
break;
71+
72+
}
73+
}
74+
75+
/**
76+
* Updates/changes the line display as specified by parameter values, with value
77+
* {@code null} indicating no change
78+
*
79+
* @param action action to be performed on the line
80+
* @param points set of x,y points to be connected for the line
81+
* @param color Color of the line
82+
* @param width width, in points, of the line
83+
* @param zOrder order of the line in the layers of objects in the area display.
84+
* Lower number is closer to viewer.
85+
*/
86+
public void update(Action action, ArrayList<XYData> points, ColorEnum color, Integer width, Integer zOrder)
87+
{
88+
this.action = action != null ? action : Action.none;
89+
this.points = points;
90+
this.color = color;
91+
this.width = width;
92+
this.zOrder = zOrder;
93+
}
94+
95+
@Override
96+
public String toString()
97+
{
98+
return String.format("AALine [uid=%s, action=%s, points=%s, color=%s, width=%s, zOrder=%s, getClass()=%s, hashCode()=%s, toString()=%s]", uid, action, points, color, width, zOrder, getClass(), hashCode(), super.toString());
99+
}
100+
}
Lines changed: 72 additions & 0 deletions

0 commit comments

Comments
 (0)