public final class KeyCodeCombination extends KeyCombination
KeyCodeで指定されているキーの組合せを表します。 このようなキーの組合せは、ユーザーがキーの組合せの照合時に構成したキーボード機能レイアウトに依存しません。 KeyCombination.Modifier, KeyCombination.ModifierValueALT_ANY, ALT_DOWN, CONTROL_ANY, CONTROL_DOWN, META_ANY, META_DOWN, NO_MATCH, SHIFT_ANY, SHIFT_DOWN, SHORTCUT_ANY, SHORTCUT_DOWN| コンストラクタと説明 |
|---|
KeyCodeCombination(KeyCode code, KeyCombination.Modifier... modifiers)
指定された修飾子のリストとともに指定された主要なキーの
KeyCodeCombinationを構築します。 |
KeyCodeCombination(KeyCode code, KeyCombination.ModifierValue shift, KeyCombination.ModifierValue control, KeyCombination.ModifierValue alt, KeyCombination.ModifierValue meta, KeyCombination.ModifierValue shortcut)
すべての修飾子キーの明示的な指定とともに指定された主要なキーの
KeyCodeCombinationを構築します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
boolean |
equals(Object obj)
この
KeyCodeCombinationが指定されたオブジェクトと同じであるかどうかをテストします。 |
KeyCode |
getCode()
このキーの組合せに関連付けられているキー・コードを取得します。
|
String |
getDisplayText()
ユーザー・インタフェースでの表示(たとえば、メニュー・アイテムの横)に適したこの
KeyCombinationの文字列表現を返します。 |
String |
getName()
この
KeyCodeCombinationの文字列表現を返します。 |
int |
hashCode()
この
KeyCodeCombinationのハッシュ・コード値を返します。 |
boolean |
match(KeyEvent event)
このキーの組合せが指定された
KeyEventでのキーの組合せに一致するかどうかをテストします。 |
getAlt, getControl, getMeta, getShift, getShortcut, keyCombination, toString, valueOfpublic KeyCodeCombination(KeyCode code, KeyCombination.ModifierValue shift, KeyCombination.ModifierValue control, KeyCombination.ModifierValue alt, KeyCombination.ModifierValue meta, KeyCombination.ModifierValue shortcut)
KeyCodeCombinationを構築します。 各修飾子キーは、PRESSED、RELEASEDまたはIGNOREDに設定できます。 code - 主要なキーのキー・コードshift - shift修飾子キーの値control - ctrl修飾子キーの値alt - alt修飾子キーの値meta - meta修飾子キーの値shortcut - shortcut修飾子キーの値public KeyCodeCombination(KeyCode code, KeyCombination.Modifier... modifiers)
KeyCodeCombinationを構築します。 明示的にリストされていないすべての修飾子キーは、デフォルトのRELEASED値に設定されます。
デフォルトの修飾子値を変更できる可能性があるすべての修飾子は、KeyCombinationクラスに定数として定義されます。
code - 主要なキーのキー・コードmodifiers - 修飾子キーとその対応する値のリストpublic final KeyCode getCode()
public boolean match(KeyEvent event)
KeyEventでのキーの組合せに一致するかどうかをテストします。 テストでは、KeyEventからの修飾子キーのキー・コードおよび状態のみを使用します。 つまり、メソッドはKEY_PRESSEDイベントおよびKEY_RELEASEDイベントに対してのみtrueを返すことができ、有効なキー・コードを保持しないKEY_TYPEDイベントには返しません。 match、クラスKeyCombinationevent - キー・イベントtrue、それ以外の場合はfalsepublic String getName()
KeyCodeCombinationの文字列表現を返します。
文字列表現は、プラス文字で区切られたセクションで構成されています。 各セクションでは、修飾子キーまたは主要なキーを指定します。
修飾子キー・セクションには、修飾子キーのKeyCode名が含まれています。 接頭辞としてIgnoredキーワードを付けることができます。 接頭辞のない修飾子キーはそのPRESSED値を暗黙的に示し、接頭辞付きのバージョンはIGNORED値を暗黙的に示します。 修飾子キーが文字列に1つも指定されていない場合は、デフォルトのRELEASED値が設定されます。
主要なキー・セクションには、主要なキーのキー・コード名が含まれ、これが返される文字列の最後のセクションになります。
getName、クラスKeyCombinationKeyCodeCombinationの文字列表現public String getDisplayText()
KeyCombinationの文字列表現を返します。getDisplayText、クラスKeyCombinationKeyCombinationの文字列表現public boolean equals(Object obj)
KeyCodeCombinationが指定されたオブジェクトと同じであるかどうかをテストします。equals、クラスKeyCombinationobj - 比較対象のオブジェクトtrue、そうでない場合はfalsepublic int hashCode()
KeyCodeCombinationのハッシュ・コード値を返します。hashCode、クラスKeyCombinationCopyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.