|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.tmachine.gpg.hue.ContextManager
All input for the viewport is directed to this class, enabling it to keep track of cursor position, current button and keystates, etc.
| Field Summary | |
protected javax.swing.JComponent |
controlSurface
|
protected Document |
currentDocument
|
protected int |
mx
|
protected int |
my
|
| Constructor Summary | |
ContextManager()
|
|
| Method Summary | |
int[] |
getCursorPosition()
|
Document |
getDocument()
The Document is a simple MVC Model containing data on what shapes there are, where they are, etc; it has all the data that would be "saved" if there were a load/save feature in this demo! |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Automatically updates its knowledge of the mouse cursor position |
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Automatically updates its knowledge of the mouse cursor position |
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
setControlComponent(javax.swing.JComponent c)
Informs this class which component it has to listen to to get input events etc so that it can correctly maintain it's context |
void |
setDocument(Document d)
The Document is a simple MVC Model containing data on what shapes there are, where they are, etc; it has all the data that would be "saved" if there were a load/save feature in this demo! |
void |
setRelativeCursorPosition(int x,
int y)
Sets cursor position ignoring any special transformations performed on the rendering surface (this method then automatically applies those transformations to the incoming co-ords before storing them) |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int mx
protected int my
protected javax.swing.JComponent controlSurface
protected Document currentDocument
| Constructor Detail |
public ContextManager()
| Method Detail |
public void setDocument(Document d)
d - public Document getDocument()
public void setControlComponent(javax.swing.JComponent c)
c - Generally the main renderer component (i.e. this class will listen to key and
mouse events that happen on the main renderer)public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic int[] getCursorPosition()
public void setRelativeCursorPosition(int x,
int y)
Needed because Sun's windowing system for Java is incapable of maintaining a single consistent co-ordinate space for rendering and events.
TODO: doesn't currently do anything special; transformed-painting-surface support isn't added yet
x - y -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||