source: josm/trunk/src/org/openstreetmap/josm/gui/dialogs/layer/MoveDownAction.java@ 10428

Last change on this file since 10428 was 10428, checked in by stoecker, 8 years ago

see #9995 - patch mainly by strump - improve HIDPI behaviour

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.dialogs.layer;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.event.ActionEvent;
7
8import javax.swing.AbstractAction;
9
10import org.openstreetmap.josm.gui.dialogs.LayerListDialog.LayerListModel;
11import org.openstreetmap.josm.tools.ImageProvider;
12
13/**
14 * The action to move down the currently selected entries in the list.
15 */
16public class MoveDownAction extends AbstractAction implements IEnabledStateUpdating {
17 private final LayerListModel model;
18
19 /**
20 * Constructs a new {@code MoveDownAction}.
21 * @param model layer list model
22 */
23 public MoveDownAction(LayerListModel model) {
24 this.model = model;
25 putValue(NAME, tr("Move down"));
26 new ImageProvider("dialogs", "down").getResource().attachImageIcon(this, true);
27 putValue(SHORT_DESCRIPTION, tr("Move the selected layer one row down."));
28 updateEnabledState();
29 }
30
31 @Override
32 public void updateEnabledState() {
33 setEnabled(model.canMoveDown());
34 }
35
36 @Override
37 public void actionPerformed(ActionEvent e) {
38 model.moveDown();
39 }
40}
Note: See TracBrowser for help on using the repository browser.