當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyEvent.VK_PAGE_DOWN屬性代碼示例

本文整理匯總了Java中java.awt.event.KeyEvent.VK_PAGE_DOWN屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyEvent.VK_PAGE_DOWN屬性的具體用法?Java KeyEvent.VK_PAGE_DOWN怎麽用?Java KeyEvent.VK_PAGE_DOWN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.event.KeyEvent的用法示例。


在下文中一共展示了KeyEvent.VK_PAGE_DOWN屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getKeyEvent

public int getKeyEvent(String key) {
    switch (key.toUpperCase()) {
        case "TAB":
            return KeyEvent.VK_TAB;
        case "ENTER":
            return KeyEvent.VK_ENTER;
        case "SHIFT":
            return KeyEvent.VK_SHIFT;
        case "CTRL":
            return KeyEvent.VK_CONTROL;
        case "ALT":
            return KeyEvent.VK_ALT;
        case "START":
            return KeyEvent.VK_WINDOWS;
        case "DELETE":
            return KeyEvent.VK_DELETE;
        case "BACKSPACE":
            return KeyEvent.VK_BACK_SPACE;
        case "HOME":
            return KeyEvent.VK_HOME;
        case "PAGE_UP":
        case "PAGEUP":
            return KeyEvent.VK_PAGE_UP;
        case "PAGE_DOWN":
        case "PAGEDOWN":
            return KeyEvent.VK_PAGE_DOWN;
        case "UP":
            return KeyEvent.VK_UP;
        case "DOWN":
            return KeyEvent.VK_DOWN;
        case "LEFT":
            return KeyEvent.VK_LEFT;
        case "RIGHT":
            return KeyEvent.VK_RIGHT;
        default:
            return KeyEvent.VK_ESCAPE;
    }
}
 
開發者ID:CognizantQAHub,項目名稱:Cognizant-Intelligent-Test-Scripter,代碼行數:38,代碼來源:ImageCommand.java

示例2: getKeys

@Override
public NavigationKey[] getKeys(ComponentOperator oper) {
    boolean multiString
            = oper instanceof JTextAreaOperator
            || oper instanceof JEditorPaneOperator;
    NavigationKey[] result = new NavigationKey[multiString ? 8 : 4];
    result[0] = new UpKey(KeyEvent.VK_LEFT, 0);
    result[1] = new DownKey(KeyEvent.VK_RIGHT, 0);
    ((UpKey) result[0]).setDownKey((DownKey) result[1]);
    ((DownKey) result[1]).setUpKey((UpKey) result[0]);
    if (multiString) {
        result[2] = new UpKey(KeyEvent.VK_UP, 0);
        result[3] = new DownKey(KeyEvent.VK_DOWN, 0);
        ((UpKey) result[2]).setDownKey((DownKey) result[3]);
        ((DownKey) result[3]).setUpKey((UpKey) result[2]);
        result[4] = new UpKey(KeyEvent.VK_PAGE_UP, 0);
        result[5] = new DownKey(KeyEvent.VK_PAGE_DOWN, 0);
        ((UpKey) result[4]).setDownKey((DownKey) result[5]);
        ((DownKey) result[5]).setUpKey((UpKey) result[4]);
        result[6] = new HomeKey(KeyEvent.VK_HOME, InputEvent.CTRL_MASK);
        result[7] = new EndKey(KeyEvent.VK_END, InputEvent.CTRL_MASK, this, oper);
    } else {
        result[2] = new HomeKey(KeyEvent.VK_HOME, 0);
        result[3] = new EndKey(KeyEvent.VK_END, 0, this, oper);
    }
    return result;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:27,代碼來源:SwingTextKeyboardDriver.java

示例3: keyPressed

public void keyPressed(KeyEvent e) {
    switch (e.getKeyCode()) {
    case KeyEvent.VK_UP:
        arrowKeySelect(DIRECTION_UP);
        break;
    case KeyEvent.VK_DOWN:
        arrowKeySelect(DIRECTION_DOWN);
        break;
    case KeyEvent.VK_ENTER:
        doubleClickEventDispatch();
        break;
    case KeyEvent.VK_PAGE_DOWN:
        pageScrollViewport(DIRECTION_DOWN);
        break;
    case KeyEvent.VK_PAGE_UP:
        pageScrollViewport(DIRECTION_UP);
        break;
    case KeyEvent.VK_HOME:
        ((ScrollPane)callback.getPane()).setScrollPosition(((ScrollPane)callback.getPane()).getScrollPosition().x, 0);
        break;
    case KeyEvent.VK_END:
        ((ScrollPane)callback.getPane()).setScrollPosition(((ScrollPane)callback.getPane()).getScrollPosition().x,
                callback.getSize().height);
        break;
    default:
        ;
    }

    callback.repaint();
}
 
開發者ID:addertheblack,項目名稱:myster,代碼行數:30,代碼來源:MCListEventHandler.java

示例4: keyPressed

@Override
public void keyPressed(KeyEvent e) {
	if (this.pane == null) {
		if (e.getSource() instanceof ItemPanel) {
			this.pane = ((ItemPanel) e.getSource());
		} else if (e.getSource() instanceof Item) {
			this.pane = ((ItemPanel) ((JComponent) e.getSource()).getParent());
		}
	}

	if (e.getKeyCode() == KeyEvent.VK_DELETE) {
	} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
		if ((this.pane != null) && (this.pane.getFilePane().lastSelected != null)) {
			this.pane.getFilePane().filechooserUI.setCurrentDirectoryOfFileChooser(this.pane.getFilePane().lastSelected
					.getFile());
		}
	} else if (e.getKeyCode() == KeyEvent.VK_SPACE) {
		this.pane.useKeyMoves("SPACE", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
		this.pane.useKeyMoves("RIGHT", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
		this.pane.useKeyMoves("LEFT", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_UP) {
		this.pane.useKeyMoves("UP", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
		this.pane.useKeyMoves("DOWN", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_HOME) {
		this.pane.useKeyMoves("HOME", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_END) {
		this.pane.useKeyMoves("END", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
		// ignore enter here!
	} else if (e.getKeyCode() == KeyEvent.VK_PAGE_UP) {
		this.pane.useKeyMoves("PAGE_UP", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_PAGE_DOWN) {
		this.pane.useKeyMoves("PAGE_DOWN", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else {
		if (KeyEvent.getKeyText(e.getKeyCode()).toLowerCase().equals("a")
				&& (e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK)) {
			this.pane.getFilePane().selectAll();
		}
		if (e.getModifiersEx() == 0) {
			this.pane.forwardToNearestFor(String.valueOf(e.getKeyChar()).toLowerCase());
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:46,代碼來源:ItemPanelKeyboardListener.java

示例5: keyEventGetKeyText

public static String keyEventGetKeyText(int keycode) {
    if (keycode == KeyEvent.VK_TAB) {
        return "Tab";
    }
    if (keycode == KeyEvent.VK_CONTROL) {
        return "Ctrl";
    }
    if (keycode == KeyEvent.VK_ALT) {
        return "Alt";
    }
    if (keycode == KeyEvent.VK_SHIFT) {
        return "Shift";
    }
    if (keycode == KeyEvent.VK_META) {
        return "Meta";
    }
    if (keycode == KeyEvent.VK_SPACE) {
        return "Space";
    }
    if (keycode == KeyEvent.VK_BACK_SPACE) {
        return "Backspace";
    }
    if (keycode == KeyEvent.VK_HOME) {
        return "Home";
    }
    if (keycode == KeyEvent.VK_END) {
        return "End";
    }
    if (keycode == KeyEvent.VK_DELETE) {
        return "Delete";
    }
    if (keycode == KeyEvent.VK_PAGE_UP) {
        return "Pageup";
    }
    if (keycode == KeyEvent.VK_PAGE_DOWN) {
        return "Pagedown";
    }
    if (keycode == KeyEvent.VK_UP) {
        return "Up";
    }
    if (keycode == KeyEvent.VK_DOWN) {
        return "Down";
    }
    if (keycode == KeyEvent.VK_LEFT) {
        return "Left";
    }
    if (keycode == KeyEvent.VK_RIGHT) {
        return "Right";
    }
    if (keycode == KeyEvent.VK_ENTER) {
        return "Enter";
    }
    return KeyEvent.getKeyText(keycode);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:54,代碼來源:OSUtils.java

示例6: keyPressed

@Override
public void keyPressed(KeyEvent e) {
	int cols = hex.getMeasures().getColumnCount();
	int rows;
	boolean shift = (e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) != 0;
	switch (e.getKeyCode()) {
	case KeyEvent.VK_UP:
		if (cursor >= cols)
			setDot(cursor - cols, shift);
		break;
	case KeyEvent.VK_LEFT:
		if (cursor >= 1)
			setDot(cursor - 1, shift);
		break;
	case KeyEvent.VK_DOWN:
		if (cursor >= hex.getModel().getFirstOffset() && cursor <= hex.getModel().getLastOffset() - cols) {
			setDot(cursor + cols, shift);
		}
		break;
	case KeyEvent.VK_RIGHT:
		if (cursor >= hex.getModel().getFirstOffset() && cursor <= hex.getModel().getLastOffset() - 1) {
			setDot(cursor + 1, shift);
		}
		break;
	case KeyEvent.VK_HOME:
		if (cursor >= 0) {
			int dist = (int) (cursor % cols);
			if (dist == 0)
				setDot(0, shift);
			else
				setDot(cursor - dist, shift);
			break;
		}
	case KeyEvent.VK_END:
		if (cursor >= 0) {
			HexModel model = hex.getModel();
			long dest = (cursor / cols * cols) + cols - 1;
			if (model != null) {
				long end = model.getLastOffset();
				if (dest > end || dest == cursor)
					dest = end;
				setDot(dest, shift);
			} else {
				setDot(dest, shift);
			}
		}
		break;
	case KeyEvent.VK_PAGE_DOWN:
		rows = hex.getVisibleRect().height / hex.getMeasures().getCellHeight();
		if (rows > 2)
			rows--;
		if (cursor >= 0) {
			long max = hex.getModel().getLastOffset();
			if (cursor + rows * cols <= max) {
				setDot(cursor + rows * cols, shift);
			} else {
				long n = cursor;
				while (n + cols < max)
					n += cols;
				setDot(n, shift);
			}
		}
		break;
	case KeyEvent.VK_PAGE_UP:
		rows = hex.getVisibleRect().height / hex.getMeasures().getCellHeight();
		if (rows > 2)
			rows--;
		if (cursor >= rows * cols)
			setDot(cursor - rows * cols, shift);
		else if (cursor >= cols)
			setDot(cursor % cols, shift);
		break;
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:74,代碼來源:Caret.java

示例7: keyPressed

@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;
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:49,代碼來源:TableTabCaret.java


注:本文中的java.awt.event.KeyEvent.VK_PAGE_DOWN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。