Class: DrawPanel
- Includes:
- MouseMotionListener
- Defined in:
- lib/roebe/jruby/swing/paint_demo.rb
Instance Attribute Summary collapse
-
#draw_x ⇒ Object
Returns the value of attribute draw_x.
-
#draw_y ⇒ Object
Returns the value of attribute draw_y.
Instance Method Summary collapse
- #mouse_dragged(event) ⇒ Object (also: #mouseDragged)
- #mouse_moved(event) ⇒ Object (also: #mouseMoved)
- #paint_component(graphics) ⇒ Object (also: #paintComponent)
Instance Attribute Details
#draw_x ⇒ Object
Returns the value of attribute draw_x.
13 14 15 |
# File 'lib/roebe/jruby/swing/paint_demo.rb', line 13 def draw_x @draw_x end |
#draw_y ⇒ Object
Returns the value of attribute draw_y.
13 14 15 |
# File 'lib/roebe/jruby/swing/paint_demo.rb', line 13 def draw_y @draw_y end |
Instance Method Details
#mouse_dragged(event) ⇒ Object Also known as: mouseDragged
17 18 19 20 21 |
# File 'lib/roebe/jruby/swing/paint_demo.rb', line 17 def mouse_dragged(event) @draw_x = event.x @draw_y = event.y repaint end |
#mouse_moved(event) ⇒ Object Also known as: mouseMoved
22 23 24 25 26 |
# File 'lib/roebe/jruby/swing/paint_demo.rb', line 22 def mouse_moved(event) @draw_x = event.x @draw_y = event.y repaint end |
#paint_component(graphics) ⇒ Object Also known as: paintComponent
14 15 16 |
# File 'lib/roebe/jruby/swing/paint_demo.rb', line 14 def paint_component(graphics) graphics.draw_oval(@draw_x, @draw_y, 10, 10) end |