| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file. |
|---|
| 2 | package org.openstreetmap.josm.tools; |
|---|
| 3 | |
|---|
| 4 | import java.util.List; |
|---|
| 5 | |
|---|
| 6 | import javax.swing.Action; |
|---|
| 7 | |
|---|
| 8 | public interface MultikeyShortcutAction extends Action { |
|---|
| 9 | |
|---|
| 10 | public static class MultikeyInfo { |
|---|
| 11 | private final int index; |
|---|
| 12 | private final String description; |
|---|
| 13 | |
|---|
| 14 | public MultikeyInfo(int index, String description) { |
|---|
| 15 | this.index = index; |
|---|
| 16 | this.description = description; |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | public int getIndex() { |
|---|
| 20 | return index; |
|---|
| 21 | } |
|---|
| 22 | |
|---|
| 23 | public char getShortcut() { |
|---|
| 24 | if (index < 9) |
|---|
| 25 | return (char)('1' + index); |
|---|
| 26 | else if (index == 9) |
|---|
| 27 | return '0'; |
|---|
| 28 | else |
|---|
| 29 | return (char)('A' + index - 10); |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | public String getDescription() { |
|---|
| 33 | return description; |
|---|
| 34 | } |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | public Shortcut getMultikeyShortcut(); |
|---|
| 38 | |
|---|
| 39 | void executeMultikeyAction(int index, boolean repeatLastAction); |
|---|
| 40 | List<MultikeyInfo> getMultikeyCombinations(); |
|---|
| 41 | MultikeyInfo getLastMultikeyAction(); |
|---|
| 42 | |
|---|
| 43 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.