source: other-projects/GlamED/trunk/src/org/honours/gui/KeyboardActions.java@ 26759

Last change on this file since 26759 was 26759, checked in by davidb, 11 years ago

More work done on removing the functionality of toggling on/off the "View/Hide Toolbar" button.

File size: 1.5 KB
Line 
1package org.honours.gui;
2
3import java.awt.event.KeyEvent;
4import java.awt.event.KeyListener;
5
6import org.expeditee.gui.DisplayIO;
7import org.expeditee.gui.Frame;
8import org.expeditee.gui.FrameGraphics;
9import org.expeditee.gui.FrameKeyboardActions;
10import org.honours.actions.MiscActions;
11import org.honours.collection.Collection;
12
13public class KeyboardActions implements KeyListener{
14
15 private static KeyboardActions _instance = null;
16
17 private KeyboardActions(){}
18
19 public static KeyboardActions getInstance(){
20 if(_instance == null)
21 _instance = new KeyboardActions();
22
23 return _instance;
24 }
25
26 @Override
27 public void keyPressed(KeyEvent e) {
28
29 int keyCode = e.getKeyCode();
30 Frame currFrame = DisplayIO.getCurrentFrame();
31 Collection coll = Collection.findCollection(currFrame);
32
33 if(coll != null){
34 //If F9 (Audience Mode button) has been pressed.
35 if(keyCode == KeyEvent.VK_F9){
36
37 if(FrameGraphics.isAudienceMode()){
38 //turn off display of toolbar.
39 HonoursFrameIO.DISPLAY_TOOLBAR = false;
40 MiscActions.ToggleToolbar();
41
42
43 }else{
44 HonoursFrameIO.DISPLAY_TOOLBAR = true;
45 MiscActions.ToggleToolbar();
46 }
47 }
48
49 }
50 FrameKeyboardActions.getInstance().keyPressed(e);
51 }
52
53 @Override
54 public void keyReleased(KeyEvent e) {
55 FrameKeyboardActions.getInstance().keyReleased(e);
56
57 }
58
59 @Override
60 public void keyTyped(KeyEvent e) {
61 FrameKeyboardActions.getInstance().keyTyped(e);
62 }
63
64
65}
Note: See TracBrowser for help on using the repository browser.