|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGraphics2DTest
Graphics2DTestPlusButton
This is an extension of the Graphics2DTest example that adds a movable JButton to the canvas. The inner class MovableButtonMouseListener is the most interesting part.
Nested Class Summary | |
static class |
Graphics2DTestPlusButton.MovableButtonMouseListener
Class MovableButtonMouseListener extends JFC's MouseInputAdpater to provide handlers for three mouse events: mouse pressed, mouse dragged, and mouse released. |
Nested classes inherited from class Graphics2DTest |
Graphics2DTest.DrawingCanvas, Graphics2DTest.MousePressedListener, Graphics2DTest.RectShape |
Field Summary | |
protected static javax.swing.JButton |
button
A movable button on the canvas |
protected static boolean |
buttonEnabled
Current state of the movable button |
protected static Graphics2DTestPlusButton.MovableButtonMouseListener |
mouseHandler
The button mouse handler when it's in the moveable state |
protected static java.awt.event.ActionListener |
savedButtonActionListener
The saved action listener for the movable button |
protected static java.awt.event.MouseListener |
savedButtonMouseListener
The saved mouse listener for the movable button |
Fields inherited from class Graphics2DTest |
addButton, buttonBox, canvas, delButton, frame, numButton, shapeList, vbox, x, y |
Constructor Summary | |
Graphics2DTestPlusButton()
|
Method Summary | |
protected static void |
addButtonListener(javax.swing.JButton enableButtonButton)
Implement the mouse listener for the "Enable Button" button to toggle the enabled/disabled state of the movable button. |
static void |
compose2()
Construct and compose the add-ons to the parent class -- the movable button and the enable/disable button. |
static void |
main(java.lang.String[] args)
Call the parent compose method, then the local compose method. |
Methods inherited from class Graphics2DTest |
addButtonListeners, compose |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static javax.swing.JButton button
protected static Graphics2DTestPlusButton.MovableButtonMouseListener mouseHandler
protected static java.awt.event.ActionListener savedButtonActionListener
protected static java.awt.event.MouseListener savedButtonMouseListener
protected static boolean buttonEnabled
Constructor Detail |
public Graphics2DTestPlusButton()
Method Detail |
public static void compose2()
protected static void addButtonListener(javax.swing.JButton enableButtonButton)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |