KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > demo > notification > whiteboard > UpdateLine


1 package demo.notification.whiteboard;
2
3
4
5 /**
6
7  * UpdateLine.java
8
9  *
10
11  *
12
13  * Created: Sun Feb 6 19:05:46 2000
14
15  *
16
17  * @author Alphonse Bendt
18
19  * @version
20
21  */

22
23
24
25 // klasse kapselt alle A"nderungen in einem PixelImage
26

27 public class UpdateLine implements java.io.Serializable JavaDoc {
28
29
30
31     int x0,x1,y1,y0,red,green,blue,brushSize;
32
33     boolean clear = false;
34
35
36
37     public UpdateLine(boolean clear) {
38
39     this.clear = true;
40
41     }
42
43
44
45     public UpdateLine(int x0, int y0,
46
47               int x1, int y1,
48
49               int red, int green , int blue,int brushSize) {
50
51     this.x0 = x0;
52
53     this.y0 = y0;
54
55     this.x1 = x1;
56
57     this.y1 = y1;
58
59     this.red = red;
60
61     this.green = green;
62
63     this.blue = blue;
64
65     this.brushSize = brushSize;
66
67     }
68
69
70
71     public boolean clearScreen() {
72
73     return clear;
74
75     }
76
77     public int getX0() {
78
79     return x0;
80
81     }
82
83     public int getY0() {
84
85     return y0;
86
87     }
88
89     public int getX1() {
90
91     return x1;
92
93     }
94
95     public int getY1() {
96
97     return y1;
98
99     }
100
101     public int getRed() {
102
103     return red;
104
105     }
106
107     public int getGreen() {
108
109     return green;
110
111     }
112
113     public int getBlue() {
114
115     return blue;
116
117     }
118
119     public int getBrushSize() {
120
121     return brushSize;
122
123     }
124
125
126
127     public String JavaDoc toString() {
128
129     String JavaDoc s = new String JavaDoc();
130
131     s += "x0:"+x0;
132
133     s += " y0:"+y0;
134
135     s += " x1:"+x1;
136
137     s += " y1:"+y1;
138
139     s += " red:"+red;
140
141     s += " green:"+green;
142
143     s += " blue:"+blue;
144
145     s += " brushSize:"+brushSize+"\n";
146
147     
148
149     return s;
150
151     }
152
153 } // UpdateLine
154

155
156
157
158
159
160
161
162
163
164
165
Popular Tags