本文整理匯總了Java中javafx.scene.input.MouseEvent.isAltDown方法的典型用法代碼示例。如果您正苦於以下問題:Java MouseEvent.isAltDown方法的具體用法?Java MouseEvent.isAltDown怎麽用?Java MouseEvent.isAltDown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.input.MouseEvent
的用法示例。
在下文中一共展示了MouseEvent.isAltDown方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildModifiersText
import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
private String buildModifiersText(MouseEvent e) {
StringBuilder sb = new StringBuilder();
if (e.isAltDown()) {
sb.append("Alt+");
}
if (e.isControlDown()) {
sb.append("Ctrl+");
}
if (e.isMetaDown()) {
sb.append("Meta+");
}
if (e.isShiftDown()) {
sb.append("Shift+");
}
if (sb.length() > 0) {
sb.setLength(sb.length() - 1);
}
String mtext = sb.toString();
return mtext;
}
示例2: mouseEventGetModifiersExText
import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
public static String mouseEventGetModifiersExText(MouseEvent event) {
StringBuffer sb = new StringBuffer();
if (event.isControlDown()) {
sb.append("Ctrl+");
}
if (event.isMetaDown()) {
sb.append("Meta+");
}
if (event.isAltDown()) {
sb.append("Alt+");
}
if (event.isShiftDown()) {
sb.append("Shift+");
}
if (event.isPrimaryButtonDown()) {
sb.append("Button1+");
}
if (event.isMiddleButtonDown()) {
sb.append("Button2+");
}
if (event.isSecondaryButtonDown()) {
sb.append("Button3+");
}
String text = sb.toString();
if (text.equals("")) {
return text;
}
return text.substring(0, text.length() - 1);
}
示例3: getModifiersExText
import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
protected static String getModifiersExText(MouseEvent event) {
StringBuffer buf = new StringBuffer();
if (event.isMetaDown()) {
buf.append("Meta");
buf.append("+");
}
if (event.isControlDown()) {
buf.append("Ctrl");
buf.append("+");
}
if (event.isAltDown()) {
buf.append("Alt");
buf.append("+");
}
if (event.isShiftDown()) {
buf.append("Shift");
buf.append("+");
}
if (event.getButton() == MouseButton.PRIMARY) {
buf.append("Button1");
buf.append("+");
}
if (event.getButton() == MouseButton.MIDDLE) {
buf.append("Button2");
buf.append("+");
}
if (event.getButton() == MouseButton.SECONDARY) {
buf.append("Button3");
buf.append("+");
}
return buf.toString();
}
示例4: mouseEventGetModifiersExText
import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
public static String mouseEventGetModifiersExText(MouseEvent event) {
StringBuffer sb = new StringBuffer();
if (event.isControlDown()) {
sb.append("Ctrl+");
}
if (event.isMetaDown()) {
sb.append("Meta+");
}
if (event.isAltDown()) {
sb.append("Alt+");
}
if (event.isShiftDown()) {
sb.append("Shift+");
}
if (event.isPrimaryButtonDown()) {
sb.append("Button1+");
}
if (event.isMiddleButtonDown()) {
sb.append("Button2+");
}
if (event.isSecondaryButtonDown()) {
sb.append("Button3+");
}
String text = sb.toString();
if (text.equals("")) {
return text;
}
return text.substring(0, text.length() - 1);
}
示例5: mousePressed
import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
protected void mousePressed(MouseEvent me) {
if (me.isPrimaryButtonDown() && me.getClickCount() == 1 && !me.isAltDown() && !me.isMetaDown() && !me.isControlDown()) {
mouseButton1Pressed(me);
} else {
recorder.recordClick2(this, me, true);
}
}
示例6: hasMatchingModifiers
import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
/**
* Returns {@code true} if the specified mouse event has modifier
* keys that match this handler.
*
* @param e the mouse event ({@code null} not permitted).
*
* @return A boolean.
*/
@Override
public boolean hasMatchingModifiers(MouseEvent e) {
boolean b = true;
b = b && (this.altKey == e.isAltDown());
b = b && (this.ctrlKey == e.isControlDown());
b = b && (this.metaKey == e.isMetaDown());
b = b && (this.shiftKey == e.isShiftDown());
return b;
}
示例7: mouseClicked
import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
@Override protected void mouseClicked(MouseEvent me) {
if (me.isControlDown() || me.isAltDown() || me.isMetaDown() || onCheckBox((Node) me.getTarget()))
return;
recorder.recordClick2(this, me, true);
}