Package com.coswald.jtalker.gui
Class CanvasPanel.CurveCreator
- java.lang.Object
-
- com.coswald.jtalker.gui.CanvasPanel.CurveCreator
-
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,EventListener
- Enclosing class:
- CanvasPanel
protected class CanvasPanel.CurveCreator extends Object implements MouseListener, MouseMotionListener
Creates a curve represented by a set of points based off of user input with the mouse. This is done by two methods:
pressing
anddragging
. A new curve will start when the mouse button is pressed, and will continue until a new press event is generated. While dragging, points will be added to the curve.- Since:
- JTalker 0.1.5
- Version:
- 0.0.1
- Author:
- C. William Oswald
- See Also:
mousePressed(MouseEvent)
,mouseDragged(MouseEvent)
-
-
Constructor Summary
Constructors Constructor Description CurveCreator()
Constructs aCurveCreator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mouseClicked(MouseEvent e)
Invoked when the mouse button has been clicked (pressed and released) on a component.void
mouseDragged(MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged.void
mouseEntered(MouseEvent e)
Invoked when the mouse enters a component.void
mouseExited(MouseEvent e)
Invoked when the mouse exits a component.void
mouseMoved(MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons no down).void
mousePressed(MouseEvent e)
Invoked when a mouse button has been pressed on a component.void
mouseReleased(MouseEvent e)
Invoked when a mouse button has been released on a component.
-
-
-
Method Detail
-
mouseClicked
public void mouseClicked(MouseEvent e)
Invoked when the mouse button has been clicked (pressed and released) on a component. This method is unimplemented (i. e. nothing currently happens).- Specified by:
mouseClicked
in interfaceMouseListener
- Parameters:
e
- The mouse event.
-
mouseDragged
public void mouseDragged(MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. This will add morePoint
s to the curve, and with each point, it will repaint theCanvasPanel
.- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Parameters:
e
- The mouse event.
-
mouseEntered
public void mouseEntered(MouseEvent e)
Invoked when the mouse enters a component. This method is unimplemented (i. e. nothing currently happens).- Specified by:
mouseEntered
in interfaceMouseListener
- Parameters:
e
- The mouse event.
-
mouseExited
public void mouseExited(MouseEvent e)
Invoked when the mouse exits a component. This method is unimplemented (i. e. nothing currently happens).- Specified by:
mouseExited
in interfaceMouseListener
- Parameters:
e
- The mouse event.
-
mouseMoved
public void mouseMoved(MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons no down). This method is unimplemented (i. e. nothing currently happens).- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
mousePressed
public void mousePressed(MouseEvent e)
Invoked when a mouse button has been pressed on a component. This will start a new curve, and makes sure the current color is saved as the color of the curve.- Specified by:
mousePressed
in interfaceMouseListener
- Parameters:
e
- The mouse event.
-
mouseReleased
public void mouseReleased(MouseEvent e)
Invoked when a mouse button has been released on a component. This method is unimplemented (i. e. nothing currently happens).- Specified by:
mouseReleased
in interfaceMouseListener
- Parameters:
e
- The mouse event.
-
-