当前位置: 首页>>代码示例>>Java>>正文


Java EventTarget类代码示例

本文整理汇总了Java中javafx.event.EventTarget的典型用法代码示例。如果您正苦于以下问题:Java EventTarget类的具体用法?Java EventTarget怎么用?Java EventTarget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EventTarget类属于javafx.event包,在下文中一共展示了EventTarget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isNotHotKey

import javafx.event.EventTarget; //导入依赖的package包/类
/**
 * @param event the event.
 * @return true if the event is not hotkey.
 */
@FXThread
public static boolean isNotHotKey(@Nullable final KeyEvent event) {
    if (event == null) return false;

    final String text = event.getText();
    if (text.isEmpty()) return false;

    final KeyCode code = event.getCode();
    final EventTarget target = event.getTarget();

    if (code == KeyCode.TAB && !(target instanceof TextInputControl)) {
        return false;
    }

    if (event.isControlDown()) {
        return false;
    } else if (event.isShiftDown()) {
        return false;
    }

    return true;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:27,代码来源:UIUtils.java

示例2: GoogleTrendChartEvent

import javafx.event.EventTarget; //导入依赖的package包/类
/**
 * @param source
 * @param target
 * @param eventType
 * @param x
 * @param y
 * @param screenX
 * @param screenY
 * @param pickResult
 * @param clickCount
 * @param contents
 */
public GoogleTrendChartEvent(Object source, EventTarget target, EventType<? extends GoogleTrendChartEvent> eventType, double x,
		double y, double screenX, double screenY, PickResult pickResult, int clickCount, List<Node> contents) {
	super(source, target, eventType);
	this.x = x;
	this.y = y;
	this.screenX = screenX;
	this.screenY = screenY;
	this.sceneX = x;
	this.sceneY = y;
	this.pickResult = pickResult != null ? pickResult : new PickResult(target, x, y);
	final Point3D p = InputEventUtils.recomputeCoordinates(this.pickResult, null);
	this.x = p.getX();
	this.y = p.getY();
	this.z = p.getZ();
	this.clickCount = clickCount;
	this.contents = contents;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:30,代码来源:GoogleTrendChartEvent.java

示例3: DockEvent

import javafx.event.EventTarget; //导入依赖的package包/类
/**
 * Constructs new DockEvent event..
 * 
 * @param source the source of the event. Can be null.
 * @param target the target of the event. Can be null.
 * @param eventType The type of the event.
 * @param x The x with respect to the source. Should be in scene coordinates if source == null or
 *        source is not a Node.
 * @param y The y with respect to the source. Should be in scene coordinates if source == null or
 *        source is not a Node.
 * @param screenX The x coordinate relative to screen.
 * @param screenY The y coordinate relative to screen.
 * @param pickResult pick result. Can be null, in this case a 2D pick result without any further
 *        values is constructed based on the scene coordinates
 * @param contents The contents being dragged during this event.
 */
public DockEvent(Object source, EventTarget target, EventType<? extends DockEvent> eventType,
    double x, double y, double screenX, double screenY, PickResult pickResult, Node contents) {
  super(source, target, eventType);
  this.x = x;
  this.y = y;
  this.screenX = screenX;
  this.screenY = screenY;
  this.sceneX = x;
  this.sceneY = y;
  this.pickResult = pickResult != null ? pickResult : new PickResult(target, x, y);
  final Point3D p = InputEventUtils.recomputeCoordinates(this.pickResult, null);
  this.x = p.getX();
  this.y = p.getY();
  this.z = p.getZ();
  this.contents = contents;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:33,代码来源:DockEvent.java

示例4: isOnSelectedCell

import javafx.event.EventTarget; //导入依赖的package包/类
/**
 * Checks if the given {@link MouseEvent} is on the selected cell.
 * 
 * @param pMouseEvent the {@link MouseEvent}.
 * @return {@code true} if the given event is on the selected cell.
 */
private boolean isOnSelectedCell(MouseEvent pMouseEvent)
{
	EventTarget target = pMouseEvent.getTarget();
	
	if (target instanceof Node)
	{
		Node targetNode = (Node)target;
		
		while (targetNode != null && !(targetNode instanceof FXDataBooksTree))
		{
			if (targetNode instanceof TreeCell<?>)
			{
				return ((TreeCell<?>)targetNode).isSelected();
			}
			
			targetNode = targetNode.getParent();
		}
	}
	
	return false;
}
 
开发者ID:ivartanian,项目名称:JVx.javafx,代码行数:28,代码来源:JavaFXTree.java

示例5: startDrag

import javafx.event.EventTarget; //导入依赖的package包/类
private void startDrag(MouseEvent evt) {
    EventTarget target = evt.getTarget();
    if (isScrollBar(target) || !isOnEntry(target)) {
        return;
    }
    Dragboard db = startDragAndDrop(TransferMode.MOVE);
    ClipboardContent content = new ClipboardContent();

    /*
     * We have to add some content, otherwise drag over will not be called.
     */
    content.putString("dummy"); //$NON-NLS-1$
    db.setContent(content);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:15,代码来源:AutoScrollPane.java

示例6: isOnEntry

import javafx.event.EventTarget; //导入依赖的package包/类
private boolean isOnEntry(EventTarget target) {
    if (target == null || !(target instanceof Node)) {
        return false;
    }

    Node node = (Node) target;
    if (node instanceof DayEntryView) {
        return true;
    }

    return isOnEntry(node.getParent());
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:13,代码来源:AutoScrollPane.java

示例7: isScrollBar

import javafx.event.EventTarget; //导入依赖的package包/类
private boolean isScrollBar(EventTarget target) {
    if (target instanceof Node) {
        return isScrollBar((Node) target);
    }

    return false;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:8,代码来源:AutoScrollPane.java

示例8: startDrag

import javafx.event.EventTarget; //导入依赖的package包/类
private void startDrag(MouseEvent evt) {
    EventTarget target = evt.getTarget();
    if (!isOnEntry(target)) {
        return;
    }
    Dragboard db = startDragAndDrop(TransferMode.MOVE);
    ClipboardContent content = new ClipboardContent();

    /*
     * We have to add some content, otherwise drag over will not be called.
     */
    content.putString("dummy"); //$NON-NLS-1$
    db.setContent(content);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:15,代码来源:DayViewScrollPane.java

示例9: redirect

import javafx.event.EventTarget; //导入依赖的package包/类
private void redirect(@NotNull final GestureEvent event) {

        final EventTarget target = event.getTarget();
        if (target == destination) return;

        final FileEditor currentEditor = editorAreaComponent.getCurrentEditor();
        if (currentEditor == null || !currentEditor.isInside(event.getSceneX(), event.getSceneY(), event.getClass())) {
            return;
        }

        Event.fireEvent(destination, event.copyFor(event.getSource(), destination));
    }
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:13,代码来源:EventRedirector.java

示例10: processMouseClick

import javafx.event.EventTarget; //导入依赖的package包/类
/**
 * Handle a click to a tab.
 */
private void processMouseClick(@NotNull final MouseEvent event) {
    final EventTarget target = event.getTarget();
    if (!(target instanceof Node)) return;

    final Node node = (Node) target;

    if (!(node instanceof Text) || node.getStyleClass().contains("tab-container")) {
        return;
    }

    final Parent label = node.getParent();

    if (!(label instanceof Label)) {
        return;
    }

    final Parent tabContainer = label.getParent();

    if (!tabContainer.getStyleClass().contains("tab-container")) {
        return;
    }

    if (isChangingTab()) {
        setChangingTab(false);
        return;
    }

    processExpandOrCollapse();
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:33,代码来源:TabToolComponent.java

示例11: isOnSelectedCell

import javafx.event.EventTarget; //导入依赖的package包/类
/**
 * Checks if the given {@link MouseEvent} is on the selected cell.
 * 
 * @param pMouseEvent the {@link MouseEvent}.
 * @return {@code true} if the given event is on the selected cell.
 */
private boolean isOnSelectedCell(MouseEvent pMouseEvent)
{
	EventTarget target = pMouseEvent.getTarget();
	
	if (target instanceof Node)
	{
		boolean isCellSelection = resource.getSelectionModel().isCellSelectionEnabled();
		
		Node targetNode = (Node)target;
		
		while (targetNode != null && !(targetNode instanceof FXDataBookView))
		{
			if (isCellSelection && targetNode instanceof TableCell<?, ?>)
			{
				return ((TableCell<?, ?>)targetNode).isSelected();
			}
			else if (!isCellSelection && targetNode instanceof TableRow<?>)
			{
				return ((TableRow<?>)targetNode).isSelected();
			}
			
			targetNode = targetNode.getParent();
		}
	}
	
	return false;
}
 
开发者ID:ivartanian,项目名称:JVx.javafx,代码行数:34,代码来源:JavaFXTable.java

示例12: treeViewClicked

import javafx.event.EventTarget; //导入依赖的package包/类
public void treeViewClicked(MouseEvent ev) {
  if (ev.getClickCount() == 2) {
    // don't process click on triangle
    EventTarget target = ev.getTarget();
    if (target instanceof Node && !"arrow".equals(((Node)target).getStyleClass())) {
      TreeItem<DbTreeValue> selectedItem = treeView.getSelectionModel().getSelectedItem();
      if (selectedItem != null && selectedItem.getValue().getValueType() == TreeValueType.COLLECTION) {
        mainFrameController.openTab();
        ev.consume();
      }
    }
  }
}
 
开发者ID:daa84,项目名称:mongofx,代码行数:14,代码来源:DBTreeController.java

示例13: initializeKeyActions

import javafx.event.EventTarget; //导入依赖的package包/类
private void initializeKeyActions() {
  addEventHandler(KeyEvent.KEY_RELEASED, event -> {
    if (isDeleteCode(event.getCode())) {
      EventTarget target = event.getTarget();
      if (target instanceof DraggableAudioFileListView) {
        DraggableAudioFileListView listView = (DraggableAudioFileListView) target;
        removeTracks(newArrayList(listView.getSelectionModel().getSelectedIndices()));
      }
    }
  });
}
 
开发者ID:nwaldispuehl,项目名称:interval-music-compositor,代码行数:12,代码来源:DraggableAudioFileListView.java

示例14: GameEvent

import javafx.event.EventTarget; //导入依赖的package包/类
public GameEvent(GameHandler source, EventTarget target, EventType<? extends GameEvent> eventType) {
	super(source, target, eventType);
}
 
开发者ID:GoSuji,项目名称:Suji,代码行数:4,代码来源:GameEvent.java

示例15: SujiEvent

import javafx.event.EventTarget; //导入依赖的package包/类
public SujiEvent(EventPublisher source, EventTarget target, EventType<? extends SujiEvent> eventType) {
	super(source, target, eventType);
	publisher = source;
}
 
开发者ID:GoSuji,项目名称:Suji,代码行数:5,代码来源:SujiEvent.java


注:本文中的javafx.event.EventTarget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。