本文整理汇总了Java中javafx.scene.Node.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Node.setVisible方法的具体用法?Java Node.setVisible怎么用?Java Node.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.Node
的用法示例。
在下文中一共展示了Node.setVisible方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayNextScreen
import javafx.scene.Node; //导入方法依赖的package包/类
private void displayNextScreen( ) {
if ( getChildren( ).isEmpty( ) )
return;
final Node previousScreen = _currentDisplayedScreen;
final int index = previousScreen == null ? -1 : getChildren( ).indexOf( previousScreen );
final int nextIndex = ( index == -1 ? 0 : index + 1 ) % getChildren( ).size( );
final Node nextScreen = getChildren( ).get( nextIndex );
nextScreen.setVisible( true );
if ( previousScreen != null && previousScreen != nextScreen )
previousScreen.setVisible( false );
_currentDisplayedScreen = nextScreen;
}
示例2: show
import javafx.scene.Node; //导入方法依赖的package包/类
/**
* Constructs and displays dialog based on the FXML at the specified URL
*
* @param url
* the location of the FXML file, relative to the
* {@code sic.nmsu.javafx} package
* @param stateInit
* a consumer used to configure the controller before FXML injection
* @return
*/
public static <R, C extends FXDialogController<R>> R show(String url, Consumer<C> stateInit) {
final Pair<Parent, C> result = FXController.get(url, stateInit);
final Parent view = result.getValue0();
final C ctrl = result.getValue1();
final Dialog<R> dialog = new Dialog<>();
dialog.titleProperty().bind(ctrl.title);
final DialogPane dialogPane = dialog.getDialogPane();
dialogPane.setContent(view);
dialogPane.getButtonTypes().add(ButtonType.CLOSE);
final Stage window = (Stage) dialogPane.getScene().getWindow();
window.getIcons().add(new Image("images/recipe_icon.png"));
final Node closeButton = dialogPane.lookupButton(ButtonType.CLOSE);
closeButton.managedProperty().bind(closeButton.visibleProperty());
closeButton.setVisible(false);
ctrl.dialog = dialog;
ctrl.dialog.showAndWait();
return ctrl.result;
}
示例3: showUI
import javafx.scene.Node; //导入方法依赖的package包/类
private void showUI(Node myManager) {
for (Node manager : mainPane.getChildren()) {
manager.setVisible(false);
}
// logo
mainPane.getChildren().get(0).setVisible(true);
myManager.setVisible(true);
}
示例4: draw
import javafx.scene.Node; //导入方法依赖的package包/类
protected void draw (Node node, Drawable sprite) {
Coordinate location = sprite.getLocation();
node.relocate(getScale().scale(location.getX()) -
sprite.getDrawer().getGraphic().getHeight().get() / 2,
getScale().scale(location.getY()) - sprite.getDrawer().getGraphic()
.getHeight().get() / 2);
node.setScaleX(getScale().getScale());
node.setScaleY(getScale().getScale());
node.setVisible(sprite.getDrawer().isVisible());
node.setRotate(sprite.getOrientation());
}
示例5: setOnDragDetected
import javafx.scene.Node; //导入方法依赖的package包/类
@Override
public void setOnDragDetected (MouseEvent e, Node source) {
Dragboard db = source.startDragAndDrop(TransferMode.COPY);
db.setContent(createClipboard(MOVE_STRING));
db.setDragView(getSpriteImage(source));
source.setVisible(false);
levelView.getPane().setOnDragDropped(event -> setOnDragDropped(event));
}
示例6: enableNode
import javafx.scene.Node; //导入方法依赖的package包/类
public static final void enableNode(final Node NODE, final boolean ENABLE) {
NODE.setVisible(ENABLE);
NODE.setManaged(ENABLE);
}
示例7: setVisibility
import javafx.scene.Node; //导入方法依赖的package包/类
public void setVisibility(final Node item, final boolean state)
{
item.setVisible(state);
item.setManaged(state);
}