-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawFrame.ctxt
More file actions
53 lines (53 loc) · 4.32 KB
/
Copy pathDrawFrame.ctxt
File metadata and controls
53 lines (53 loc) · 4.32 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
#BlueJ class context
comment0.params=
comment0.target=DrawFrame()
comment0.text=\r\n\ Constructor\ for\ DrawFrame\ class\ sets\ the\ background\ color\ to\ be\r\n\ white\ and\ sets\ it\ to\ listen\ for\ mouse\ events\ on\ itself.\r\n
comment1.params=g
comment1.target=void\ paintComponent(java.awt.Graphics)
comment1.text=\r\n\ Draw\ the\ contents\ of\ the\ panel.\ \ Since\ no\ information\ is\r\n\ saved\ about\ what\ the\ user\ has\ drawn,\ the\ user's\ drawing\r\n\ is\ erased\ whenever\ this\ routine\ is\ called.\r\n
comment10.params=x\ y\ rgb
comment10.target=int\ filterRGB(int,\ int,\ int)
comment11.params=im
comment11.target=java.awt.Image\ makeColorTransparent(java.awt.image.BufferedImage)
comment12.params=arr
comment12.target=int\ max(java.util.ArrayList)
comment12.text=\r\n\ Returns\ max\ value\ of\ array\ list\r\n
comment13.params=arr
comment13.target=int\ min(java.util.ArrayList)
comment13.text=\r\n\ Returns\ min\ value\ of\ array\ list\r\n
comment14.params=evt
comment14.target=void\ mouseDragged(java.awt.event.MouseEvent)
comment14.text=\r\n\ Called\ whenever\ the\ user\ moves\ the\ mouse\ while\ a\ mouse\ button\ is\ held\ down.\ \ \r\n\ If\ the\ user\ is\ drawing,\ draw\ a\ line\ segment\ from\ the\ previous\ mouse\ location\ \r\n\ to\ the\ current\ mouse\ location,\ and\ set\ up\ prevX\ and\ prevY\ for\ the\ next\ call.\ \ \r\n\ Note\ that\ in\ case\ the\ user\ drags\ outside\ of\ the\ drawing\ area,\ the\ values\ of\r\n\ x\ and\ y\ are\ "clamped"\ to\ lie\ within\ this\ area.\ \ This\ avoids\ drawing\ on\ the\ color\ \r\n\ palette\ or\ Post\ button.\r\n
comment15.params=evt
comment15.target=void\ mouseEntered(java.awt.event.MouseEvent)
comment16.params=evt
comment16.target=void\ mouseExited(java.awt.event.MouseEvent)
comment17.params=evt
comment17.target=void\ mouseClicked(java.awt.event.MouseEvent)
comment18.params=evt
comment18.target=void\ mouseMoved(java.awt.event.MouseEvent)
comment2.params=y
comment2.target=void\ changeColor(int)
comment2.text=\r\n\ Change\ the\ drawing\ color\ after\ the\ user\ has\ clicked\ the\r\n\ mouse\ on\ the\ color\ palette\ at\ a\ point\ with\ y-coordinate\ y.\r\n\ (Note\ that\ I\ can't\ just\ call\ repaint\ and\ redraw\ the\ whole\r\n\ panel,\ since\ that\ would\ erase\ the\ user's\ drawing\!)\r\n
comment3.params=
comment3.target=void\ setUpDrawingGraphics()
comment3.text=\r\n\ This\ routine\ is\ called\ in\ mousePressed\ when\ the\ user\ clicks\ on\ the\ drawing\ area.\r\n\ It\ sets\ up\ the\ graphics\ context,\ graphicsForDrawing,\ to\ be\ used\ to\ draw\ the\ user's\ \r\n\ sketch\ in\ the\ current\ color.\r\n
comment4.params=evt
comment4.target=void\ mousePressed(java.awt.event.MouseEvent)
comment4.text=\r\n\ This\ is\ called\ when\ the\ user\ presses\ the\ mouse\ anywhere\ in\ the\ applet.\ \ \r\n\ There\ are\ three\ possible\ responses,\ depending\ on\ where\ the\ user\ clicked\:\ \ \r\n\ Change\ the\ current\ color,\ Post\ the\ drawing,\ or\ start\ drawing\ a\ curve.\ \ \r\n\ (Or\ do\ nothing\ if\ user\ clicks\ on\ the\ border.)\r\n
comment5.params=evt
comment5.target=void\ mouseReleased(java.awt.event.MouseEvent)
comment5.text=\r\n\ Called\ whenever\ the\ user\ releases\ the\ mouse\ button.\ If\ the\ user\ was\ drawing\ \r\n\ a\ curve,\ the\ curve\ is\ done,\ so\ we\ should\ set\ drawing\ to\ false\ and\ get\ rid\ of\r\n\ the\ graphics\ context\ that\ we\ created\ to\ use\ during\ the\ drawing.\r\n
comment6.params=panel
comment6.target=void\ submit(javax.swing.JPanel)
comment6.text=\r\n\ Returns\ picture\ submitted\r\n
comment7.params=file
comment7.target=boolean\ shortenPic(java.lang.String)
comment7.text=\r\n\ Crops\ icon\ out\ of\ jpanel\r\n
comment8.params=image
comment8.target=java.awt.image.BufferedImage\ toBufferedImage(java.awt.Image)
comment8.text=\r\n\ Convert\ Image\ to\ BufferedImage.\r\n\r\n\ @param\ image\ Image\ to\ be\ converted\ to\ BufferedImage.\r\n\ @return\ BufferedImage\ corresponding\ to\ provided\ Image.\r\n
comment9.params=im\ color
comment9.target=java.awt.Image\ makeColorTransparent(java.awt.image.BufferedImage,\ java.awt.Color)
comment9.text=\r\n\ Make\ provided\ image\ transparent\ wherever\ color\ matches\ the\ provided\ color.\r\n\r\n\ @param\ im\ BufferedImage\ whose\ color\ will\ be\ made\ transparent.\r\n\ @param\ color\ Color\ in\ provided\ image\ which\ will\ be\ made\ transparent.\r\n\ @return\ Image\ with\ transparency\ applied.\r\n
numComments=19