-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBackGround.java
More file actions
53 lines (42 loc) · 1.05 KB
/
BackGround.java
File metadata and controls
53 lines (42 loc) · 1.05 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
44
45
46
47
48
49
50
51
52
53
package RouteMapMaker;
import java.util.HashMap;
import java.util.Properties;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
public class Background implements Cloneable{
// Objectを複製してUndo/Redoを管理
Color color;
Image image;
int x, y; // 原点座標
int zoomRatio, opacity; // %単位
public Background() {
color = Color.WHITESMOKE;
image = null;
x = y = opacity = 0;
zoomRatio = 100;
}
@Override
public Background clone() {
Background c = new Background();
c.copyParams(this);
return c;
}
public void copyParams(Background ref) {
this.color = ref.color;
this.image = ref.image;
this.x = ref.x;
this.y = ref.y;
this.zoomRatio = ref.zoomRatio;
this.opacity = ref.opacity;
}
public void setColor(Color c) {
image = null;
color = c;
}
public void read(Properties p, HashMap<Integer,Image> imageMap) {
}
public void save(Properties p, HashMap<Integer,Image> imageMap) {
}
}