-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStopMark.java
More file actions
43 lines (36 loc) · 1.52 KB
/
StopMark.java
File metadata and controls
43 lines (36 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package RouteMapMaker;
import java.util.ArrayList;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
public class StopMark implements Cloneable{//駅停車マークの種類を保持する。
public static final StopMark OBEY_LINE = new StopMark();
//以下の2つについてはとりあえず処理を外部に丸投げしてしまおう。
public static final StopMark CIRCLE = new StopMark();
public static final StopMark NO_DRAW = new StopMark();
public static final StopMark[] DefaultMarks = {NO_DRAW, CIRCLE};
ObservableList<MarkLayer> layers = FXCollections.observableArrayList();//カスタムマークはコレで内容を定義。
private BooleanProperty rotate = new SimpleBooleanProperty(false);//lineに合わせてマークを回転させるかどうか
public StopMark(){
}
public ObservableList<MarkLayer> getLayers(){
return this.layers;
}
@Override
public StopMark clone(){
StopMark t = null;
try {
t = (StopMark)super.clone();
t.layers = FXCollections.observableArrayList();
for(int i = 0;i < this.layers.size(); i++) t.layers.add(this.layers.get(i).clone());
} catch (CloneNotSupportedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return t;
}
public BooleanProperty getRotateProperty() { return rotate; }
public void setRotate(boolean b) { rotate.setValue(b); }
public boolean isRotated() { return rotate.getValue(); }
}