OpenFlow GUI Extension - User Interaction
From OpenFlow Wiki
Handling User Input (Mouse)
An object can request to be notified of user interactions via the mouse and keyboards by registering for a callback with
PZManager and implementing the
DrawableEventListener interface. Thus whenever an event occurs, the method
void drawableEvent(Drawable d, String event) is called.
d indicates which object was clicked while
event is some identifier which describes the event. The default identifiers include:
mouse_released- fired when the user has clicked on some
- Other hooks will be added later.
Handling User Input (Keyboard)
The PZWindow class registers the Swing event listeners. If you wish to add new keyboard shortcuts, you currently must add a hook in that class.
Default Responses to User Input
If the window is resized, then the
PZManager receives a callback on the method
windowResized(PZWindow window). By default, this will modify the area used by the topology to fit in the new window size. If PZLayoutManager is being used, then this will also trigger the layout to be redone.
|Drag||move a node|
|Arrow Keys||pan the topology view|
|Alt + Arrow Keys
|Page Up||take a screenshot (saved to the GUI folder)|
|V||reset the view to the default|