Java Code Examples for java.awt.event.InputEvent.SHIFT_DOWN_MASK

The following are Jave code examples for showing how to use SHIFT_DOWN_MASK of the java.awt.event.InputEvent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: incubator-netbeans   File: WizardUtils.java   View Source Code Vote up 6 votes
public static String keyStrokeToString(KeyStroke keyStroke) {
    int modifiers = keyStroke.getModifiers();
    StringBuffer sb = new StringBuffer();
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) > 0) {
        sb.append("Ctrl+"); // NOI18N
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) > 0) {
        sb.append("Alt+"); // NOI18N
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) > 0) {
        sb.append("Shift+"); // NOI18N
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) > 0) {
        sb.append("Meta+"); // NOI18N
    }
    if (keyStroke.getKeyCode() != KeyEvent.VK_SHIFT &&
            keyStroke.getKeyCode() != KeyEvent.VK_CONTROL &&
            keyStroke.getKeyCode() != KeyEvent.VK_META &&
            keyStroke.getKeyCode() != KeyEvent.VK_ALT &&
            keyStroke.getKeyCode() != KeyEvent.VK_ALT_GRAPH) {
        sb.append(Utilities.keyToString(
                KeyStroke.getKeyStroke(keyStroke.getKeyCode(), 0)));
    }
    return sb.toString();
}
 
Example 2
Project: OpenJSharp   File: DragSourceDragEvent.java   View Source Code Vote up 6 votes
/**
 * Sets old modifiers by the new ones.
 */
private void setOldModifiers() {
    if ((gestureModifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON1_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON2_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON2_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON3_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON3_MASK;
    }
    if ((gestureModifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.SHIFT_MASK;
    }
    if ((gestureModifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.CTRL_MASK;
    }
    if ((gestureModifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.ALT_GRAPH_MASK;
    }
}
 
Example 3
Project: openjdk-jdk10   File: XEmbedHelper.java   View Source Code Vote up 6 votes
/**
     * Converts XEMBED modifiers mask into AWT InputEvent mask
     */
    int getModifiers(int state) {
        int mods = 0;
        if ((state & XEMBED_MODIFIER_SHIFT) != 0) {
            mods |= InputEvent.SHIFT_DOWN_MASK;
        }
        if ((state & XEMBED_MODIFIER_CONTROL) != 0) {
            mods |= InputEvent.CTRL_DOWN_MASK;
        }
        if ((state & XEMBED_MODIFIER_ALT) != 0) {
            mods |= InputEvent.ALT_DOWN_MASK;
        }
        // FIXME: What is super/hyper?
        // FIXME: Experiments show that SUPER is ALT. So what is Alt then?
        if ((state & XEMBED_MODIFIER_SUPER) != 0) {
            mods |= InputEvent.ALT_DOWN_MASK;
        }
//         if ((state & XEMBED_MODIFIER_HYPER) != 0) {
//             mods |= InputEvent.DOWN_MASK;
//         }
        return mods;
    }
 
Example 4
Project: Logisim   File: InputEventUtil.java   View Source Code Vote up 6 votes
public static int fromDisplayString(String str) {
	int ret = 0;
	StringTokenizer toks = new StringTokenizer(str);
	while (toks.hasMoreTokens()) {
		String s = toks.nextToken();
		if (s.equals(Strings.get("ctrlMod")))
			ret |= InputEvent.CTRL_DOWN_MASK;
		else if (s.equals(Strings.get("altMod")))
			ret |= InputEvent.ALT_DOWN_MASK;
		else if (s.equals(Strings.get("shiftMod")))
			ret |= InputEvent.SHIFT_DOWN_MASK;
		else if (s.equals(Strings.get("button1Mod")))
			ret |= InputEvent.BUTTON1_DOWN_MASK;
		else if (s.equals(Strings.get("button2Mod")))
			ret |= InputEvent.BUTTON2_DOWN_MASK;
		else if (s.equals(Strings.get("button3Mod")))
			ret |= InputEvent.BUTTON3_DOWN_MASK;
		else
			throw new NumberFormatException("InputEventUtil");
	}
	return ret;
}
 
Example 5
Project: marathonv5   File: KeyStrokeParser.java   View Source Code Vote up 6 votes
public static String getKeyModifierText(int modifiers) {
    if (modifiers == 0) {
        return "";
    }
    StringBuffer sb = new StringBuffer();
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        sb.append("Ctrl+");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        sb.append("Alt+");
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        sb.append("Shift+");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        sb.append("Meta+");
    }
    return sb.toString();
}
 
Example 6
Project: marathonv5   File: EventQueueDevice.java   View Source Code Vote up 6 votes
public int getModifierEx() {
    int modifiersEx = 0;
    if (isShiftPressed()) {
        modifiersEx |= InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK;
    }
    if (isCtrlPressed()) {
        modifiersEx |= InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK;
    }
    if (isAltPressed()) {
        modifiersEx |= InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK;
    }
    if (isMetaPressed()) {
        modifiersEx |= InputEvent.META_DOWN_MASK | InputEvent.META_MASK;
    }
    return modifiersEx;
}
 
Example 7
Project: OpenJSharp   File: DragSourceDragEvent.java   View Source Code Vote up 6 votes
/**
 * Sets new modifiers by the old ones.
 * The mouse modifiers have higher priority than overlaying key
 * modifiers.
 */
private void setNewModifiers() {
    if ((gestureModifiers & InputEvent.BUTTON1_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON1_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON2_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON2_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON3_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON3_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.SHIFT_MASK) != 0) {
        gestureModifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.CTRL_MASK) != 0) {
        gestureModifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        gestureModifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
}
 
Example 8
Project: jdk8u-jdk   File: DragSourceDragEvent.java   View Source Code Vote up 6 votes
/**
 * Sets new modifiers by the old ones.
 * The mouse modifiers have higher priority than overlaying key
 * modifiers.
 */
private void setNewModifiers() {
    if ((gestureModifiers & InputEvent.BUTTON1_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON1_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON2_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON2_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON3_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON3_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.SHIFT_MASK) != 0) {
        gestureModifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.CTRL_MASK) != 0) {
        gestureModifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        gestureModifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
}
 
Example 9
Project: incubator-netbeans   File: KeyStrokeUtils.java   View Source Code Vote up 5 votes
/**
 * Convert human-readable keystroke name to {@link KeyStroke} object.
 */
public static @CheckForNull KeyStroke getKeyStroke(
        @NonNull String keyStroke) {

    int modifiers = 0;
    while (true) {
        if (keyStroke.startsWith(EMACS_CTRL)) {
            modifiers |= InputEvent.CTRL_DOWN_MASK;
            keyStroke = keyStroke.substring(EMACS_CTRL.length());
        } else if (keyStroke.startsWith(EMACS_ALT)) {
            modifiers |= InputEvent.ALT_DOWN_MASK;
            keyStroke = keyStroke.substring(EMACS_ALT.length());
        } else if (keyStroke.startsWith(EMACS_SHIFT)) {
            modifiers |= InputEvent.SHIFT_DOWN_MASK;
            keyStroke = keyStroke.substring(EMACS_SHIFT.length());
        } else if (keyStroke.startsWith(EMACS_META)) {
            modifiers |= InputEvent.META_DOWN_MASK;
            keyStroke = keyStroke.substring(EMACS_META.length());
        } else if (keyStroke.startsWith(STRING_ALT)) {
            modifiers |= InputEvent.ALT_DOWN_MASK;
            keyStroke = keyStroke.substring(STRING_ALT.length());
        } else if (keyStroke.startsWith(STRING_META)) {
            modifiers |= InputEvent.META_DOWN_MASK;
            keyStroke = keyStroke.substring(STRING_META.length());
        } else {
            break;
        }
    }
    KeyStroke ks = Utilities.stringToKey (keyStroke);
    if (ks == null) { // Return null to indicate an invalid keystroke
        return null;
    } else {
        KeyStroke result = KeyStroke.getKeyStroke (ks.getKeyCode (), modifiers);
        return result;
    }
}
 
Example 10
Project: incubator-netbeans   File: KeyStrokeUtils.java   View Source Code Vote up 5 votes
/**
 * Get human-readable name for a {@link KeyStroke}.
 */
public static String getKeyStrokeAsText(@NonNull KeyStroke keyStroke) {
    int modifiers = keyStroke.getModifiers ();
    StringBuilder sb = new StringBuilder ();
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) > 0) {
        sb.append(EMACS_CTRL);
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) > 0) {
        sb.append(STRING_ALT);
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) > 0) {
        sb.append (EMACS_SHIFT);
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) > 0) {
        sb.append(STRING_META);
    }
    if (keyStroke.getKeyCode () != KeyEvent.VK_SHIFT &&
        keyStroke.getKeyCode () != KeyEvent.VK_CONTROL &&
        keyStroke.getKeyCode () != KeyEvent.VK_META &&
        keyStroke.getKeyCode () != KeyEvent.VK_ALT &&
        keyStroke.getKeyCode () != KeyEvent.VK_ALT_GRAPH) {
        sb.append (Utilities.keyToString (
            KeyStroke.getKeyStroke (keyStroke.getKeyCode (), 0)
        ));
    }
    return sb.toString ();
}
 
Example 11
Project: geomapapp   File: LassoSelectionHandler.java   View Source Code Vote up 5 votes
private boolean testLassoConditions(MouseEvent e) {
	int onmask = InputEvent.BUTTON1_DOWN_MASK;
	int offmask = InputEvent.CTRL_DOWN_MASK
					| InputEvent.SHIFT_DOWN_MASK;
	return (e.getModifiersEx() & (onmask | offmask)) == onmask
			&& (enabled  || isLDown);
}
 
Example 12
Project: openjdk-jdk10   File: AWTKeyStroke.java   View Source Code Vote up 5 votes
static String getModifiersText(int modifiers) {
    StringBuilder buf = new StringBuilder();

    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0 ) {
        buf.append("shift ");
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0 ) {
        buf.append("ctrl ");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0 ) {
        buf.append("meta ");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0 ) {
        buf.append("alt ");
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0 ) {
        buf.append("altGraph ");
    }
    if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0 ) {
        buf.append("button1 ");
    }
    if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0 ) {
        buf.append("button2 ");
    }
    if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0 ) {
        buf.append("button3 ");
    }

    return buf.toString();
}
 
Example 13
Project: marathonv5   File: DeviceTest.java   View Source Code Vote up 5 votes
protected String getModifiersExText(int modifiers) {

        StringBuffer buf = new StringBuffer();
        if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
            buf.append("Meta");
            buf.append("+");
        }
        if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
            buf.append("Ctrl");
            buf.append("+");
        }
        if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
            buf.append("Alt");
            buf.append("+");
        }
        if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
            buf.append("Shift");
            buf.append("+");
        }
        if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
            buf.append("Alt Graph");
            buf.append("+");
        }
        if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
            buf.append("Button1");
            buf.append("+");
        }
        if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0) {
            buf.append("Button2");
            buf.append("+");
        }
        if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0) {
            buf.append("Button3");
            buf.append("+");
        }
        return buf.toString();
    }
 
Example 14
Project: marathonv5   File: JavaRecorderHook.java   View Source Code Vote up 5 votes
public static String inputEventGetModifiersExText(int modifiers) {
    StringBuffer sb = new StringBuffer();

    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        sb.append("Ctrl+");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        sb.append("Meta+");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        sb.append("Alt+");
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        sb.append("Shift+");
    }
    if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
        sb.append("Button1+");
    }
    if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0) {
        sb.append("Button2+");
    }
    if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0) {
        sb.append("Button3+");
    }
    String text = sb.toString();
    if (text.equals("")) {
        return text;
    }
    return text.substring(0, text.length() - 1);
}
 
Example 15
Project: jdk8u-jdk   File: AWTKeyStroke.java   View Source Code Vote up 5 votes
private static int mapOldModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_MASK) != 0) {
        modifiers |= InputEvent.ALT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
    if ((modifiers & InputEvent.CTRL_MASK) != 0) {
        modifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((modifiers & InputEvent.META_MASK) != 0) {
        modifiers |= InputEvent.META_DOWN_MASK;
    }

    modifiers &= InputEvent.SHIFT_DOWN_MASK
        | InputEvent.ALT_DOWN_MASK
        | InputEvent.ALT_GRAPH_DOWN_MASK
        | InputEvent.CTRL_DOWN_MASK
        | InputEvent.META_DOWN_MASK
        | InputEvent.BUTTON1_DOWN_MASK
        | InputEvent.BUTTON2_DOWN_MASK
        | InputEvent.BUTTON3_DOWN_MASK;

    return modifiers;
}
 
Example 16
Project: Logisim   File: SelectTool.java   View Source Code Vote up 5 votes
private boolean shouldConnect(Canvas canvas, int modsEx) {
	boolean shiftReleased = (modsEx & InputEvent.SHIFT_DOWN_MASK) == 0;
	boolean dflt = AppPreferences.MOVE_KEEP_CONNECT.getBoolean();
	if (shiftReleased) {
		return dflt;
	} else {
		return !dflt;
	}
}
 
Example 17
Project: OpenJSharp   File: AWTKeyStroke.java   View Source Code Vote up 5 votes
static String getModifiersText(int modifiers) {
    StringBuilder buf = new StringBuilder();

    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0 ) {
        buf.append("shift ");
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0 ) {
        buf.append("ctrl ");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0 ) {
        buf.append("meta ");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0 ) {
        buf.append("alt ");
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0 ) {
        buf.append("altGraph ");
    }
    if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0 ) {
        buf.append("button1 ");
    }
    if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0 ) {
        buf.append("button2 ");
    }
    if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0 ) {
        buf.append("button3 ");
    }

    return buf.toString();
}
 
Example 18
Project: jdk8u-jdk   File: AWTKeyStroke.java   View Source Code Vote up 5 votes
static String getModifiersText(int modifiers) {
    StringBuilder buf = new StringBuilder();

    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0 ) {
        buf.append("shift ");
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0 ) {
        buf.append("ctrl ");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0 ) {
        buf.append("meta ");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0 ) {
        buf.append("alt ");
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0 ) {
        buf.append("altGraph ");
    }
    if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0 ) {
        buf.append("button1 ");
    }
    if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0 ) {
        buf.append("button2 ");
    }
    if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0 ) {
        buf.append("button3 ");
    }

    return buf.toString();
}
 
Example 19
Project: Logisim   File: SelectTool.java   View Source Code Vote up 4 votes
@Override
public void mousePressed(Canvas canvas, MouseEvent e) {
	beforePressSelection = new ArrayList<CanvasObject>(canvas.getSelection().getSelected());
	beforePressHandle = canvas.getSelection().getSelectedHandle();
	int mx = e.getX();
	int my = e.getY();
	boolean shift = (e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) != 0;
	dragStart = Location.create(mx, my);
	dragEffective = false;
	dragEnd = dragStart;
	lastMouseX = mx;
	lastMouseY = my;
	Selection selection = canvas.getSelection();
	selection.setHandleSelected(null);

	// see whether user is pressing within an existing handle
	int halfSize = getHandleSize(canvas) / 2;
	CanvasObject clicked = null;
	for (CanvasObject shape : selection.getSelected()) {
		List<Handle> handles = shape.getHandles(null);
		for (Handle han : handles) {
			int dx = han.getX() - mx;
			int dy = han.getY() - my;
			if (dx >= -halfSize && dx <= halfSize && dy >= -halfSize && dy <= halfSize) {
				if (shape.canMoveHandle(han)) {
					curAction = MOVE_HANDLE;
					curGesture = new HandleGesture(han, 0, 0, e.getModifiersEx());
					repaintArea(canvas);
					return;
				} else if (clicked == null) {
					clicked = shape;
				}
			}
		}
	}

	// see whether the user is clicking within a shape
	if (clicked == null) {
		clicked = getObjectAt(canvas.getModel(), e.getX(), e.getY(), false);
	}
	if (clicked != null) {
		if (shift && selection.isSelected(clicked)) {
			selection.setSelected(clicked, false);
			curAction = IDLE;
		} else {
			if (!shift && !selection.isSelected(clicked)) {
				selection.clearSelected();
			}
			selection.setSelected(clicked, true);
			selection.setMovingShapes(selection.getSelected(), 0, 0);
			curAction = MOVE_ALL;
		}
		repaintArea(canvas);
		return;
	}

	clicked = getObjectAt(canvas.getModel(), e.getX(), e.getY(), true);
	if (clicked != null && selection.isSelected(clicked)) {
		if (shift) {
			selection.setSelected(clicked, false);
			curAction = IDLE;
		} else {
			selection.setMovingShapes(selection.getSelected(), 0, 0);
			curAction = MOVE_ALL;
		}
		repaintArea(canvas);
		return;
	}

	if (shift) {
		curAction = RECT_TOGGLE;
	} else {
		selection.clearSelected();
		curAction = RECT_SELECT;
	}
	repaintArea(canvas);
}
 
Example 20
Project: Logisim   File: TableTabCaret.java   View Source Code Vote up 4 votes
@Override
public void keyPressed(KeyEvent e) {
	if (cursorRow < 0)
		return;
	TruthTable model = table.getTruthTable();
	int rows = model.getRowCount();
	int inputs = model.getInputColumnCount();
	int outputs = model.getOutputColumnCount();
	int cols = inputs + outputs;
	boolean shift = (e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) != 0;
	switch (e.getKeyCode()) {
	case KeyEvent.VK_UP:
		setCursor(cursorRow - 1, cursorCol, shift);
		break;
	case KeyEvent.VK_LEFT:
		setCursor(cursorRow, cursorCol - 1, shift);
		break;
	case KeyEvent.VK_DOWN:
		setCursor(cursorRow + 1, cursorCol, shift);
		break;
	case KeyEvent.VK_RIGHT:
		setCursor(cursorRow, cursorCol + 1, shift);
		break;
	case KeyEvent.VK_HOME:
		if (cursorCol == 0)
			setCursor(0, 0, shift);
		else
			setCursor(cursorRow, 0, shift);
		break;
	case KeyEvent.VK_END:
		if (cursorCol == cols - 1)
			setCursor(rows - 1, cols - 1, shift);
		else
			setCursor(cursorRow, cols - 1, shift);
		break;
	case KeyEvent.VK_PAGE_DOWN:
		rows = table.getVisibleRect().height / table.getCellHeight();
		if (rows > 2)
			rows--;
		setCursor(cursorRow + rows, cursorCol, shift);
		break;
	case KeyEvent.VK_PAGE_UP:
		rows = table.getVisibleRect().height / table.getCellHeight();
		if (rows > 2)
			rows--;
		setCursor(cursorRow - rows, cursorCol, shift);
		break;
	}
}