Ignore:
Timestamp:
18.06.2011 15:26:52 (11 months ago)
Author:
stoecker
Message:

fix #6474 - fix toolbar action entries for some actions and fix fullscreen mode start

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/MoveAction.java

    r3327 r4139  
    3232 
    3333    // any better idea? 
    34     private static Object calltosupermustbefirststatementinconstructor(Direction dir, boolean text) { 
    35         Shortcut sc; 
     34    private static String calltosupermustbefirststatementinconstructor_text(Direction dir) { 
    3635        String directiontext; 
    3736        if        (dir == Direction.UP)   { 
    3837            directiontext = tr("up"); 
    39             sc = Shortcut.registerShortcut("core:moveup",    tr("Move objects {0}", directiontext), KeyEvent.VK_UP,    Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 
    4038        } else if (dir == Direction.DOWN)  { 
    4139            directiontext = tr("down"); 
    42             sc = Shortcut.registerShortcut("core:movedown",  tr("Move objects {0}", directiontext), KeyEvent.VK_DOWN,  Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 
    4340        } else if (dir == Direction.LEFT)  { 
    4441            directiontext = tr("left"); 
    45             sc = Shortcut.registerShortcut("core:moveleft",  tr("Move objects {0}", directiontext), KeyEvent.VK_LEFT,  Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 
    4642        } else { //dir == Direction.RIGHT) { 
    4743            directiontext = tr("right"); 
    48             sc = Shortcut.registerShortcut("core:moveright", tr("Move objects {0}", directiontext), KeyEvent.VK_RIGHT, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 
    4944        } 
    50         if (text) 
    51             return directiontext; 
    52         else 
    53             return sc; 
     45        return directiontext; 
     46    } 
     47 
     48    // any better idea? 
     49    private static Shortcut calltosupermustbefirststatementinconstructor(Direction dir) { 
     50        Shortcut sc; 
     51        if        (dir == Direction.UP)   { 
     52            sc = Shortcut.registerShortcut("core:moveup",    tr("Move objects {0}", tr("up")), KeyEvent.VK_UP,    Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 
     53        } else if (dir == Direction.DOWN)  { 
     54            sc = Shortcut.registerShortcut("core:movedown",  tr("Move objects {0}", tr("down")), KeyEvent.VK_DOWN,  Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 
     55        } else if (dir == Direction.LEFT)  { 
     56            sc = Shortcut.registerShortcut("core:moveleft",  tr("Move objects {0}", tr("left")), KeyEvent.VK_LEFT,  Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 
     57        } else { //dir == Direction.RIGHT) { 
     58            sc = Shortcut.registerShortcut("core:moveright", tr("Move objects {0}", tr("right")), KeyEvent.VK_RIGHT, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT); 
     59        } 
     60        return sc; 
    5461    } 
    5562 
    5663    public MoveAction(Direction dir) { 
    57         super(tr("Move {0}", calltosupermustbefirststatementinconstructor(dir, true)), null, 
    58                 tr("Moves Objects {0}", calltosupermustbefirststatementinconstructor(dir, true)), 
    59                 (Shortcut)calltosupermustbefirststatementinconstructor(dir, false), true); 
     64        super(tr("Move {0}", calltosupermustbefirststatementinconstructor_text(dir)), null, 
     65                tr("Moves Objects {0}", calltosupermustbefirststatementinconstructor_text(dir)), 
     66                calltosupermustbefirststatementinconstructor(dir), false); 
    6067        myDirection = dir; 
    6168        putValue("help", ht("/Action/Move")); 
     69        if        (dir == Direction.UP)   { 
     70            putValue("toolbar", "action/move/up"); 
     71        } else if (dir == Direction.DOWN)  { 
     72            putValue("toolbar", "action/move/down"); 
     73        } else if (dir == Direction.LEFT)  { 
     74            putValue("toolbar", "action/move/left"); 
     75        } else { //dir == Direction.RIGHT) { 
     76            putValue("toolbar", "action/move/right"); 
     77        } 
     78        Main.toolbar.register(this); 
    6279    } 
    6380 
Note: See TracChangeset for help on using the changeset viewer.