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:
pressinganddragging. 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 voidmouseClicked(MouseEvent e)Invoked when the mouse button has been clicked (pressed and released) on a component.voidmouseDragged(MouseEvent e)Invoked when a mouse button is pressed on a component and then dragged.voidmouseEntered(MouseEvent e)Invoked when the mouse enters a component.voidmouseExited(MouseEvent e)Invoked when the mouse exits a component.voidmouseMoved(MouseEvent e)Invoked when the mouse button has been moved on a component (with no buttons no down).voidmousePressed(MouseEvent e)Invoked when a mouse button has been pressed on a component.voidmouseReleased(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:
mouseClickedin 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 morePoints to the curve, and with each point, it will repaint theCanvasPanel.- Specified by:
mouseDraggedin 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:
mouseEnteredin 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:
mouseExitedin 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:
mouseMovedin 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:
mousePressedin 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:
mouseReleasedin interfaceMouseListener- Parameters:
e- The mouse event.
-
-