-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDrawingPanel.ctxt
More file actions
338 lines (338 loc) · 44.3 KB
/
DrawingPanel.ctxt
File metadata and controls
338 lines (338 loc) · 44.3 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
#BlueJ class context
comment0.target=DrawingPanel
comment0.text=\r\n\r\n\ DrawingPanel\ is\ a\ simplified\ Java\ drawing\ window\ class\ to\ accompany\r\n\ Building\ Java\ Programs\ textbook\ and\ associated\ materials.\r\n\ \r\n\ <p>\r\n\ Authors\:\ Marty\ Stepp\ (Stanford\ University)\ and\ Stuart\ Reges\ (University\ of\ Washington).\r\n\r\n\ <p>\r\n\ Version\:\ 4.04,\ 2016/08/17\ (to\ accompany\ BJP\ 4th\ edition).\r\n\ \r\n\ <p>\r\n\ You\ can\ always\ download\ the\ latest\ {@code\ DrawingPanel}\ from\r\n\ <a\ target\="_blank"\ href\="http\://www.buildingjavaprograms.com/drawingpanel/DrawingPanel.java">\r\n\ http\://www.buildingjavaprograms.com/drawingpanel/DrawingPanel.java</a>\ .\r\n\ \r\n\ <p>\r\n\ For\ more\ information\ and\ related\ materials,\ please\ visit\r\n\ <a\ target\="_blank"\ href\="http\://www.buildingjavaprograms.com">\r\n\ www.buildingjavaprograms.com</a>\ .\r\n\ \r\n\ <p>\r\n\ COMPATIBILITY\ NOTE\:\ This\ version\ of\ DrawingPanel\ requires\ Java\ 8\ or\ higher.\r\n\ To\ make\ this\ file\ work\ on\ Java\ 7\ and\ lower,\ you\ must\ make\ two\ small\r\n\ modifications\ to\ its\ source\ code.\r\n\ Search\ for\ the\ two\ occurrences\ of\ the\ annotation\ @FunctionalInterface\r\n\ and\ comment\ them\ out\ or\ remove\ those\ lines.\r\n\ Then\ the\ file\ should\ compile\ and\ run\ properly\ on\ older\ versions\ of\ Java.\r\n\ \r\n\ <h3>Description\:</h3>\r\n\ \r\n\ <p>\r\n\ The\ {@code\ DrawingPanel}\ class\ provides\ a\ simple\ interface\ for\ drawing\ persistent\r\n\ images\ using\ a\ {@code\ Graphics}\ object.\ \ An\ internal\ {@code\ BufferedImage}\ object\ is\ used\r\n\ to\ keep\ track\ of\ what\ has\ been\ drawn.\ \ A\ client\ of\ the\ class\ simply\r\n\ constructs\ a\ {@code\ DrawingPanel}\ of\ a\ particular\ size\ and\ then\ draws\ on\ it\ with\r\n\ the\ {@code\ Graphics}\ object,\ setting\ the\ background\ color\ if\ they\ so\ choose.\r\n\ </p>\r\n\ \r\n\ <p>\r\n\ The\ intention\ is\ that\ this\ custom\ library\ will\ mostly\ "stay\ out\ of\ the\ way"\r\n\ so\ that\ the\ client\ mostly\ interacts\ with\ a\ standard\ Java\ {@code\ java.awt.Graphics}\r\n\ object,\ and\ therefore\ most\ of\ the\ experience\ gained\ while\ using\ this\ library\r\n\ will\ transfer\ to\ Java\ graphics\ programming\ in\ other\ contexts.\r\n\ {@code\ DrawingPanel}\ is\ not\ intended\ to\ be\ a\ full\ rich\ graphical\ library\ for\ things\r\n\ like\ object-oriented\ drawing\ of\ shapes,\ animations,\ creating\ games,\ etc.\r\n\ </p>\r\n\ \r\n\ <h3>Example\ basic\ usage\:</h3>\r\n\ \r\n\ <p>\r\n\ Here\ is\ a\ canonical\ example\ of\ creating\ a\ {@code\ DrawingPanel}\ of\ a\ given\ size\ and\r\n\ using\ it\ to\ draw\ a\ few\ shapes.\r\n\ </p>\r\n\ \r\n\ <pre>\r\n\ //\ basic\ usage\ example\r\n\ DrawingPanel\ panel\ \=\ new\ DrawingPanel(600,\ 400);\r\n\ Graphics\ g\ \=\ panel.getGraphics();\r\n\ g.setColor(Color.RED);\r\n\ g.fillRect(17,\ 45,\ 139,\ 241);\r\n\ g.drawOval(234,\ 77,\ 100,\ 100);\r\n\ ...\r\n\ </pre>\r\n\ \r\n\ <p>\r\n\ To\ ensure\ that\ the\ image\ is\ always\ displayed,\ a\ timer\ calls\ repaint\ at\r\n\ regular\ intervals.\r\n\ </p>\r\n\ \r\n\ <h3>Pixel\ processing\ (new\ in\ BJP\ 4th\ edition)\:</h3>\r\n\ \r\n\ <p>\r\n\ This\ version\ of\ {@code\ DrawingPanel}\ allows\ you\ to\ loop\ over\ the\ pixels\ of\ an\ image.\r\n\ You\ can\ process\ each\ pixel\ as\ a\ {@code\ Color}\ object\ (easier\ OO\ interface,\ but\ takes\r\n\ more\ CPU\ and\ memory\ to\ run)\ or\ as\ a\ 32-bit\ RGB\ integer\ (clunkier\ to\ use,\ but\r\n\ much\ more\ efficient\ in\ runtime\ and\ memory\ usage).\r\n\ Look\ at\ the\ methods\ get/setPixel(s)\ to\ get\ a\ better\ idea.\r\n\ \r\n\ <pre>\r\n\ //\ example\ of\ horizontally\ flipping\ an\ image\r\n\ public\ static\ void\ flipHorizontal(DrawingPanel\ panel)\ {\r\n\ \ \ \ \ int\ width\ \ \=\ panel.getWidth();\r\n\ \ \ \ \ int\ height\ \=\ panel.getHeight();\r\n\ \ \ \ \ int[]\ pixels\ \=\ panel.getPixelsRGB();\r\n\ \ \ \ \ for\ (int\ row\ \=\ 0;\ row\ <\ height;\ row++)\ {\r\n\ \ \ \ \ \ \ \ \ for\ (int\ col\ \=\ 0;\ col\ <\ width\ /\ 2;\ col++)\ {\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ //\ swap\ this\ pixel\ with\ the\ one\ opposite\ it\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ int\ col2\ \=\ width\ -\ 1\ -\ col;\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ int\ temp\ \=\ pixels[row][col];\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ pixels[row][col]\ \=\ pixels[row][col2];\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ pixels[row][col2]\ \=\ temp;\r\n\ \ \ \ \ \ \ \ \ }\r\n\ \ \ \ \ }\r\n\ \ \ \ \ panel.setPixels(pixels);\r\n\ }\r\n\ </pre>\r\n\ \r\n\ <h3>Event\ listeners\ and\ lambdas\ (new\ in\ BJP\ 4th\ edition)\:</h3>\r\n\ \r\n\ <p>\r\n\ With\ Java\ 8,\ you\ can\ now\ attach\ event\ handlers\ to\ listen\ to\ keyboard\ and\ mouse\r\n\ events\ that\ occur\ in\ a\ {@code\ DrawingPanel}\ using\ a\ lambda\ function.\ \ For\ example\:\r\n\ \r\n\ <pre>\r\n\ //\ example\ of\ attaching\ a\ mouse\ click\ handler\ using\ Java\ 8\r\n\ panel.onClick(\ (x,\ y)\ ->\ System.out.println(x\ +\ "\ "\ +\ y)\ );\r\n\ </pre>\r\n\ \r\n\ <h3>Debugging\ facilities\ (new\ in\ BJP\ 4th\ edition)\:</h3>\r\n\ \r\n\ <p>\r\n\ This\ version\ now\ includes\ an\ inner\ class\ named\ {@code\ DebuggingGraphics}\r\n\ that\ keeps\ track\ of\ how\ many\ times\ various\ drawing\ methods\ are\ called.\r\n\ It\ includes\ a\ {@code\ showCounts}\ method\ for\ the\ {@code\ DrawingPanel}\ itself\r\n\ that\ allows\ a\ client\ to\ examine\ this.\ \ The\ panel\ will\ record\ basic\ drawing\r\n\ methods\ performed\ by\ a\ version\ of\ the\ {@code\ Graphics}\ class\ obtained\ by\r\n\ calling\ {@code\ getDebuggingGraphics}\ \:\r\n\ \r\n\ <pre>\r\n\ //\ example\ of\ debugging\ counts\ of\ graphics\ method\ calls\r\n\ Graphics\ g\ \=\ panel.getDebuggingGraphics();\r\n\ </pre>\r\n\ \r\n\ <p>\r\n\ Novices\ will\ be\ encouraged\ to\ simply\ print\ it\ at\ the\ end\ of\ {@code\ main},\ as\ in\:\r\n\ \r\n\ <pre>\r\n\ System.out.println(panel.getCounts());\r\n\ </pre>\r\n\ \r\n\ <h3>History\ and\ recent\ changes\:</h3>\r\n\ \r\n\ 2016/07/25\r\n\ -\ Added\ and\ cleaned\ up\ BJP4\ features,\ static\ anti-alias\ settings,\ bug\ fixes.\r\n\ <p>\r\n\ \r\n\ 2016/03/07\r\n\ -\ Code\ cleanup\ and\ improvements\ to\ JavaDoc\ comments\ for\ BJP4\ release.\r\n\ <p>\r\n\ \r\n\ 2015/09/04\r\n\ -\ Now\ includes\ methods\ for\ get/setting\ individual\ pixels\ and\ all\ pixels\ on\ the\r\n\ \ \ drawing\ panel.\ \ This\ helps\ facilitate\ 2D\ array-based\ pixel-processing\r\n\ \ \ exercises\ and\ problems\ for\ Building\ Java\ Programs,\ 4th\ edition.\r\n\ -\ Code\ cleanup\ and\ reorganization.\r\n\ \ \ Now\ better\ alphabetization/formatting\ of\ members\ and\ encapsulation.\r\n\ \ \ Commenting\ also\ augmented\ throughout\ code.\r\n\ <p>\r\n\ \r\n\ 2015/04/09\r\n\ -\ Now\ includes\ a\ DebuggingGraphics\ inner\ class\ that\ keeps\ track\ of\ how\ many\r\n\ \ \ times\ various\ drawing\ methods\ are\ called.\r\n\ \ \ All\ additions\ are\ commented\ (search\ for\ "DebuggingGraphics")\r\n\ <p>\r\n\ \r\n\ 2011/10/25\r\n\ -\ save\ zoomed\ images\ (2011/10/25)\r\n\ <p>\r\n\ \r\n\ 2011/10/21\r\n\ -\ window\ no\ longer\ moves\ when\ zoom\ changes\r\n\ -\ grid\ lines\r\n\ \r\n\ @author\ Marty\ Stepp,\ Stanford\ University,\ and\ Stuart\ Reges,\ University\ of\ Washington\r\n\ @version\ 4.04,\ 2016/08/17\ (BJP\ 4th\ edition)\r\n
comment1.params=
comment1.target=void\ checkAnimationSettings()
comment1.text=\r\n\ Called\ when\ DrawingPanel\ class\ loads\ up.\r\n\ Checks\ whether\ the\ user\ wants\ to\ save\ an\ animation\ to\ a\ file.\r\n
comment10.params=name
comment10.target=boolean\ hasProperty(java.lang.String)
comment10.text=\r\n\ Returns\ whether\ the\ given\ Java\ system\ property\ has\ been\ set.\r\n
comment100.params=visible
comment100.target=void\ setVisible(boolean)
comment100.text=\r\n\ Show\ or\ hide\ the\ drawing\ panel\ on\ the\ screen.\r\n\ @param\ visible\ true\ to\ show,\ false\ to\ hide\r\n
comment101.params=width
comment101.target=void\ setWidth(int)
comment101.text=\r\n\ Sets\ the\ drawing\ panel's\ width\ in\ pixels\ to\ the\ given\ value.\r\n\ After\ calling\ this\ method,\ the\ client\ must\ call\ getGraphics()\ again\r\n\ to\ get\ the\ new\ graphics\ context\ of\ the\ newly\ enlarged\ image\ buffer.\r\n\ @param\ width\ width,\ in\ pixels\r\n\ @throws\ IllegalArgumentException\ if\ height\ is\ negative\ or\ exceeds\ MAX_SIZE\r\n
comment102.params=
comment102.target=boolean\ shouldDiff()
comment102.text=\r\n\ Returns\ whether\ the\ user\ wants\ to\ perform\ a\ 'diff'\ comparison\ of\ their\r\n\ drawing\ panel\ with\ a\ given\ expected\ output\ image.\r\n
comment103.params=
comment103.target=boolean\ shouldSave()
comment103.text=\r\n\ Returns\ whether\ the\ user\ wants\ to\ save\ the\ drawing\ panel\ contents\ to\r\n\ a\ file\ automatically.\r\n
comment104.params=parent\ title\ message\ names
comment104.target=int\ showOptionDialog(java.awt.Frame,\ java.lang.String,\ java.lang.String,\ java.lang.String[])
comment104.text=\r\n\ Shows\ a\ dialog\ box\ with\ the\ given\ choices;\r\n\ returns\ the\ index\ chosen\ (-1\ \=\=\ canceled).\r\n
comment105.params=e
comment105.target=void\ actionPerformed(java.awt.event.ActionEvent)
comment106.params=e
comment106.target=void\ actionPerformed(java.awt.event.ActionEvent)
comment107.params=millis
comment107.target=void\ sleep(int)
comment107.text=\r\n\ Causes\ the\ program\ to\ pause\ for\ the\ given\ amount\ of\ time\ in\ milliseconds.\r\n\ This\ allows\ for\ animation\ by\ calling\ pause\ in\ a\ loop.\r\n\ If\ the\ DrawingPanel\ is\ not\ showing\ on\ the\ screen,\ has\ no\ effect.\r\n\ @param\ millis\ number\ of\ milliseconds\ to\ sleep\r\n\ @throws\ IllegalArgumentException\ if\ a\ negative\ number\ of\ ms\ is\ passed\r\n
comment108.params=
comment108.target=void\ toFront()
comment108.text=\r\n\ Moves\ the\ drawing\ panel\ window\ on\ top\ of\ other\ windows\ so\ it\ can\ be\ seen.\r\n
comment109.params=window
comment109.target=void\ toFront(java.awt.Window)
comment109.text=\r\n\ Brings\ the\ given\ window\ to\ the\ front\ of\ the\ Z-ordering.\r\n
comment11.params=
comment11.target=boolean\ isAntiAliasDefault()
comment11.text=\r\n\ Returns\ true\ if\ DrawingPanel\ instances\ should\ anti-alias\ (smooth)\ their\ graphics.\r\n\ By\ default\ this\ is\ true,\ but\ it\ can\ be\ set\ to\ false\ using\ the\ ANTIALIAS_PROPERTY.\r\n\ @return\ true\ if\ anti-aliasing\ is\ enabled\ (default\ true)\r\n
comment110.params=
comment110.target=void\ run()
comment111.params=zoomFactor
comment111.target=void\ zoom(int)
comment111.text=\r\n\ Zooms\ the\ drawing\ panel\ in/out\ to\ the\ given\ factor.\r\n\ A\ zoom\ factor\ of\ 1,\ the\ default,\ indicates\ normal\ size.\r\n\ A\ zoom\ factor\ of\ 2\ would\ indicate\ 200%\ size,\ and\ so\ on.\r\n\ The\ factor\ value\ passed\ should\ be\ at\ least\ 1;\ if\ not,\ 1\ will\ be\ used.\r\n\ @param\ zoomFactor\ the\ zoom\ factor\ to\ use\ (1\ or\ greater)\r\n
comment112.params=s\ os
comment112.target=void\ putAscii(java.lang.String,\ java.io.OutputStream)
comment112.text=\r\n\ Internal\ method;\r\n\ write\ just\ the\ low\ bytes\ of\ a\ String.\ (This\ sucks,\ but\ the\ concept\ of\ an\r\n\ encoding\ seems\ inapplicable\ to\ a\ binary\ file\ ID\ string.\ I\ would\ think\r\n\ flexibility\ is\ just\ what\ we\ don't\ want\ -\ but\ then\ again,\ maybe\ I'm\ slow.)\r\n\ This\ is\ an\ internal\ method\ not\ meant\ to\ be\ called\ by\ clients.\r\n
comment113.params=i16\ os
comment113.target=void\ putShort(int,\ java.io.OutputStream)
comment113.text=\r\n\ Internal\ method;\r\n\ write\ a\ 16-bit\ integer\ in\ little\ endian\ byte\ order.\r\n\ This\ is\ an\ internal\ method\ not\ meant\ to\ be\ called\ by\ clients.\r\n
comment12.params=
comment12.target=boolean\ isHeadless()
comment12.text=\r\n\ Returns\ true\ if\ the\ class\ is\ in\ "headless"\ mode,\ meaning\ that\ it\ is\ running\ on\r\n\ a\ server\ without\ a\ graphical\ user\ interface.\r\n\ @return\ true\ if\ we\ are\ in\ headless\ mode\ (default\ false)\r\n
comment13.params=
comment13.target=boolean\ mainIsActive()
comment13.text=\r\n\ Internal\ method;\ returns\ whether\ the\ 'main'\ thread\ is\ still\ running.\r\n\ Used\ to\ determine\ whether\ to\ exit\ the\ program\ when\ the\ drawing\ panel\r\n\ is\ closed\ by\ the\ user.\r\n\ This\ is\ an\ internal\ method\ not\ meant\ to\ be\ called\ by\ clients.\r\n\ @return\ true\ if\ main\ thread\ is\ still\ running\r\n
comment14.params=name
comment14.target=boolean\ propertyIsTrue(java.lang.String)
comment14.text=\r\n\ Returns\ whether\ the\ given\ Java\ system\ property\ has\ been\ set\ to\ a\r\n\ "truthy"\ value\ such\ as\ "yes"\ or\ "true"\ or\ "1".\ \r\n
comment15.params=
comment15.target=void\ saveAll()
comment15.text=\r\n\ Saves\ every\ DrawingPanel\ instance\ that\ is\ active.\r\n\ @throws\ IOException\ if\ unable\ to\ save\ any\ of\ the\ files.\r\n
comment16.params=value
comment16.target=void\ setAntiAliasDefault(java.lang.Boolean)
comment16.text=\r\n\ Sets\ whether\ DrawingPanel\ instances\ should\ anti-alias\ (smooth)\ their\ pixels\ by\ default.\r\n\ Default\ true.\ \ You\ can\ set\ this\ on\ a\ given\ DrawingPanel\ instance\ with\ setAntialias(boolean).\r\n\ @param\ value\ whether\ to\ enable\ anti-aliasing\ (default\ true)\r\n
comment17.params=value
comment17.target=void\ setHeadless(java.lang.Boolean)
comment17.text=\r\n\ Sets\ the\ class\ to\ run\ in\ "headless"\ mode,\ with\ no\ graphical\ output\ on\ screen.\r\n\ @param\ value\ whether\ to\ enable\ headless\ mode\ (default\ false)\r\n
comment18.params=file
comment18.target=void\ setSaveFile(java.io.File)
comment18.text=\r\n\ Sets\ the\ file\ to\ be\ used\ when\ saving\ graphical\ output\ for\ all\ DrawingPanels.\r\n\ @param\ file\ the\ file\ to\ use\ as\ default\ save\ file\r\n
comment19.params=filename
comment19.target=void\ setSaveFileName(java.lang.String)
comment19.text=\r\n\ Sets\ the\ filename\ to\ be\ used\ when\ saving\ graphical\ output\ for\ all\ DrawingPanels.\r\n\ @param\ filename\ the\ name/path\ of\ the\ file\ to\ use\ as\ default\ save\ file\r\n
comment2.params=name\ value\ min\ max
comment2.target=void\ ensureInRange(java.lang.String,\ int,\ int,\ int)
comment2.text=\r\n\ Helper\ that\ throws\ an\ IllegalArgumentException\ if\ the\ given\ integer\r\n\ is\ not\ between\ the\ given\ min-max\ inclusive\r\n
comment20.params=r\ g\ b
comment20.target=int\ toRgbInteger(int,\ int,\ int)
comment20.text=\r\n\ Returns\ an\ RGB\ integer\ made\ from\ the\ given\ red,\ green,\ and\ blue\ components\r\n\ from\ 0-255.\ \ The\ returned\ integer\ is\ suitable\ for\ use\ with\ various\ RGB\r\n\ integer\ methods\ in\ this\ class\ such\ as\ setPixel.\r\n\ @param\ r\ red\ component\ from\ 0-255\ (bits\ 8-15)\r\n\ @param\ g\ green\ component\ from\ 0-255\ (bits\ 16-23)\r\n\ @param\ b\ blue\ component\ from\ 0-255\ (bits\ 24-31)\r\n\ @return\ RGB\ integer\ with\ full\ 255\ for\ alpha\ and\ r-g-b\ in\ bits\ 8-31\r\n\ @throws\ IllegalArgumentException\ if\ r,\ g,\ or\ b\ is\ not\ in\ 0-255\ range\r\n
comment21.params=alpha\ r\ g\ b
comment21.target=int\ toRgbInteger(int,\ int,\ int,\ int)
comment21.text=\r\n\ Returns\ an\ RGB\ integer\ made\ from\ the\ given\ alpha,\ red,\ green,\ and\ blue\ components\r\n\ from\ 0-255.\ \ The\ returned\ integer\ is\ suitable\ for\ use\ with\ various\ RGB\r\n\ integer\ methods\ in\ this\ class\ such\ as\ setPixel.\r\n\ @param\ alpha\ alpha\ (transparency)\ component\ from\ 0-255\ (bits\ 0-7)\r\n\ @param\ r\ red\ component\ from\ 0-255\ (bits\ 8-15)\r\n\ @param\ g\ green\ component\ from\ 0-255\ (bits\ 16-23)\r\n\ @param\ b\ blue\ component\ from\ 0-255\ (bits\ 24-31)\r\n\ @return\ RGB\ integer\ with\ the\ given\ four\ components\r\n\ @throws\ IllegalArgumentException\ if\ alpha,\ r,\ g,\ or\ b\ is\ not\ in\ 0-255\ range\r\n
comment22.params=
comment22.target=boolean\ usingDrJava()
comment22.text=\r\n\ Returns\ whether\ the\ current\ program\ is\ running\ in\ the\ DrJava\ editor.\r\n\ This\ was\ needed\ in\ the\ past\ because\ DrJava\ messed\ with\ some\ settings.\r\n
comment23.params=
comment23.target=DrawingPanel()
comment23.text=\r\n\ Constructs\ a\ drawing\ panel\ with\ a\ default\ width\ and\ height\ enclosed\ in\ a\ window.\r\n\ Uses\ DEFAULT_WIDTH\ and\ DEFAULT_HEIGHT\ for\ the\ panel's\ size.\r\n
comment24.params=width\ height
comment24.target=DrawingPanel(int,\ int)
comment24.text=\r\n\ Constructs\ a\ drawing\ panel\ of\ given\ width\ and\ height\ enclosed\ in\ a\ window.\r\n\ @param\ width\ panel's\ width\ in\ pixels\r\n\ @param\ height\ panel's\ height\ in\ pixels\r\n
comment25.params=
comment25.target=void\ run()
comment26.params=
comment26.target=void\ run()
comment27.params=imageFile
comment27.target=DrawingPanel(java.io.File)
comment27.text=\r\n\ Constructs\ a\ drawing\ panel\ that\ displays\ the\ image\ from\ the\ given\ file\ enclosed\ in\ a\ window.\r\n\ The\ panel\ will\ be\ sized\ exactly\ to\ fit\ the\ image\ inside\ it.\r\n\ @param\ imageFile\ the\ image\ file\ to\ load\r\n\ @throws\ RuntimeException\ if\ the\ image\ file\ is\ not\ found\r\n
comment28.params=imageFileName
comment28.target=DrawingPanel(java.lang.String)
comment28.text=\r\n\ Constructs\ a\ drawing\ panel\ that\ displays\ the\ image\ from\ the\ given\ file\ name\ enclosed\ in\ a\ window.\r\n\ The\ panel\ will\ be\ sized\ exactly\ to\ fit\ the\ image\ inside\ it.\r\n\ @param\ imageFileName\ the\ file\ name/path\ of\ the\ image\ file\ to\ load\r\n\ @throws\ RuntimeException\ if\ the\ image\ file\ is\ not\ found\r\n
comment29.params=listener
comment29.target=void\ addKeyListener(java.awt.event.KeyListener)
comment29.text=\r\n\ Adds\ the\ given\ event\ listener\ to\ respond\ to\ key\ events\ on\ this\ panel.\r\n\ @param\ listener\ the\ key\ event\ listener\ to\ attach\r\n
comment3.params=name\ value
comment3.target=void\ ensureNotNull(java.lang.String,\ java.lang.Object)
comment3.text=\r\n\ Helper\ that\ throws\ a\ NullPointerException\ if\ the\ given\ value\ is\ null\ \r\n
comment30.params=listener
comment30.target=void\ addMouseListener(java.awt.event.MouseListener)
comment30.text=\r\n\ Adds\ the\ given\ event\ listener\ to\ respond\ to\ mouse\ events\ on\ this\ panel.\r\n\ @param\ listener\ the\ mouse\ event\ listener\ to\ attach\r\n
comment31.params=
comment31.target=boolean\ autoEnableAnimationOnSleep()
comment31.text=\r\n\ Whether\ the\ panel\ should\ automatically\ switch\ to\ animated\ mode\r\n\ if\ it\ calls\ the\ sleep\ method.\r\n
comment32.params=frame
comment32.target=void\ center(java.awt.Window)
comment32.text=\r\n\ Moves\ the\ given\ JFrame\ to\ the\ center\ of\ the\ screen.\r\n
comment33.params=
comment33.target=void\ checkChooser()
comment33.text=\r\n\ Constructs\ and\ initializes\ our\ JFileChooser\ field\ if\ necessary.\r\n
comment34.params=
comment34.target=void\ clear()
comment34.text=\r\n\ Erases\ all\ drawn\ shapes/lines/colors\ from\ the\ panel.\r\n
comment35.params=
comment35.target=void\ compareToFile()
comment35.text=\r\n\ Compares\ the\ current\ DrawingPanel\ image\ to\ an\ image\ file\ on\ disk.\r\n
comment36.params=
comment36.target=void\ compareToURL()
comment36.text=\r\n\ Compares\ the\ current\ DrawingPanel\ image\ to\ an\ image\ file\ on\ the\ web.\r\n
comment37.params=
comment37.target=void\ exit()
comment37.text=\r\n\ Closes\ the\ DrawingPanel\ and\ exits\ the\ program.\r\n
comment38.params=
comment38.target=java.lang.String\ getCallingClassName()
comment38.text=\r\n\ Returns\ a\ best\ guess\ about\ the\ name\ of\ the\ class\ that\ constructed\ this\ panel.\r\n
comment39.params=
comment39.target=java.util.Map\ getCounts()
comment39.text=\r\n\ Returns\ a\ map\ of\ counts\ of\ occurrences\ of\ calls\ of\ various\ drawing\ methods.\r\n\ You\ can\ print\ this\ map\ to\ see\ how\ many\ times\ your\ graphics\ methods\ have\r\n\ been\ called\ to\ aid\ in\ debugging.\r\n\ @return\ map\ of\ {method\ name,\ count}\ pairs\r\n
comment4.params=rgb
comment4.target=int\ getAlpha(int)
comment4.text=\r\n\ Returns\ the\ alpha\ (opacity)\ component\ of\ the\ given\ RGB\ pixel\ from\ 0-255.\r\n\ Often\ used\ in\ conjunction\ with\ the\ methods\ getPixelRGB,\ setPixelRGB,\ etc.\r\n\ @param\ rgb\ RGB\ integer\ with\ alpha\ in\ bits\ 0-7,\ red\ in\ bits\ 8-15,\ green\ in\r\n\ bits\ 16-23,\ and\ blue\ in\ bits\ 24-31\r\n\ @return\ alpha\ component\ from\ 0-255\r\n
comment40.params=
comment40.target=java.awt.Graphics\ getDebuggingGraphics()
comment40.text=\r\n\ A\ variation\ of\ getGraphics\ that\ returns\ an\ object\ that\ records\r\n\ a\ count\ for\ various\ drawing\ methods.\r\n\ See\ also\:\ getCounts\r\n\ @return\ debug\ Graphics\ object\r\n
comment41.params=
comment41.target=java.awt.Graphics2D\ getGraphics()
comment41.text=\r\n\ Obtain\ the\ Graphics\ object\ to\ draw\ on\ the\ panel.\r\n\ @return\ panel's\ Graphics\ object\r\n
comment42.params=
comment42.target=java.awt.image.BufferedImage\ getImage()
comment42.text=\r\n\ Creates\ the\ buffered\ image\ for\ drawing\ on\ this\ panel.\r\n
comment43.params=
comment43.target=int\ getHeight()
comment43.text=\r\n\ Returns\ the\ drawing\ panel's\ height\ in\ pixels.\r\n\ @return\ drawing\ panel's\ height\ in\ pixels\r\n
comment44.params=x\ y
comment44.target=java.awt.Color\ getPixel(int,\ int)
comment44.text=\r\n\ Returns\ the\ color\ of\ the\ pixel\ at\ the\ given\ x/y\ coordinate\ as\ a\ Color\ object.\r\n\ If\ nothing\ has\ been\ explicitly\ drawn\ on\ this\ particular\ pixel,\ the\ panel's\r\n\ background\ color\ is\ returned.\r\n\ @param\ x\ x-coordinate\ of\ pixel\ to\ retrieve\r\n\ @param\ y\ y-coordinate\ of\ pixel\ to\ retrieve\r\n\ @return\ pixel\ (x,\ y)\ color\ as\ a\ Color\ object\r\n\ @throws\ IllegalArgumentException\ if\ (x,\ y)\ is\ out\ of\ range\r\n
comment45.params=x\ y
comment45.target=int\ getPixelRGB(int,\ int)
comment45.text=\r\n\ Returns\ the\ color\ of\ the\ pixel\ at\ the\ given\ x/y\ coordinate\ as\ an\ RGB\ integer.\r\n\ The\ individual\ red,\ green,\ and\ blue\ components\ of\ the\ RGB\ integer\ can\ be\r\n\ extracted\ from\ this\ by\ calling\ DrawingPanel.getRed,\ getGreen,\ and\ getBlue.\r\n\ If\ nothing\ has\ been\ explicitly\ drawn\ on\ this\ particular\ pixel,\ the\ panel's\r\n\ background\ color\ is\ returned.\r\n\ See\ also\:\ getPixel.\r\n\ @param\ x\ x-coordinate\ of\ pixel\ to\ retrieve\r\n\ @param\ y\ y-coordinate\ of\ pixel\ to\ retrieve\r\n\ @return\ pixel\ (x,\ y)\ color\ as\ an\ RGB\ integer\r\n\ @throws\ IllegalArgumentException\ if\ (x,\ y)\ is\ out\ of\ range\r\n
comment46.params=
comment46.target=java.awt.Color[][]\ getPixels()
comment46.text=\r\n\ Returns\ the\ colors\ of\ all\ pixels\ in\ this\ DrawingPanel\ as\ a\ 2-D\ array\r\n\ of\ Color\ objects.\r\n\ The\ first\ index\ of\ the\ array\ is\ the\ y-coordinate,\ and\ the\ second\ index\r\n\ is\ the\ x-coordinate.\ \ So,\ for\ example,\ index\ [r][c]\ represents\ the\ RGB\r\n\ pixel\ data\ for\ the\ pixel\ at\ position\ (x\=c,\ y\=r).\r\n\ @return\ 2D\ array\ of\ colors\ (row-major)\r\n
comment47.params=
comment47.target=int[][]\ getPixelsRGB()
comment47.text=\r\n\ Returns\ the\ colors\ of\ all\ pixels\ in\ this\ DrawingPanel\ as\ a\ 2-D\ array\r\n\ of\ RGB\ integers.\r\n\ The\ first\ index\ of\ the\ array\ is\ the\ y-coordinate,\ and\ the\ second\ index\r\n\ is\ the\ x-coordinate.\ \ So,\ for\ example,\ index\ [r][c]\ represents\ the\ RGB\r\n\ pixel\ data\ for\ the\ pixel\ at\ position\ (x\=c,\ y\=r).\r\n\ The\ individual\ red,\ green,\ and\ blue\ components\ of\ each\ RGB\ integer\ can\ be\r\n\ extracted\ from\ this\ by\ calling\ DrawingPanel.getRed,\ getGreen,\ and\ getBlue.\r\n\ @return\ 2D\ array\ of\ RGB\ integers\ (row-major)\r\n
comment48.params=
comment48.target=java.awt.Dimension\ getSize()
comment48.text=\r\n\ Returns\ the\ drawing\ panel's\ pixel\ size\ (width,\ height)\ as\ a\ Dimension\ object.\r\n\ @return\ panel's\ size\r\n
comment49.params=
comment49.target=int\ getWidth()
comment49.text=\r\n\ Returns\ the\ drawing\ panel's\ width\ in\ pixels.\r\n\ @return\ panel's\ width\r\n
comment5.params=rgb
comment5.target=int\ getBlue(int)
comment5.text=\r\n\ Returns\ the\ blue\ component\ of\ the\ given\ RGB\ pixel\ from\ 0-255.\r\n\ Often\ used\ in\ conjunction\ with\ the\ methods\ getPixelRGB,\ setPixelRGB,\ etc.\r\n\ @param\ rgb\ RGB\ integer\ with\ alpha\ in\ bits\ 0-7,\ red\ in\ bits\ 8-15,\ green\ in\r\n\ bits\ 16-23,\ and\ blue\ in\ bits\ 24-31\r\n\ @return\ blue\ component\ from\ 0-255\r\n
comment50.params=
comment50.target=int\ getX()
comment50.text=\r\n\ Returns\ the\ drawing\ panel's\ x-coordinate\ on\ the\ screen.\r\n\ @return\ panel's\ x-coordinate\r\n
comment51.params=
comment51.target=int\ getY()
comment51.text=\r\n\ Returns\ the\ drawing\ panel's\ y-coordinate\ on\ the\ screen.\r\n\ @return\ panel's\ y-coordinate\r\n
comment52.params=
comment52.target=int\ getZoom()
comment52.text=\r\n\ Returns\ the\ drawing\ panel's\ current\ zoom\ factor.\r\n\ Initially\ this\ is\ 1\ to\ indicate\ 100%\ zoom,\ the\ original\ size.\r\n\ A\ factor\ of\ 2\ would\ indicate\ 200%\ zoom,\ and\ so\ on.\r\n\ @return\ zoom\ factor\ (default\ 1)\r\n
comment53.params=img\ infoflags\ x\ y\ width\ height
comment53.target=boolean\ imageUpdate(java.awt.Image,\ int,\ int,\ int,\ int,\ int)
comment53.text=\r\n\ Internal\ method;\r\n\ notifies\ the\ panel\ when\ images\ are\ loaded\ and\ updated.\r\n\ This\ is\ a\ required\ method\ of\ ImageObserver\ interface.\r\n\ This\ is\ an\ internal\ method\ not\ meant\ to\ be\ called\ by\ clients.\r\n\ @param\ img\ internal\ method;\ do\ not\ call\r\n\ @param\ infoflags\ internal\ method;\ do\ not\ call\r\n\ @param\ x\ internal\ method;\ do\ not\ call\r\n\ @param\ y\ internal\ method;\ do\ not\ call\r\n\ @param\ width\ internal\ method;\ do\ not\ call\r\n\ @param\ height\ internal\ method;\ do\ not\ call\r\n
comment54.params=
comment54.target=void\ initializeAnimation()
comment54.text=\r\n\ Sets\ up\ state\ for\ drawing\ and\ saving\ frames\ of\ animation\ to\ a\ GIF\ image.\r\n
comment55.params=
comment55.target=boolean\ isAnimated()
comment55.text=\r\n\ Returns\ whether\ this\ drawing\ panel\ is\ in\ animation\ mode.\r\n
comment56.params=
comment56.target=boolean\ isGraphical()
comment56.text=\r\n\ Returns\ whether\ this\ drawing\ panel\ is\ going\ to\ be\ displayed\ on\ screen.\r\n\ This\ is\ almost\ always\ true\ except\ in\ some\ server\ environments\ where\r\n\ the\ DrawingPanel\ is\ run\ 'headless'\ without\ a\ GUI,\ often\ for\ scripting\r\n\ and\ automation\ purposes.\r\n
comment57.params=
comment57.target=boolean\ isMultiple()
comment57.text=\r\n\ Returns\ true\ if\ the\ drawing\ panel\ class\ is\ in\ multiple\ mode.\r\n\ This\ would\ be\ true\ if\ the\ current\ program\ pops\ up\ several\ drawing\ panels\r\n\ and\ we\ want\ to\ save\ the\ state\ of\ each\ of\ them\ to\ a\ different\ file.\r\n
comment58.params=file
comment58.target=java.awt.Image\ loadImage(java.io.File)
comment58.text=\r\n\ Loads\ an\ image\ from\ the\ given\ file\ on\ disk\ and\ returns\ it\r\n\ as\ an\ Image\ object.\r\n\ @param\ file\ the\ file\ to\ load\r\n\ @return\ loaded\ image\ object\r\n\ @throws\ NullPointerException\ if\ filename\ is\ null\r\n\ @throws\ RuntimeException\ if\ the\ given\ file\ is\ not\ found\r\n
comment59.params=filename
comment59.target=java.awt.Image\ loadImage(java.lang.String)
comment59.text=\r\n\ Loads\ an\ image\ from\ the\ given\ file\ on\ disk\ and\ returns\ it\r\n\ as\ an\ Image\ object.\r\n\ @param\ filename\ name/path\ of\ the\ file\ to\ load\r\n\ @return\ loaded\ image\ object\r\n\ @throws\ NullPointerException\ if\ filename\ is\ null\r\n\ @throws\ RuntimeException\ if\ the\ given\ file\ is\ not\ found\r\n
comment6.params=rgb
comment6.target=int\ getGreen(int)
comment6.text=\r\n\ Returns\ the\ green\ component\ of\ the\ given\ RGB\ pixel\ from\ 0-255.\r\n\ Often\ used\ in\ conjunction\ with\ the\ methods\ getPixelRGB,\ setPixelRGB,\ etc.\r\n\ @param\ rgb\ RGB\ integer\ with\ alpha\ in\ bits\ 0-7,\ red\ in\ bits\ 8-15,\ green\ in\r\n\ bits\ 16-23,\ and\ blue\ in\ bits\ 24-31\r\n\ @return\ green\ component\ from\ 0-255\r\n
comment60.params=e
comment60.target=void\ onClick(DrawingPanel.DPMouseEventHandler)
comment60.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ clicks.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ click\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment61.params=e
comment61.target=void\ onDrag(DrawingPanel.DPMouseEventHandler)
comment61.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ drags.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ drag\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment62.params=e
comment62.target=void\ onEnter(DrawingPanel.DPMouseEventHandler)
comment62.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ enters.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ enter\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment63.params=e
comment63.target=void\ onExit(DrawingPanel.DPMouseEventHandler)
comment63.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ exits.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ exit\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment64.params=e
comment64.target=void\ onKeyDown(DrawingPanel.DPKeyEventHandler)
comment64.text=\r\n\ Adds\ an\ event\ handler\ for\ key\ presses.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ key\ press\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment65.params=e
comment65.target=void\ onKeyUp(DrawingPanel.DPKeyEventHandler)
comment65.text=\r\n\ Adds\ an\ event\ handler\ for\ key\ releases.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ key\ release\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment66.params=e
comment66.target=void\ onMouseClick(DrawingPanel.DPMouseEventHandler)
comment66.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ clicks.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ click\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment67.params=e
comment67.target=void\ onMouseDown(DrawingPanel.DPMouseEventHandler)
comment67.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ button\ down\ events.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ button\ down\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment68.params=e
comment68.target=void\ onMouseDrag(DrawingPanel.DPMouseEventHandler)
comment68.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ drags.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ drag\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment69.params=e
comment69.target=void\ onMouseEnter(DrawingPanel.DPMouseEventHandler)
comment69.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ enters.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ enter\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment7.params=rgb
comment7.target=int\ getRed(int)
comment7.text=\r\n\ Returns\ the\ red\ component\ of\ the\ given\ RGB\ pixel\ from\ 0-255.\r\n\ Often\ used\ in\ conjunction\ with\ the\ methods\ getPixelRGB,\ setPixelRGB,\ etc.\r\n\ @param\ rgb\ RGB\ integer\ with\ alpha\ in\ bits\ 0-7,\ red\ in\ bits\ 8-15,\ green\ in\r\n\ bits\ 16-23,\ and\ blue\ in\ bits\ 24-31\r\n\ @return\ red\ component\ from\ 0-255\r\n
comment70.params=e
comment70.target=void\ onMouseExit(DrawingPanel.DPMouseEventHandler)
comment70.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ exits.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ exit\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment71.params=e
comment71.target=void\ onMouseMove(DrawingPanel.DPMouseEventHandler)
comment71.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ movement.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ move\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment72.params=e
comment72.target=void\ onMouseUp(DrawingPanel.DPMouseEventHandler)
comment72.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ button\ up\ events.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ button\ up\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment73.params=e
comment73.target=void\ onMove(DrawingPanel.DPMouseEventHandler)
comment73.text=\r\n\ Adds\ an\ event\ handler\ for\ mouse\ movement.\r\n\ You\ can\ pass\ a\ lambda\ function\ here\ to\ be\ called\ when\ a\ mouse\ move\ event\ occurs.\r\n\ @param\ e\ event\ handler\ function\ to\ call\r\n\ @throws\ NullPointerException\ if\ event\ handler\ is\ null\r\n
comment74.params=
comment74.target=boolean\ readyToClose()
comment74.text=\r\n\ Returns\ whether\ the\ drawing\ panel\ should\ be\ closed\ and\ the\ program\r\n\ should\ be\ shut\ down.\r\n
comment75.params=image\ oldColor\ newColor
comment75.target=void\ replaceColor(java.awt.image.BufferedImage,\ java.awt.Color,\ java.awt.Color)
comment75.text=\r\n\ Replaces\ all\ occurrences\ of\ the\ given\ old\ color\ with\ the\ given\ new\ color.\r\n
comment76.params=file
comment76.target=void\ save(java.io.File)
comment76.text=\r\n\ Takes\ the\ current\ contents\ of\ the\ drawing\ panel\ and\ writes\ them\ to\r\n\ the\ given\ file.\r\n\ @param\ file\ the\ file\ to\ save\r\n\ @throws\ NullPointerException\ if\ filename\ is\ null\r\n\ @throws\ IOException\ if\ the\ given\ file\ cannot\ be\ written\r\n
comment77.params=filename
comment77.target=void\ save(java.lang.String)
comment77.text=\r\n\ Takes\ the\ current\ contents\ of\ the\ drawing\ panel\ and\ writes\ them\ to\r\n\ the\ given\ file.\r\n\ @param\ filename\ name/path\ of\ the\ file\ to\ save\r\n\ @throws\ NullPointerException\ if\ filename\ is\ null\r\n\ @throws\ IOException\ if\ the\ given\ file\ cannot\ be\ written\r\n
comment78.params=file
comment78.target=void\ saveAnimated(java.io.File)
comment78.text=\r\n\ Takes\ the\ current\ contents\ of\ the\ drawing\ panel\ and\ writes\ them\ to\r\n\ the\ given\ file.\r\n\ @param\ file\ the\ file\ to\ save\r\n\ @throws\ NullPointerException\ if\ filename\ is\ null\r\n\ @throws\ IOException\ if\ the\ given\ file\ cannot\ be\ written\r\n
comment79.params=filename
comment79.target=void\ saveAnimated(java.lang.String)
comment79.text=\r\n\ Takes\ the\ current\ contents\ of\ the\ drawing\ panel\ and\ writes\ them\ to\r\n\ the\ given\ file.\r\n\ @param\ filename\ name/path\ of\ the\ file\ to\ save\r\n\ @throws\ NullPointerException\ if\ filename\ is\ null\r\n\ @throws\ IOException\ if\ the\ given\ file\ cannot\ be\ written\r\n
comment8.params=name
comment8.target=java.lang.Boolean\ getPropertyBoolean(java.lang.String)
comment8.text=\r\n\ Returns\ the\ given\ Java\ system\ property\ as\ a\ Boolean.\r\n\ Note\ uppercase-B\ meaning\ that\ if\ the\ property\ isn't\ set,\ this\ will\ return\ null.\r\n\ That\ also\ means\ that\ if\ you\ call\ it\ and\ try\ to\ store\ as\ lowercase-B\ boolean\ and\r\n\ it's\ null,\ you\ will\ crash\ the\ program.\ \ You\ have\ been\ warned.\r\n
comment80.params=
comment80.target=void\ saveAs()
comment80.text=\r\n\ Called\ when\ the\ user\ presses\ the\ "Save\ As"\ menu\ item.\r\n\ Pops\ up\ a\ file\ chooser\ prompting\ the\ user\ to\ save\ their\ panel\ to\ an\ image.\r\n
comment81.params=
comment81.target=void\ saveAsAnimated()
comment81.text=\r\n\ Called\ when\ the\ user\ presses\ the\ "Save\ As"\ menu\ item\ on\ an\ animated\ panel.\r\n\ Pops\ up\ a\ file\ chooser\ prompting\ the\ user\ to\ save\ their\ panel\ to\ an\ image.\r\n
comment82.params=extension
comment82.target=java.lang.String\ saveAsHelper(java.lang.String)
comment82.text=\r\n\ A\ helper\ method\ to\ facilitate\ the\ Save\ As\ action\ for\ both\ animated\r\n\ and\ non-animated\ images.\r\n
comment83.params=
comment83.target=java.lang.String\ saveToTempFile()
comment83.text=\r\n\ Saves\ the\ drawing\ panel's\ image\ to\ a\ temporary\ file\ and\ returns\r\n\ that\ file's\ name.\r\n
comment84.params=alwaysOnTop
comment84.target=void\ setAlwaysOnTop(boolean)
comment84.text=\r\n\ Sets\ whether\ the\ panel\ will\ always\ cover\ other\ windows\ (default\ false).\r\n\ @param\ alwaysOnTop\ true\ if\ the\ panel\ should\ always\ cover\ other\ windows\r\n
comment85.params=antiAlias
comment85.target=void\ setAntiAlias(boolean)
comment85.text=\r\n\ Sets\ whether\ the\ panel\ should\ use\ anti-aliased\ /\ smoothed\ graphics\ (default\ true).\r\n\ @param\ antiAlias\ true\ if\ the\ panel\ should\ be\ smoothed\r\n
comment86.params=c
comment86.target=void\ setBackground(java.awt.Color)
comment86.text=\r\n\ Sets\ the\ background\ color\ of\ the\ drawing\ panel\ to\ be\ the\ given\ color.\r\n\ @param\ c\ color\ to\ use\ as\ background\r\n\ @throws\ NullPointerException\ if\ color\ is\ null\r\n
comment87.params=rgb
comment87.target=void\ setBackground(int)
comment87.text=\r\n\ Sets\ the\ background\ color\ of\ the\ drawing\ panel\ to\ be\ the\ color\r\n\ represented\ by\ the\ given\ RGB\ integer.\r\n\ @param\ rgb\ RGB\ integer\ to\ use\ as\ background\ color\ (full\ alpha\ assumed/applied)\r\n
comment88.params=gridLines
comment88.target=void\ setGridLines(boolean)
comment88.text=\r\n\ Enables\ or\ disables\ the\ drawing\ of\ grid\ lines\ on\ top\ of\ the\ image\ to\ help\r\n\ with\ debugging\ sizes\ and\ coordinates.\r\n\ By\ default\ the\ grid\ lines\ will\ be\ shown\ every\ 10\ pixels\ in\ each\ dimension.\r\n\ @param\ gridLines\ whether\ to\ show\ grid\ lines\ (true)\ or\ not\ (false)\r\n
comment89.params=gridLines\ pxGap
comment89.target=void\ setGridLines(boolean,\ int)
comment89.text=\r\n\ Enables\ or\ disables\ the\ drawing\ of\ grid\ lines\ on\ top\ of\ the\ image\ to\ help\r\n\ with\ debugging\ sizes\ and\ coordinates.\r\n\ The\ grid\ lines\ will\ be\ shown\ every\ pxGap\ pixels\ in\ each\ dimension.\r\n\ @param\ gridLines\ whether\ to\ show\ grid\ lines\ (true)\ or\ not\ (false)\r\n\ @param\ pxGap\ number\ of\ pixels\ between\ grid\ lines\r\n
comment9.params=
comment9.target=java.lang.String\ getSaveFileName()
comment9.text=\r\n\ Returns\ the\ file\ name\ used\ for\ saving\ all\ DrawingPanel\ instances.\r\n\ By\ default\ this\ is\ null,\ but\ it\ can\ be\ set\ using\ setSaveFileName\r\n\ or\ by\ setting\ the\ SAVE_PROPERTY\ env\ variable.\r\n\ @return\ the\ shared\ save\ file\ name\r\n
comment90.params=height
comment90.target=void\ setHeight(int)
comment90.text=\r\n\ Sets\ the\ drawing\ panel's\ height\ in\ pixels\ to\ the\ given\ value.\r\n\ After\ calling\ this\ method,\ the\ client\ must\ call\ getGraphics()\ again\r\n\ to\ get\ the\ new\ graphics\ context\ of\ the\ newly\ enlarged\ image\ buffer.\r\n\ @param\ height\ height,\ in\ pixels\r\n\ @throws\ IllegalArgumentException\ if\ height\ is\ negative\ or\ exceeds\ MAX_SIZE\r\n
comment91.params=x\ y\ color
comment91.target=void\ setPixel(int,\ int,\ java.awt.Color)
comment91.text=\r\n\ Sets\ the\ color\ of\ the\ pixel\ at\ the\ given\ x/y\ coordinate\ to\ be\ the\ given\ color.\r\n\ If\ the\ color\ is\ null,\ the\ call\ has\ no\ effect.\r\n\ @param\ x\ x-coordinate\ of\ pixel\ to\ set\r\n\ @param\ y\ y-coordinate\ of\ pixel\ to\ set\r\n\ @param\ color\ Color\ to\ set\ the\ pixel\ to\ use\r\n\ @throws\ IllegalArgumentException\ if\ x\ or\ y\ is\ out\ of\ bounds\r\n\ @throws\ NullPointerException\ if\ color\ is\ null\r\n
comment92.params=x\ y\ rgb
comment92.target=void\ setPixel(int,\ int,\ int)
comment92.text=\r\n\ Sets\ the\ color\ of\ the\ pixel\ at\ the\ given\ x/y\ coordinate\ to\ be\ the\ color\r\n\ represented\ by\ the\ given\ RGB\ integer.\r\n\ The\ passed\ RGB\ integer's\ alpha\ value\ is\ ignored\ and\ a\ full\ alpha\ of\ 255\r\n\ is\ always\ used\ here,\ to\ avoid\ common\ bugs\ with\ using\ a\ 0\ value\ for\ alpha.\r\n\ See\ also\:\ setPixel.\r\n\ See\ also\:\ setPixelRGB.\r\n\ @param\ x\ x-coordinate\ of\ pixel\ to\ set\r\n\ @param\ y\ y-coordinate\ of\ pixel\ to\ set\r\n\ @param\ rgb\ RGB\ integer\ representing\ the\ color\ to\ set\ the\ pixel\ to\ use\r\n\ @throws\ IllegalArgumentException\ if\ x\ or\ y\ is\ out\ of\ bounds\r\n
comment93.params=x\ y\ rgb
comment93.target=void\ setPixelRGB(int,\ int,\ int)
comment93.text=\r\n\ Sets\ the\ color\ of\ the\ pixel\ at\ the\ given\ x/y\ coordinate\ to\ be\ the\ color\r\n\ represented\ by\ the\ given\ RGB\ integer.\r\n\ The\ passed\ RGB\ integer's\ alpha\ value\ is\ ignored\ and\ a\ full\ alpha\ of\ 255\r\n\ is\ always\ used\ here,\ to\ avoid\ common\ bugs\ with\ using\ a\ 0\ value\ for\ alpha.\r\n\ See\ also\:\ setPixel.\r\n\ @param\ x\ x-coordinate\ of\ pixel\ to\ set\r\n\ @param\ y\ y-coordinate\ of\ pixel\ to\ set\r\n\ @param\ rgb\ RGB\ integer\ representing\ the\ color\ to\ set\ the\ pixel\ to\ use\r\n\ @throws\ IllegalArgumentException\ if\ x\ or\ y\ is\ out\ of\ bounds\r\n
comment94.params=pixels
comment94.target=void\ setPixels(java.awt.Color[][])
comment94.text=\r\n\ Sets\ the\ colors\ of\ all\ pixels\ in\ this\ DrawingPanel\ to\ the\ colors\r\n\ in\ the\ given\ 2-D\ array\ of\ Color\ objects.\r\n\ The\ first\ index\ of\ the\ array\ is\ the\ y-coordinate,\ and\ the\ second\ index\r\n\ is\ the\ x-coordinate.\ \ So,\ for\ example,\ index\ [r][c]\ represents\ the\ RGB\r\n\ pixel\ data\ for\ the\ pixel\ at\ position\ (x\=c,\ y\=r).\r\n\ If\ the\ given\ array's\ dimensions\ do\ not\ match\ the\ width/height\ of\ the\r\n\ drawing\ panel,\ the\ panel\ is\ resized\ to\ match\ the\ array.\r\n\ If\ the\ pixel\ array\ is\ null\ or\ size\ 0,\ the\ call\ has\ no\ effect.\r\n\ If\ any\ rows\ or\ colors\ in\ the\ array\ are\ null,\ those\ pixels\ will\ be\ ignored.\r\n\ The\ 2-D\ array\ passed\ is\ assumed\ to\ be\ rectangular\ in\ length\ (not\ jagged).\r\n\ @param\ pixels\ 2D\ array\ of\ pixels\ (row-major)\r\n\ @throws\ NullPointerException\ if\ pixels\ array\ is\ null\r\n
comment95.params=pixels
comment95.target=void\ setPixels(int[][])
comment95.text=\r\n\ Sets\ the\ colors\ of\ all\ pixels\ in\ this\ DrawingPanel\ to\ the\ colors\r\n\ represented\ by\ the\ given\ 2-D\ array\ of\ RGB\ integers.\r\n\ The\ first\ index\ of\ the\ array\ is\ the\ y-coordinate,\ and\ the\ second\ index\r\n\ is\ the\ x-coordinate.\ \ So,\ for\ example,\ index\ [r][c]\ represents\ the\ RGB\r\n\ pixel\ data\ for\ the\ pixel\ at\ position\ (x\=c,\ y\=r).\r\n\ If\ the\ given\ array's\ dimensions\ do\ not\ match\ the\ width/height\ of\ the\r\n\ drawing\ panel,\ the\ panel\ is\ resized\ to\ match\ the\ array.\r\n\ If\ the\ pixel\ array\ is\ null\ or\ size\ 0,\ the\ call\ has\ no\ effect.\r\n\ The\ 2-D\ array\ passed\ is\ assumed\ to\ be\ rectangular\ in\ length\ (not\ jagged).\r\n\ @param\ pixels\ 2D\ array\ of\ pixels\ (row-major)\r\n\ @throws\ NullPointerException\ if\ pixels\ array\ is\ null\r\n
comment96.params=pixels
comment96.target=void\ setPixelsRGB(int[][])
comment96.text=\r\n\ Sets\ the\ colors\ of\ all\ pixels\ in\ this\ DrawingPanel\ to\ the\ colors\r\n\ represented\ by\ the\ given\ 2-D\ array\ of\ RGB\ integers.\r\n\ The\ first\ index\ of\ the\ array\ is\ the\ y-coordinate,\ and\ the\ second\ index\r\n\ is\ the\ x-coordinate.\ \ So,\ for\ example,\ index\ [r][c]\ represents\ the\ RGB\r\n\ pixel\ data\ for\ the\ pixel\ at\ position\ (x\=c,\ y\=r).\r\n\ If\ the\ given\ array's\ dimensions\ do\ not\ match\ the\ width/height\ of\ the\r\n\ drawing\ panel,\ the\ panel\ is\ resized\ to\ match\ the\ array.\r\n\ If\ the\ pixel\ array\ is\ null\ or\ size\ 0,\ the\ call\ has\ no\ effect.\r\n\ The\ 2-D\ array\ passed\ is\ assumed\ to\ be\ rectangular\ in\ length\ (not\ jagged).\r\n\ @param\ pixels\ 2D\ array\ of\ pixels\ (row-major)\r\n\ @throws\ NullPointerException\ if\ pixels\ array\ is\ null\r\n
comment97.params=width\ height
comment97.target=void\ setSize(int,\ int)
comment97.text=\r\n\ Sets\ the\ drawing\ panel's\ pixel\ size\ (width,\ height)\ to\ the\ given\ values.\r\n\ After\ calling\ this\ method,\ the\ client\ must\ call\ getGraphics()\ again\r\n\ to\ get\ the\ new\ graphics\ context\ of\ the\ newly\ enlarged\ image\ buffer.\r\n\ @param\ width\ width,\ in\ pixels\r\n\ @param\ height\ height,\ in\ pixels\r\n\ @throws\ IllegalArgumentException\ if\ width/height\ is\ negative\ or\ exceeds\ MAX_SIZE\r\n
comment98.params=text
comment98.target=void\ setStatusBarText(java.lang.String)
comment98.text=\r\n\ Sets\ the\ text\ that\ will\ appear\ in\ the\ drawing\ panel's\ bottom\ status\ bar.\r\n
comment99.params=
comment99.target=void\ setupMenuBar()
comment99.text=\r\n\ Initializes\ the\ drawing\ panel's\ menu\ bar\ items.\r\n
numComments=114