RE: specifying fields from input file

Hi Michelle,

Add a DisplayListener to your displays, and in the
implementing displayChanged method, check for MOUSE_PRESSED
(and possibly other mouse-related) events. See
SpreadSheet.displayChanged for a basic example.

You can then access more information about these events by
calling e.getInputEvent() to obtain the original MouseEvent,
then probing the MouseEvent to find out which keyboard
modifiers were pressed for that event.

-Curtis

At 12:32 PM 6/24/2003, you wrote:
>Hi Curtis,
>
>I'm adding the capability for a user to select multiple cells by clicking on
>control and the mouse button. Before I can add the vector class variable to
>SpreadSheet.java and add the selected cells to the vector in selectCell(), I
>need to first allow the user to press "control" and click with the mouse
>button to select cells. In KeyboardBehaviorJ3D.java (I'm making the
>assumption that all cells will display the image in 3D), would it be logical
>to call mapKeyToFunction(func, keycode, modifiers) and extend the
>functionKeys and functionMods arrays to store 1 more element, namely this
>control and mouse click? Then in execFunction(int function), add a case
>statement that will call SpreadSheet.selectCell()?
>
>I'm not sure if modifying KeyboardBehaviorJ3D.java is the right class to
>modify or if adding code to SpreadSheet.java under keyPressed(KeyEvent e){
>....
>  else if (keyCode == KeyEvent.VK_CONTROL) {
>        allow multiple cell selections...
>}
>
>would require fewer changes. 
>Do you have any recommendations?
>
>Thanks,
>Michelle


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: