Changeset 712


Ignore:
Timestamp:
01/16/14 16:22:06 (10 years ago)
Author:
jts21
Message:

More changes to help text, now L/M/R/LM/MR are always aligned to the same X value, and fix a couple of help messages

File:
1 edited

Legend:

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

    r710 r712  
    4444        private static final String commandPadding = "      ";
    4545        private static final String padding = "                    ";
     46        private static final String emptyPadding = commandPadding + padding;
    4647       
    4748        private static final String command(int mod, int button) {
     
    7172                return "Draw line/arrow";
    7273                case line:
     74                        if(FreeItems.isDrawingPolyLine()) return "Spot-weld polyline";
    7375                        if((mod & shift) != 0) return "Extend shape";
    7476                case dot:
     
    9496                        return "Draw rectangle";
    9597                case line:
     98                        if(FreeItems.isDrawingPolyLine()) return "Spot-weld & continue";
    9699                        if((mod & shift) != 0) return "Add line";
     100                        break;
     101                case dot:
     102                        if((mod & shift) == 0)return "Extend line";
     103                        break;
     104                }
     105                if((other & cursor) != 0) return "Stamp copy";
     106                if((mod & shift) != 0) return "Draw rectangle";
     107                if(context == Context.polygon) return "Copy enclosed items";
     108                return "Copy item";
     109        }
     110       
     111        private static final String left_right(Context context, int mod, int other) {
     112                switch(context) {
     113                case widget: return null;
    97114                default:
    98                         if((other & cursor) != 0) return "Stamp copy";
    99                         if((mod & shift) != 0) return "Draw rectangle";
    100                         if(context == Context.polygon) return "Copy enclosed items";
    101                         return "Copy item";
    102                 }
    103         }
    104        
    105         private static final String left_right(Context context, int mod, int other) {
    106                 switch(context) {
    107                 case widget: return null;
    108                 default:
    109                         if((other & cursor) == 0 && (context != Context.polygon)) return "Extract attributes";
     115                        if((other & cursor) == 0) return "Extract attributes";
     116                        return null;
     117                case polygon:
    110118                case background:
    111119                        return "Auto format";
     
    219227                String dr = drag_right(context, mod, other);
    220228               
    221                 if(l != null || m != null || r != null || lr != null) status += " Click:";
    222                 if(l != null)  status += command(mod, left) + l + padding.substring(l.length());
    223                 if(m != null)  status += command(mod, middle) + m + padding.substring(m.length());
    224                 if(r != null)  status += command(mod, right) + r + padding.substring(r.length());
    225                 if(lr != null) status += command(mod, left | right) + lr + padding.substring(lr.length());
    226                 if(mr != null) status += command(mod, middle | right) + mr + padding.substring(mr.length());
    227                 if(dl != null || dm != null || dr != null) status += "\n Drag: ";
    228                 if(dl != null) status += command(mod, left) + dl + padding.substring(dl.length());
    229                 if(dm != null) status += command(mod, middle) + dm + padding.substring(dm.length());
    230                 if(dr != null) status += command(mod, right) + dr + padding.substring(dr.length());
    231                 if(iw != null) status += "\n Widget:  " + iw.getClass().getSimpleName();
     229                if(l != null || m != null || r != null || lr != null || mr != null) status += " Click:";
     230                status += (l != null ? command(mod, left) + l + padding.substring(l.length()) : emptyPadding);
     231                status += (m != null ? command(mod, middle) + m + padding.substring(m.length()) : emptyPadding);
     232                status += (r != null ? command(mod, right) + r + padding.substring(r.length()) : emptyPadding);
     233                status += (lr != null ? command(mod, left | right) + lr + padding.substring(lr.length()) : emptyPadding);
     234                status += (mr != null ? command(mod, middle | right) + mr + padding.substring(mr.length()) : emptyPadding);
     235                if(iw != null) {
     236                        status += "\n Widget:  " + iw.getClass().getSimpleName();
     237                } else {
     238                        if(dl != null || dm != null || dr != null) status += "\n Drag: ";
     239                status += (dl != null ? command(mod, left) + dl + padding.substring(dl.length()) : emptyPadding);
     240                status += (dm != null ? command(mod, middle) + dm + padding.substring(dm.length()) : emptyPadding);
     241                status += (dr != null ? command(mod, right) + dr + padding.substring(dr.length()) : emptyPadding);
     242                }
    232243               
    233244               
Note: See TracChangeset for help on using the changeset viewer.