source: trunk/src/org/expeditee/gio/input/KBMInputEvent.java@ 1415

Last change on this file since 1415 was 1415, checked in by bln4, 5 years ago

Renamed Frame.getItems() to Frame.getSortedItems() to better represent its functionality.

-> org.apollo.ApolloGestureActions
-> org.apollo.ApolloSystem
-> org.expeditee.actions.Actions
-> org.expeditee.actions.Debug
-> org.expeditee.actions.ExploratorySearchActions
-> org.expeditee.actions.JfxBrowserActions
-> org.expeditee.actions.Misc
-> org.expeditee.actions.Navigation
-> org.expeditee.actions.ScriptBase
-> org.expeditee.actions.Simple
-> org.expeditee.agents.ComputeTree
-> org.expeditee.agents.CopyTree
-> org.expeditee.agents.DisplayComet
-> org.expeditee.agents.DisplayTree
-> org.expeditee.agents.DisplayTreeLeaves
-> org.expeditee.agents.GraphFramesetLinks
-> org.expeditee.agents.TreeProcessor
-> org.expeditee.gio.gesture.StandardGestureActions
-> org.expeditee.gui.DisplayController
-> org.expeditee.gui.FrameCreator
-> org.expeditee.gui.FrameIO
-> org.expeditee.io.DefaultTreeWriter
-> org.expeditee.io.JavaWriter
-> org.expeditee.io.PDF2Writer
-> org.expeditee.io.TXTWriter
-> org.expeditee.io.WebParser
-> org.expeditee.io.flowlayout.XGroupItem
-> org.expeditee.items.Dot
-> org.expeditee.items.Item
-> org.expeditee.items.ItemUtils
-> org.expeditee.network.FrameShare
-> org.expeditee.stats.TreeStats


Created ItemsList class to wrap ArrayList<Item>. Frames now use this new class to store its body list (used for display) as well as its primaryBody and surrogateBody.

-> org.expeditee.agents.Format
-> org.expeditee.agents.HFormat
-> org.expeditee.gio.gesture.StandardGestureActions
-> org.expeditee.gui.Frame
-> org.expeditee.gui.FrameUtils


Refactorted Frame.setResort(bool) to Frame.invalidateSorted() to better function how it is intended to with a more accurate name.

-> org.expeditee.agents.Sort


When writing out .exp files and getting attributes to respond to LEFT + RIGHT click, boolean items are by default true. This has always been the case. An ammendment to this is that defaults can now be established.
Also added 'EnterClick' functionality. If cursored over a item with this property and you press enter, it acts as if you have clicked on it instead.

-> org.expeditee.assets.resources-public.framesets.authentication.1.exp to 6.exp
-> org.expeditee.gio.gesture.StandardGestureActions
-> org.expeditee.gio.input.KBMInputEvent
-> org.expeditee.gio.javafx.JavaFXConversions
-> org.expeditee.gio.swing.SwingConversions
-> org.expeditee.gui.AttributeUtils
-> org.expeditee.io.Conversion
-> org.expeditee.io.DefaultFrameWriter
-> org.expeditee.items.Item


Fixed a bug caused by calling Math.abs on Integer.MIN_VALUE returning unexpected result. Due to zero being a thing, you cannot represent Math.abs(Integer.MIN_VALUE) in a Integer object. The solution is to use Integer.MIN_VALUE + 1 instead of Integer.MIN_VALUE.

-> org.expeditee.core.bounds.CombinationBounds
-> org.expeditee.io.flowlayout.DimensionExtent


Recoded the contains function in EllipticalBounds so that intersection tests containing circles work correctly.

-> org.expeditee.core.bounds.EllipticalBounds


Added toString() to PolygonBounds to allow for useful printing during debugging.

-> org.expeditee.core.bounds.PolygonBounds

Implemented Surrogate Mode!

-> org.expeditee.encryption.io.EncryptedExpReader
-> org.expeditee.encryption.io.EncryptedExpWriter
-> org.expeditee.encryption.items.surrogates.EncryptionDetail
-> org.expeditee.encryption.items.surrogates.Label
-> org.expeditee.gui.FrameUtils
-> org.expeditee.gui.ItemsList
-> org.expeditee.items.Item
-> org.expeditee.items.Text


???? Use Integer.MAX_VALUE cast to a float instead of Float.MAX_VALUE. This fixed some bug which I cannot remember.

-> org.expeditee.gio.TextLayoutManager
-> org.expeditee.gio.swing.SwingTextLayoutManager


Improved solution for dealing with the F10 key taking focus away from Expeditee due to it being a assessibility key.

-> org.expeditee.gio.swing.SwingInputManager


Renamed variable visibleItems in FrameGraphics.paintFrame to itemsToPaintCanditates to better represent functional intent.

-> org.expeditee.gui.FrameGraphics


Improved checking for if personal resources exist before recreating them

-> org.expeditee.gui.FrameIO


Repeated messages to message bay now have a visual feedback instead of just a beep. This visual feedback is in the form of a count of the amount of times it has repeated.

-> org.expeditee.gui.MessageBay


Updated comment on the Vector class to explain what vectors are.

-> org.expeditee.gui.Vector


Added constants to represent all of the property keys in DefaultFrameReader and DefaultFrameWriter.

-> org.expeditee.io.DefaultFrameReader
-> org.expeditee.io.DefaultFrameWriter


Updated the KeyList setting to be more heirarcial with how users will store their Secrets.

-> org.expeditee.settings.identity.secrets.KeyList

File size: 3.4 KB
Line 
1package org.expeditee.gio.input;
2
3import org.expeditee.core.Line;
4
5public class KBMInputEvent extends InputEvent {
6
7 public enum EventType {
8 MOUSE_BUTTON_DOWN,
9 MOUSE_BUTTON_UP,
10 MOUSE_MOVE,
11 MOUSE_WHEEL_SCROLL,
12 KEY_DOWN,
13 KEY_UP,
14 CHAR_TYPED
15 }
16
17 /**
18 * Enumerates the mouse buttons of interest to Expeditee.
19 */
20 public enum MouseButton {
21 LEFT,
22 MIDDLE,
23 RIGHT
24 }
25
26 /**
27 * Enumerates the keyboard keys of interest to Expeditee.
28 */
29 public enum Key {
30 SHIFT,CTRL,ALT,
31 ESC,
32 F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,
33 UP_ARROW,DOWN_ARROW,LEFT_ARROW,RIGHT_ARROW,
34 HOME,END,
35 DELETE,
36 PAGE_UP,PAGE_DOWN,
37 BACKSPACE,
38 TAB,
39 ENTER,
40 A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
41 }
42
43 private EventType _eventType;
44 private Object _eventData;
45
46 public KBMInputEvent(EventType type, Object data) throws Exception
47 {
48 super(InputEvent.InputType.KBM);
49 _eventType = type;
50 _eventData = data;
51 checkData();
52 }
53
54 public EventType getEventType()
55 {
56 return _eventType;
57 }
58
59 public Object getData()
60 {
61 return _eventData;
62 }
63
64 /** Gets the key that went down if this is a key-down event. */
65 public Key getKeyDown()
66 {
67 if (_eventType == EventType.KEY_DOWN) return (Key) _eventData;
68
69 return null;
70 }
71
72 /** Gets the key that went up if this is a key-up event. */
73 public Key getKeyUp()
74 {
75 if (_eventType == EventType.KEY_UP) return (Key) _eventData;
76
77 return null;
78 }
79
80 /**
81 * Gets the name of the key that was pressed/released.
82 * Returns the empty string if this is not a key event.
83 */
84 public String getKeyText()
85 {
86 Key key = getKeyDown();
87 if (key == null) key = getKeyUp();
88 if (key == null) return "";
89 return key.name();
90 }
91
92 /** Gets the character that was typed if this is a CHAR_TYPED event. */
93 public Character getCharTyped()
94 {
95 if (_eventType == EventType.CHAR_TYPED) return (Character) _eventData;
96
97 return null;
98 }
99
100 /** Gets the mouse button that went down if this is a mouse-button-down event. */
101 public MouseButton getMouseButtonDown()
102 {
103 if (_eventType == EventType.MOUSE_BUTTON_DOWN) return (MouseButton) _eventData;
104
105 return null;
106 }
107
108 /** Gets the mouse button that went up if this is a mouse-button-up event. */
109 public MouseButton getMouseButtonUp()
110 {
111 if (_eventType == EventType.MOUSE_BUTTON_UP) return (MouseButton) _eventData;
112
113 return null;
114 }
115
116 /** Gets the position of the mouse if this is a mouse-move event. */
117 public Line getMouseMove()
118 {
119 if (_eventType == EventType.MOUSE_MOVE) return (Line) _eventData;
120
121 return null;
122 }
123
124 private void checkData() throws Exception
125 {
126 if (_eventType == null) throw new Exception("No event type specified");
127 if (_eventData == null) throw new Exception("No event data specified");
128
129 switch (_eventType) {
130 case MOUSE_BUTTON_DOWN:
131 case MOUSE_BUTTON_UP:
132 if (!(_eventData instanceof MouseButton)) throw new Exception("MouseButton data expected");
133 break;
134 case KEY_DOWN:
135 case KEY_UP:
136 if (!(_eventData instanceof Key)) throw new Exception("Key data expected");
137 break;
138 case CHAR_TYPED:
139 if (!(_eventData instanceof Character)) throw new Exception("Character data expected");
140 break;
141 case MOUSE_MOVE:
142 if (!(_eventData instanceof Line)) throw new Exception("Line data expected");
143 break;
144 case MOUSE_WHEEL_SCROLL:
145 if (!(_eventData instanceof Integer)) throw new Exception("Integer data expected");
146 break;
147 }
148 }
149
150 @Override
151 public String toString()
152 {
153 return _eventType.toString() + " event : Data = " + _eventData.toString();
154 }
155}
Note: See TracBrowser for help on using the repository browser.