Changeset 681


Ignore:
Timestamp:
01/10/14 17:18:08 (10 years ago)
Author:
jts21
Message:

Add correct status messages for cases where there are items on the cursor

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

Legend:

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

    r676 r681  
    870870
    871871                }
     872                Help.updateStatus();
    872873        }
    873874
     
    11821183                }
    11831184                SessionStats.MovedItems(FreeItems.getInstance());
     1185               
     1186                Help.updateStatus();
    11841187        }
    11851188
     
    15871590                getInstance().refreshHighlights();
    15881591                SessionStats.CopiedItems(copies);
     1592                Help.updateStatus();
    15891593                updateCursor();
    15901594                FrameGraphics.Repaint();
  • trunk/src/org/expeditee/gui/Help.java

    r680 r681  
    44
    55import org.expeditee.items.Item;
     6import org.expeditee.items.Line;
    67import org.expeditee.settings.experimental.ExperimentalFeatures;
    78
     
    1718       
    1819        // modifiers
    19         public static final int none = 0, control = 1, shift = 2, drag = 4, hold = 8;
     20        public static final int none = 0, control = 1, shift = 2, drag = 4;
    2021        private static final String[] modifiers = { "", "^", "+", "^+", "d", "d^", "d+", "d^+" };
    2122       
    2223        // other
    23         public static final int panning = 1, action = 2;
     24        public static final int panning = 1, action = 2, line = 4, cursor = 8;
    2425       
    2526        // separator between command and description
     
    105106       
    106107        // help text
    107         private static final String[/* contexts */][/* buttons */][/* modifiers */][/* other */] statusText = new String[2][8][8][4];
     108        private static final String[/* contexts */][/* buttons */][/* modifiers */][/* other */] statusText = new String[2][8][8][16];
    108109        static {
    109110                fill(statusText[background][left], "Go back");
     
    111112                fill(statusText[background][left], drag, null); // no action for dragging unless shift down
    112113                fill(statusText[background][left], shift | drag, panning, "Drag to pan");
     114                fill(statusText[background][left], drag, cursor, null);
     115               
    113116                fill(statusText[background][middle], "Create arrow");
     117                fill(statusText[background][middle], 0, cursor, "Place item(s)", true, false, true, false);
    114118                fill(statusText[background][middle], drag, null); // no action for dragging
     119               
    115120                fill(statusText[background][right], "Create rectangle");
     121                fill(statusText[background][right], 0, cursor, "Stamp item(s)", true, false, true, false);
    116122                fill(statusText[background][right], drag, null); // no action for dragging
     123               
    117124                fill(statusText[background][left | middle], null); // no action for left + middle
     125               
    118126                fill(statusText[background][left | right], "Auto format");
     127               
    119128                fill(statusText[background][middle | right], "Undo");
     129                fill(statusText[background][middle | right], 0, cursor, "Delete", true, false, true, false);
    120130       
     131               
    121132        fill(statusText[item][left], "Follow link");
    122133        fill(statusText[item][left], control, action, "Run action", true, false, false, false);
    123134        fill(statusText[item][left], drag, null); // no action for dragging
     135       
    124136        fill(statusText[item][middle], "Pickup");
     137        fill(statusText[item][middle], shift, "Create arrow");
     138        fill(statusText[item][middle], 0, cursor, "Place item(s)", true, false, true, false);
    125139        fill(statusText[item][middle], drag, null); // no action for dragging
     140       
    126141        fill(statusText[item][right], "Copy");
    127         fill(statusText[item][right], drag, null); // no action for dragging
     142        fill(statusText[item][right], shift, "Create rectangle");
     143        fill(statusText[item][right], 0, cursor, "Stamp item(s)", true, false, true, false);
     144        fill(statusText[item][right], drag, null); // no action for dragging unless currentItem is a line
     145        fill(statusText[item][right], drag, line, "Extrude shape");
     146       
    128147        fill(statusText[item][left | middle], null); // no action for left + middle
     148       
    129149                fill(statusText[item][left | right], "Extract attributes");
     150                fill(statusText[item][left | right], 0, cursor, null, true, false, true, false);
     151               
    130152                fill(statusText[item][middle | right], "Delete");
    131153        }
     
    141163        public static void updateStatus() {
    142164                Item current = FrameUtils.getCurrentItem();
    143                 int context = current != null ? item : 0;
     165                int context = current != null || FrameUtils.getCurrentItems() != null ? item : background;
    144166                int mod = (FrameMouseActions.isControlDown() ? control : 0) | (FrameMouseActions.isShiftDown() ? shift : 0);
    145                 int other = (ExperimentalFeatures.MousePan.get() ? panning : 0) | (current != null ? current.hasAction() ? action : 0 : 0);
     167                int other = (ExperimentalFeatures.MousePan.get() ? panning : 0) | (current != null && current.hasAction() ? action : 0) | (current instanceof Line ? line : 0) | (FreeItems.itemsAttachedToCursor() ? cursor : 0);
    146168                String status = "";
    147169               
     
    164186                if(dl != null || dm != null || dr != null) status += "\n";
    165187                if(dl != null) status += command(mod | drag, left) + dl + padding.substring(dl.length());
    166                 if(dm != null) status += command(mod | drag, left) + dm + padding.substring(dm.length());
    167                 if(dr != null) status += command(mod | drag, left) + dr + padding.substring(dr.length());
     188                if(dm != null) status += command(mod | drag, middle) + dm + padding.substring(dm.length());
     189                if(dr != null) status += command(mod | drag, right) + dr + padding.substring(dr.length());
    168190               
    169191                MessageBay.setStatus(status);
Note: See TracChangeset for help on using the changeset viewer.