/** * Creates an instance of <code>KeySequence</code> given a single key * stroke. * * @param keyStroke * a single key stroke. Must not be <code>null</code>. * @return a key sequence. Guaranteed not to be <code>null</code>. */ public static final KeySequence getInstance(final KeyStroke keyStroke) { return new KeySequence(new KeyStroke[] { keyStroke }); }
/** * Creates an instance of <code>KeySequence</code> given a single key * stroke. * * @param keyStroke * a single key stroke. Must not be <code>null</code>. * @return a key sequence. Guaranteed not to be <code>null</code>. */ public static final KeySequence getInstance(final KeyStroke keyStroke) { return new KeySequence(new KeyStroke[] { keyStroke }); }
/** * Creates an instance of <code>KeySequence</code> given a single key * stroke. * * @param keyStroke * a single key stroke. Must not be <code>null</code>. * @return a key sequence. Guaranteed not to be <code>null</code>. */ public static final KeySequence getInstance(final KeyStroke keyStroke) { return new KeySequence(new KeyStroke[] { keyStroke }); }
/** * Creates an instance of <code>KeySequence</code> given an array of key * strokes. * * @param keyStrokes * the array of key strokes. This array may be empty, but it must * not be <code>null</code>. This array must not contain * <code>null</code> elements. * @return a key sequence. Guaranteed not to be <code>null</code>. */ public static final KeySequence getInstance(final KeyStroke[] keyStrokes) { return new KeySequence(keyStrokes); }
/** * Creates an instance of <code>KeySequence</code> given an array of key * strokes. * * @param keyStrokes * the array of key strokes. This array may be empty, but it must * not be <code>null</code>. This array must not contain * <code>null</code> elements. * @return a key sequence. Guaranteed not to be <code>null</code>. */ public static final KeySequence getInstance(final KeyStroke[] keyStrokes) { return new KeySequence(keyStrokes); }
/** * Creates an instance of <code>KeySequence</code> given an array of key * strokes. * * @param keyStrokes * the array of key strokes. This array may be empty, but it must * not be <code>null</code>. This array must not contain * <code>null</code> elements. * @return a key sequence. Guaranteed not to be <code>null</code>. */ public static final KeySequence getInstance(final KeyStroke[] keyStrokes) { return new KeySequence(keyStrokes); }
/** * Creates an instance of <code>KeySequence</code> given a list of key * strokes. * * @param keyStrokes * the list of key strokes. This list may be empty, but it must * not be <code>null</code>. If this list is not empty, it * must only contain instances of <code>KeyStroke</code>. * @return a key sequence. Guaranteed not to be <code>null</code>. */ public static final KeySequence getInstance(final List<KeyStroke> keyStrokes) { return new KeySequence(keyStrokes.toArray(new KeyStroke[keyStrokes.size()])); }
/** * Creates an instance of <code>KeySequence</code> given a list of key * strokes. * * @param keyStrokes * the list of key strokes. This list may be empty, but it must * not be <code>null</code>. If this list is not empty, it * must only contain instances of <code>KeyStroke</code>. * @return a key sequence. Guaranteed not to be <code>null</code>. */ public static final KeySequence getInstance(final List keyStrokes) { return new KeySequence((KeyStroke[]) keyStrokes .toArray(new KeyStroke[keyStrokes.size()])); }
/** * Creates an instance of <code>KeySequence</code> given a list of key * strokes. * * @param keyStrokes * the list of key strokes. This list may be empty, but it must * not be <code>null</code>. If this list is not empty, it * must only contain instances of <code>KeyStroke</code>. * @return a key sequence. Guaranteed not to be <code>null</code>. */ public static final KeySequence getInstance(final List keyStrokes) { return new KeySequence((KeyStroke[]) keyStrokes .toArray(new KeyStroke[keyStrokes.size()])); }
/** * Creates an instance of <code>KeySequence</code> given a key sequence * and a key stroke. * * @param keySequence * a key sequence. Must not be <code>null</code>. * @param keyStroke * a key stroke. Must not be <code>null</code>. * @return a key sequence that is equal to the given key sequence with the * given key stroke appended to the end. Guaranteed not to be * <code>null</code>. */ public static final KeySequence getInstance(final KeySequence keySequence, final KeyStroke keyStroke) { if (keySequence == null || keyStroke == null) { throw new NullPointerException(); } final KeyStroke[] oldKeyStrokes = keySequence.getKeyStrokes(); final int oldKeyStrokeLength = oldKeyStrokes.length; final KeyStroke[] newKeyStrokes = new KeyStroke[oldKeyStrokeLength + 1]; System .arraycopy(oldKeyStrokes, 0, newKeyStrokes, 0, oldKeyStrokeLength); newKeyStrokes[oldKeyStrokeLength] = keyStroke; return new KeySequence(newKeyStrokes); }
/** * Creates an instance of <code>KeySequence</code> given a key sequence * and a key stroke. * * @param keySequence * a key sequence. Must not be <code>null</code>. * @param keyStroke * a key stroke. Must not be <code>null</code>. * @return a key sequence that is equal to the given key sequence with the * given key stroke appended to the end. Guaranteed not to be * <code>null</code>. */ public static final KeySequence getInstance(final KeySequence keySequence, final KeyStroke keyStroke) { if (keySequence == null || keyStroke == null) { throw new NullPointerException(); } final KeyStroke[] oldKeyStrokes = keySequence.getKeyStrokes(); final int oldKeyStrokeLength = oldKeyStrokes.length; final KeyStroke[] newKeyStrokes = new KeyStroke[oldKeyStrokeLength + 1]; System .arraycopy(oldKeyStrokes, 0, newKeyStrokes, 0, oldKeyStrokeLength); newKeyStrokes[oldKeyStrokeLength] = keyStroke; return new KeySequence(newKeyStrokes); }
/** * Creates an instance of <code>KeySequence</code> given a key sequence * and a key stroke. * * @param keySequence * a key sequence. Must not be <code>null</code>. * @param keyStroke * a key stroke. Must not be <code>null</code>. * @return a key sequence that is equal to the given key sequence with the * given key stroke appended to the end. Guaranteed not to be * <code>null</code>. */ public static final KeySequence getInstance(final KeySequence keySequence, final KeyStroke keyStroke) { if (keySequence == null || keyStroke == null) { throw new NullPointerException(); } final KeyStroke[] oldKeyStrokes = keySequence.getKeyStrokes(); final int oldKeyStrokeLength = oldKeyStrokes.length; final KeyStroke[] newKeyStrokes = new KeyStroke[oldKeyStrokeLength + 1]; System .arraycopy(oldKeyStrokes, 0, newKeyStrokes, 0, oldKeyStrokeLength); newKeyStrokes[oldKeyStrokeLength] = keyStroke; return new KeySequence(newKeyStrokes); }
return new KeySequence(keyStrokeArray); } catch (final IllegalArgumentException e) { throw new ParseException(
return new KeySequence(keyStrokeArray); } catch (final IllegalArgumentException e) { throw new ParseException(
return new KeySequence(keyStrokeArray); } catch (final IllegalArgumentException e) { throw new ParseException(