Changeset 678


Ignore:
Timestamp:
01/10/14 14:51:04 (10 years ago)
Author:
jts21
Message:

Add help for click+drag commands, and make the status go onto 2 lines if necessary

Location:
trunk/src/org/expeditee/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/Help.java

    r674 r678  
    1717       
    1818        // modifiers
    19         public static final int none = 0, control = 1, shift = 2, drag = 4;
     19        public static final int none = 0, control = 1, shift = 2, drag = 4; // TODO: add mod for click+hold ???
    2020        private static final String[] modifiers = { "", "^", "+", "^+", "d", "d^", "d+", "d^+" };
    2121       
     
    8282        }
    8383       
     84        private static final void fill(String[] array, int indexBit, String value, boolean invert) {
     85                for(int i = 0; i < array.length; i++) {
     86                       
     87                }
     88        }
     89       
    8490        private static final void fill(String[][] array, int[] indices, String value, boolean invert) {
    8591                if(invert) {
     
    119125                fill(statusText[background][left], "Go back");
    120126                fill(statusText[background][left], new int[] { control, control | shift, shift }, "Go forward", false);
     127                fill(statusText[background][left], new int[] { drag, control | drag, shift | drag, control | shift | drag }, null, false); // no action for dragging unless shift down
    121128                fill(statusText[background][left], new int[] { control | shift | drag, shift | drag }, new int[] { panning, panning | action }, "Drag to pan", false, false);
    122129                fill(statusText[background][middle], "Create arrow");
     130                fill(statusText[background][middle], new int[] { drag, control | drag, shift | drag, control | shift | drag }, null, false); // no action for dragging
    123131                fill(statusText[background][right], "Create rectangle");
    124                 fill(statusText[background][left | middle], "");
     132                fill(statusText[background][right], new int[] { drag, control | drag, shift | drag, control | shift | drag }, null, false); // no action for dragging
     133                fill(statusText[background][left | middle], null);
    125134                fill(statusText[background][left | right], "Auto format");
    126135                fill(statusText[background][middle | right], "Undo");
     
    128137        fill(statusText[item][left], "Follow link");
    129138        fill(statusText[item][left], new int[] { control, control | shift }, new int[] { action, panning | action }, "Run action", true, false);
     139        fill(statusText[item][left], new int[] { drag, control | drag, shift | drag, control | shift | drag }, null, false); // no action for dragging
    130140        fill(statusText[item][middle], "Pickup");
     141        fill(statusText[item][middle], new int[] { drag, control | drag, shift | drag, control | shift | drag }, null, false); // no action for dragging
    131142        fill(statusText[item][right], "Copy");
    132         fill(statusText[item][left | middle], "");
     143        fill(statusText[item][right], new int[] { drag, control | drag, shift | drag, control | shift | drag }, null, false); // no action for dragging
     144        fill(statusText[item][left | middle], null); // no action for left + middle
    133145                fill(statusText[item][left | right], "Extract attributes");
    134146                fill(statusText[item][middle | right], "Delete");
     
    136148       
    137149        private static final String commandPadding = "     ";
    138         private static final String padding = "                         ";
     150        private static final String padding = "                  ";
    139151       
    140152        private static final String command(int mod, int button) {
     
    148160                int mod = (FrameMouseActions.isControlDown() ? control : 0) | (FrameMouseActions.isShiftDown() ? shift : 0);
    149161                int other = (ExperimentalFeatures.MousePan.get() ? panning : 0) | (current != null ? current.hasAction() ? action : 0 : 0);
    150                 String l = command(mod, left) + statusText[context][left][mod][other];
    151                 String m = command(mod, middle) + statusText[context][middle][mod][other];
    152                 String r = command(mod, right) + statusText[context][right][mod][other];
    153                 // String lm = command(mod, left | middle) + helpText[context][left | middle][mod][other];
    154                 String lr = command(mod, left | right) + statusText[context][left | right][mod][other];
    155                 String mr = command(mod, middle | right) + statusText[context][middle | right][mod][other];
    156                 MessageBay.setStatus(l + padding.substring(l.length()) +
    157                                              m + padding.substring(m.length()) +
    158                                              r + padding.substring(r.length()) +
    159                                              // lm + padding.substring(lm.length()) +
    160                                              lr + padding.substring(lr.length()) +
    161                                              mr + padding.substring(mr.length()));
     162                String status = "";
     163               
     164                String l = statusText[context][left][mod][other];
     165                String m = statusText[context][middle][mod][other];
     166                String r = statusText[context][right][mod][other];
     167                String lr = statusText[context][left | right][mod][other];
     168                String lm = statusText[context][left | middle][mod][other];
     169                String mr = statusText[context][middle | right][mod][other];
     170                String dl = statusText[context][left][mod | drag][other];
     171                String dm = statusText[context][middle][mod | drag][other];
     172                String dr = statusText[context][right][mod | drag][other];
     173               
     174                if(l != null)  status += command(mod, left) + l + padding.substring(l.length());
     175                if(m != null)  status += command(mod, middle) + m + padding.substring(m.length());
     176                if(r != null)  status += command(mod, right) + r + padding.substring(r.length());
     177                if(lm != null) status += command(mod, left | middle) + lm + padding.substring(lm.length());
     178                if(lr != null) status += command(mod, left | right) + lr + padding.substring(lr.length());
     179                if(mr != null) status += command(mod, middle | right) + mr + padding.substring(mr.length());
     180                if(dl != null || dm != null || dr != null) status += "\n";
     181                if(dl != null) status += command(mod | drag, left) + dl + padding.substring(dl.length());
     182                if(dm != null) status += command(mod | drag, left) + dm + padding.substring(dm.length());
     183                if(dr != null) status += command(mod | drag, left) + dr + padding.substring(dr.length());
     184               
     185                MessageBay.setStatus(status);
    162186        }
    163187
  • trunk/src/org/expeditee/gui/MessageBay.java

    r674 r678  
    2525
    2626
    27         public static final int MESSAGE_BUFFER_HEIGHT = 100;
     27        public static final int MESSAGE_BUFFER_HEIGHT = 105;
    2828
    2929        private static final int MESSAGE_LINK_Y_OFFSET = 100;
     
    453453                if (_status == null) {
    454454                        _status = new Text(status);
    455                         _status.setPosition(0, 90);
     455                        _status.setPosition(0, 85);
    456456                        _status.setOffset(0, FrameGraphics.getMaxFrameSize().height);
    457457                        _status.setLink(null); // maybe link to a help frame?
Note: See TracChangeset for help on using the changeset viewer.