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


Java Dragboard.hasString方法代码示例

本文整理汇总了Java中javafx.scene.input.Dragboard.hasString方法的典型用法代码示例。如果您正苦于以下问题:Java Dragboard.hasString方法的具体用法?Java Dragboard.hasString怎么用?Java Dragboard.hasString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.input.Dragboard的用法示例。


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

示例1: initializeSetOnDragDropped

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
private void initializeSetOnDragDropped() {
//        LoggerFacade.INSTANCE.debug(this.getClass(), "Initialize setOnDragDropped"); // NOI18N

        super.setOnDragDropped(event -> {
            if (super.getItem() == null) {
                return;
            }

            final Dragboard dragboard = event.getDragboard();
            boolean success = false;
            if (dragboard.hasString()) {
                final List<ProjectItemPresenter> items = this.updateOverview(dragboard);
                this.updateDatabase(items);

                success = true;
            }

            event.setDropCompleted(success);
            event.consume();
        });
    }
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:22,代码来源:ProjectItemCell.java

示例2: handleDragDropped

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
private void handleDragDropped(DragEvent event) {
    LOGGER.debug("drag dropped");

    Dragboard dragboard = event.getDragboard();
    boolean success = dragboard.hasString();
    if (success) {
        try {
            int slideId = Integer.parseInt(dragboard.getString());
            LOGGER.debug("dropped slide with id {} on divider", slideId);

            if (slideDroppedCallback != null) {
                slideDroppedCallback.accept(slideId);
            }
        } catch (NumberFormatException ex) {
            success = false;
        }

    }
    event.setDropCompleted(success);
    event.consume();
}
 
开发者ID:travelimg,项目名称:travelimg,代码行数:22,代码来源:SlideDivider.java

示例3: createOnDragDroppedHandler

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
private EventHandler<DragEvent> createOnDragDroppedHandler()
{
	return new EventHandler<DragEvent>() 
   	{
   		public void handle(DragEvent pEvent)
   		{
   			Dragboard db = pEvent.getDragboard();
   			boolean success = false;
   			if(db.hasString()) 
   			{
   				CardTransfer transfer = new CardTransfer(pEvent.getDragboard().getString());
   				GameModel.instance().getCardMove(transfer.getTop(), aIndex).perform();
   				success = true;
   			}
   			pEvent.setDropCompleted(success);
   			pEvent.consume();
   		}
   	};
}
 
开发者ID:prmr,项目名称:Solitaire,代码行数:20,代码来源:SuitStack.java

示例4: createDragDroppedHandler

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
private EventHandler<DragEvent> createDragDroppedHandler(final ImageView pImageView, final Card pCard)
{
	return new EventHandler<DragEvent>() 
	{
		public void handle(DragEvent pEvent)
		{
			Dragboard db = pEvent.getDragboard();
			boolean success = false;
			if(db.hasString()) 
			{
				GameModel.instance().getCardMove(new CardTransfer(db.getString()).getTop(), aIndex).perform(); 
				success = true;
			}

			pEvent.setDropCompleted(success);

			pEvent.consume();
		}
	};
}
 
开发者ID:prmr,项目名称:Solitaire,代码行数:21,代码来源:CardStack.java

示例5: handleDragDroppedAction

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
/**
 * handleDragDroppedAction() method.
 *
 * @param argEvent the event handled
 */
@FXML
protected final void handleDragDroppedAction(final DragEvent argEvent) {
    final Dragboard board = argEvent.getDragboard();
    boolean success = false;
    if (board.hasString()) {
        final TreeView target = (TreeView) argEvent.getSource();
        @SuppressWarnings("unchecked") final TreeItem<String> tmp = new TreeItem(board.getString());
        //noinspection unchecked
        target.getRoot().getChildren().add(tmp);
        success = true;
    }
    argEvent.setDropCompleted(success);
    argEvent.consume();
    LOG.info("Drag dropped");
}
 
开发者ID:yeamanan,项目名称:ProjectTwo,代码行数:21,代码来源:SurvivorEditorController.java

示例6: setOnDragDropped

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
@Override
public void setOnDragDropped (DragEvent e) {
    if (checkPlaceableTile(e)) {
        Dragboard db = e.getDragboard();
        if (db.hasString()) {
            addSprite(e.getX(), e.getY());
        }
    }
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:10,代码来源:DraggableSpriteCell.java

示例7: setOnDragDropped

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
@Override
public void setOnDragDropped (DragEvent e) {
    Dragboard db = e.getDragboard();
    if (db.hasString()) {
        if (!myTarget.getItems().contains(getProfilable())) {
            myTarget.getItems().add(getProfilable());
        }
    }
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:10,代码来源:DraggableAddCell.java

示例8: mouseDragDropped

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
private void mouseDragDropped (final DragEvent event) {
    Dragboard db = event.getDragboard();
    boolean success = false;
    if (db.hasContent(VoogaFileFormat.getInstance())) {
        VoogaFile node = (VoogaFile) db.getContent(VoogaFileFormat.getInstance());
        if (node.getType() != VoogaFileType.FOLDER) {
            if (node.getType() != VoogaFileType.ARCHETYPE &&
                node.getType() != VoogaFileType.GAME_OBJECT) {
                if (elementManager.hasElement(node.getPath())) {
                    moveElement(node.getPath(), event);
                }
                else {
                    addElement(node, event, "");
                }
            }
            else {
                if (node.getType() == VoogaFileType.ARCHETYPE) {
                    addElement(node, event, node.toString());
                }
            }
        }
        success = true;
    }

    if (db.hasString()) {
        Node object = (Node) elementManager.getElement(db.getString());
        object.setTranslateX(event.getX() - x_offset);
        object.setTranslateY(event.getY() - y_offset);
    }

    event.setDropCompleted(success);
}
 
开发者ID:sjain28,项目名称:Game-Engine-Vooga,代码行数:33,代码来源:DesignBoard.java

示例9: destinationFieldOnDragOver

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
public void destinationFieldOnDragOver(DragEvent event) {
    Dragboard db = event.getDragboard();
    if (event.getGestureSource() != destnationField) {
        if (db.hasString() && Files.isDirectory(new File(db.getString()).toPath())) {
            destnationField.requestFocus();
            event.acceptTransferModes(TransferMode.COPY);
        } else if (db.hasFiles() && Files.isDirectory(db.getFiles().get(0).toPath())) {
            destnationField.requestFocus();
            event.acceptTransferModes(TransferMode.LINK);
        }
    }
    event.consume();
}
 
开发者ID:abhishekmunie,项目名称:Magic-Copier,代码行数:14,代码来源:MagicCopierPreferencesController.java

示例10: destinationFieldOnDragDropped

import javafx.scene.input.Dragboard; //导入方法依赖的package包/类
public void destinationFieldOnDragDropped(DragEvent event) {
    Dragboard db = event.getDragboard();
    boolean success = false;
    if (db.hasString()) {
        model.destinationDirectoryProperty().set(new File(db.getString()));
        event.setDropCompleted(true);
    }
    if (db.hasFiles()) {
        model.destinationDirectoryProperty().set(db.getFiles().get(0));
        event.setDropCompleted(true);
    }
    event.consume();
}
 
开发者ID:abhishekmunie,项目名称:Magic-Copier,代码行数:14,代码来源:MagicCopierPreferencesController.java


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