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

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

Initial import of Korii's 520 project for managing digital cultural collections from Greenstone in Expeditee.

File size: 1.6 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;
11
12public class KeyboardActions implements KeyListener{
13
14 private static KeyboardActions _instance = null;
15
16 private KeyboardActions(){}
17
18 public static KeyboardActions getInstance(){
19 if(_instance == null)
20 _instance = new KeyboardActions();
21
22 return _instance;
23 }
24
25 @Override
26 public void keyPressed(KeyEvent e) {
27
28 int keyCode = e.getKeyCode();
29 //Frame currFrame = DisplayIO.getCurrentFrame();
30
31 //TODO:Check if current frame is a "content-layer"
32
33 //If F9 (Audience Mode button) has been pressed.
34 if(keyCode == KeyEvent.VK_F9){
35
36 if(FrameGraphics.isAudienceMode()){
37 //turn off display of toolbar.
38 HonoursFrameIO.DISPLAY_TOOLBAR = false;
39 MiscActions.ToggleToolbar();
40
41 //turn off display of toggle toolbar
42 HonoursFrameIO.DISPLAY_TOGGLER = false;
43 MiscActions.ToggleToggler();
44
45 }else{
46 HonoursFrameIO.DISPLAY_TOOLBAR = true;
47 MiscActions.ToggleToolbar();
48
49 HonoursFrameIO.DISPLAY_TOGGLER = true;
50 MiscActions.ToggleToggler();
51
52 }
53 }
54
55
56 FrameKeyboardActions.getInstance().keyPressed(e);
57 }
58
59 @Override
60 public void keyReleased(KeyEvent e) {
61 FrameKeyboardActions.getInstance().keyReleased(e);
62
63 }
64
65 @Override
66 public void keyTyped(KeyEvent e) {
67 FrameKeyboardActions.getInstance().keyTyped(e);
68 }
69
70
71}
Note: See TracBrowser for help on using the repository browser.