- Timestamp:
- 01/13/14 11:30:53 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Help.java
r686 r687 19 19 item, 20 20 line, 21 text 21 text, 22 widget 22 23 }; 23 24 … … 38 39 private static final String dragString = "d"; 39 40 40 private static final String commandPadding = " ";41 private static final String padding = " ";41 private static final String commandPadding = " "; 42 private static final String padding = " "; 42 43 43 44 private static final String command(int mod, int button, boolean drag) { 44 String cmd = (drag ? dragString : "") + modifiers[mod] + buttons[button] ;45 return commandPadding.substring(cmd.length()) + cmd + separatorString;45 String cmd = (drag ? dragString : "") + modifiers[mod] + buttons[button] + separatorString; 46 return commandPadding.substring(cmd.length()) + cmd; 46 47 } 47 48 … … 52 53 private static final String left(Context context, int mod, int other) { 53 54 switch(context) { 55 case widget: return "Left click widget"; 54 56 case background: 55 57 if((mod & (control | shift)) != 0) return "Go forward"; … … 63 65 private static final String middle(Context context, int mod, int other) { 64 66 switch(context) { 67 case widget: return "Middle click widget"; 65 68 case background: 66 69 if((other & cursor) != 0) return "Place item(s)"; … … 79 82 private static final String right(Context context, int mod, int other) { 80 83 switch(context) { 84 case widget: return "Right click widget"; 81 85 case background: 82 86 if((other & cursor) != 0) return "Stamp item(s)"; … … 97 101 private static final String left_right(Context context, int mod, int other) { 98 102 switch(context) { 103 case widget: return null; 99 104 default: 100 105 if((other & cursor) == 0) return "Extract attributes"; … … 106 111 private static final String middle_right(Context context, int mod, int other) { 107 112 switch(context) { 113 case widget: return null; 108 114 case text: 109 115 if((other & cursor) != 0 && FrameUtils.getCurrentItem() instanceof Text) return "Swap text"; … … 118 124 private static final String drag_left(Context context, int mod, int other) { 119 125 switch(context) { 126 case widget: return null; 120 127 case background: 121 128 if((mod & shift) != 0 && (other & cursor) == 0) return "Drag to pan"; … … 130 137 private static final String drag_middle(Context context, int mod, int other) { 131 138 switch(context) { 139 case widget: return null; 132 140 case text: 133 141 if((other & cursor) == 0) return "Cut region"; … … 138 146 private static final String drag_right(Context context, int mod, int other) { 139 147 switch(context) { 148 case widget: return null; 140 149 case line: 141 150 return "Extrude shape"; … … 174 183 } 175 184 } 176 context = Context.item; 185 if(iw != null) { 186 context = Context.widget; 187 } else { 188 context = Context.item; 189 } 177 190 } else { 178 191 context = Context.background; … … 183 196 String status = ""; 184 197 185 if(iw != null) { 186 187 status = " Widget: " + iw.getName() + "\n (widgets have their own individual input handling)"; 188 189 } else { 190 191 String l = left(context, mod, other); 192 String m = middle(context, mod, other); 193 String r = right(context, mod, other); 194 String lr = left_right(context, mod, other); 195 String lm = left_middle(context, mod, other); 196 String mr = middle_right(context, mod, other); 197 String dl = drag_left(context, mod, other); 198 String dm = drag_middle(context, mod, other); 199 String dr = drag_right(context, mod, other); 200 201 if(l != null) status += command(mod, left) + l + padding.substring(l.length()); 202 if(m != null) status += command(mod, middle) + m + padding.substring(m.length()); 203 if(r != null) status += command(mod, right) + r + padding.substring(r.length()); 204 if(lm != null) status += command(mod, left | middle) + lm + padding.substring(lm.length()); 205 if(lr != null) status += command(mod, left | right) + lr + padding.substring(lr.length()); 206 if(mr != null) status += command(mod, middle | right) + mr + padding.substring(mr.length()); 207 if(dl != null || dm != null || dr != null) status += "\n"; 208 if(dl != null) status += command(mod, left, true) + dl + padding.substring(dl.length()); 209 if(dm != null) status += command(mod, middle, true) + dm + padding.substring(dm.length()); 210 if(dr != null) status += command(mod, right, true) + dr + padding.substring(dr.length()); 211 212 } 198 199 String l = left(context, mod, other); 200 String m = middle(context, mod, other); 201 String r = right(context, mod, other); 202 String lr = left_right(context, mod, other); 203 String lm = left_middle(context, mod, other); 204 String mr = middle_right(context, mod, other); 205 String dl = drag_left(context, mod, other); 206 String dm = drag_middle(context, mod, other); 207 String dr = drag_right(context, mod, other); 208 209 if(l != null) status += command(mod, left) + l + padding.substring(l.length()); 210 if(m != null) status += command(mod, middle) + m + padding.substring(m.length()); 211 if(r != null) status += command(mod, right) + r + padding.substring(r.length()); 212 if(lm != null) status += command(mod, left | middle) + lm + padding.substring(lm.length()); 213 if(lr != null) status += command(mod, left | right) + lr + padding.substring(lr.length()); 214 if(mr != null) status += command(mod, middle | right) + mr + padding.substring(mr.length()); 215 if(dl != null || dm != null || dr != null || iw != null) status += "\n"; 216 if(dl != null) status += command(mod, left, true) + dl + padding.substring(dl.length()); 217 if(dm != null) status += command(mod, middle, true) + dm + padding.substring(dm.length()); 218 if(dr != null) status += command(mod, right, true) + dr + padding.substring(dr.length()); 219 if(iw != null) status += commandPadding + "Widget: " + iw.getClass().getSimpleName(); 220 213 221 214 222 MessageBay.setStatus(status);
Note:
See TracChangeset
for help on using the changeset viewer.