本文整理汇总了Java中javafx.scene.Parent.lookup方法的典型用法代码示例。如果您正苦于以下问题:Java Parent.lookup方法的具体用法?Java Parent.lookup怎么用?Java Parent.lookup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.Parent
的用法示例。
在下文中一共展示了Parent.lookup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initData
import javafx.scene.Parent; //导入方法依赖的package包/类
@Override
public void initData(Parent node, Map<String, String> bundle) {
progressbar = (ProgressIndicator) node.lookup("#progressbar");
iv_sync = (ImageView) node.lookup("#iv_sync");
iv_down = (ImageView) node.lookup("#iv_down");
iv_sync.setOnMouseEntered(e-> {
iv_sync.setImage(sync_enter);
});
iv_sync.setOnMouseExited(e-> {
iv_sync.setImage(sync_defalt);
});
iv_down.setOnMouseEntered(e-> {
iv_down.setImage(down_enter);
});
iv_down.setOnMouseExited(e-> {
iv_down.setImage(down_default);
});
iv_down.setOnMouseClicked(e->{
download();
});
iv_sync.setOnMouseClicked(e->{
sync();
});
}
示例2: initData
import javafx.scene.Parent; //导入方法依赖的package包/类
@Override
public void initData(Parent node, Map<String, String> bundle) {
btn_deploy = (Button) node.lookup("#btn_deploy");
progressbar = (ProgressIndicator) node.lookup("#progressbar");
btn_deploy.setOnAction(e->{
progressbar.isIndeterminate();// һ ��������ʾ�����ڷ�ȷ��ģʽ,����progressbar����һ����ֵ�и�Сbug������¡�
progressbar.setVisible(true);
progressbar.setProgress(-1f);
progressbar.setProgress(0.5f);
progressbar.setProgress(-1f);
btn_deploy.setDisable(true);// �����ظ����
AnnotationHandler.sendMessage("work",null);
});
AnnotationHandler.register(this);
}
示例3: initData
import javafx.scene.Parent; //导入方法依赖的package包/类
@Override
public void initData(Parent node, Map<String, String> bundle) {
et_download_path = (TextField) node.lookup("#et_download_path");
et_deploy_path = (TextField) node.lookup("#et_deploy_path");
et_secret = (TextField) node.lookup("#et_secret");
et_git_username = (TextField) node.lookup("#et_git_username");
et_git_passwd = (PasswordField) node.lookup("#et_git_passwd");
et_app_password = (PasswordField) node.lookup("#et_app_password");
et_app_password_second = (PasswordField) node.lookup("#et_app_password_second");
btn_submit = (Button) node.lookup("#btn_submit");
readFromProperty();
btn_submit.setOnAction(e->{
String message = "";
if(!et_app_password.getText().trim().equals(et_app_password_second.getText().trim())){
message = "�����������벻һ�£�";
DialogHelper.alert("����", message);
return;
}
if(!"".equals(et_app_password.getText().trim()) && et_app_password.getText().trim().length() < 5){
message = "���볤��̫��,������ȫ��";
DialogHelper.alert("����", message);
return;
}
writeToProperty();
});
}
示例4: mkRoot
import javafx.scene.Parent; //导入方法依赖的package包/类
@Override
public Node mkRoot() {
try {
Parent node = FXMLLoader.load(getClass().getResource("/ComplexScene.fxml"));
node.setPickOnBounds(true);
node.setMouseTransparent(true);
WebView webview = (WebView) node.lookup("webview");
if(webview != null){
webview.getEngine().load("http://purecss3.net/doraemon/doraemon_css3.html");
}
GesturePane pane = new GesturePane(new SubScene(node, 500, 500));
VBox.setVgrow(pane, Priority.ALWAYS);
Label description = new Label("Zoom and scroll on the SubScene below, " +
"observe that controls in JavaFX are vectors " +
"and that lighting effects are respected" +
"(different zoom alters light distance).");
description.setWrapText(true);
description.setPadding(new Insets(16));
return new VBox(description, pane);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
示例5: getView
import javafx.scene.Parent; //导入方法依赖的package包/类
@Override
public Parent getView() {
Parent parent = LayoutInflater.inflate("activity_main", Parent.class);
parent.getStylesheets().add("css/main.css");
AnchorPane main_left = (AnchorPane) parent.lookup("#main_left");
StackPane main_center = (StackPane) parent.lookup("#main_center");
// left
TreeView treeView = new TreeView();
// TreeView������Ҳ�Ƿ�Node���ͣ����Բ�����SceneBuilder��ͼ��
TreeItem<String> treeItemRoot = new TreeItem<String>("�����˵�",rootIcon);
TreeItem<String> item_1 = new TreeItem<String>("���¹���",oneIcon);
TreeItem<String> item_2 = new TreeItem<String>("������",twoIcon);
TreeItem<String> item_3 = new TreeItem<String>("���ù���",eightIcon);
TreeItem<String> item_4 = new TreeItem<String>("ϵͳ����",threeIcon);
treeItemRoot.getChildren().addAll(Arrays.asList(item_1,item_2,item_3,item_4));
TreeItem<String> item_4_1 = new TreeItem<String>("����",fourIcon);
TreeItem<String> item_4_2 = new TreeItem<String>("����",fiveIcon);
TreeItem<String> item_4_3 = new TreeItem<String>("ͬ��",sixIcon);
TreeItem<String> item_4_4 = new TreeItem<String>("�˳�",sevenIcon);
treeItemRoot.getChildren().get(3).getChildren().addAll(Arrays.asList(item_4_1,item_4_2,item_4_3,item_4_4));
treeItemRoot.setExpanded(true);
item_4.setExpanded(true);
treeView.setShowRoot(true);
treeView.setRoot(treeItemRoot);
treeView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TreeItem<String>>() {
@Override
public void changed(ObservableValue<? extends TreeItem<String>> observable, TreeItem<String> oldValue,
TreeItem<String> newValue) {
Parent container = null;
switch (newValue.getValue()) {
case "���¹���":
setSelection(main_center,FRAGMENT_ARTICLE);
break;
case "������":
setSelection(main_center, FRAGMENT_CATEGORY);
break;
case "����":
setSelection(main_center, FRAGMENT_SETTING);
break;
case "����":
setSelection(main_center, FRAGMENT_DEPLOY);
break;
case "ͬ��":
setSelection(main_center, FRAGMENT_SYNC);
break;
case "���ù���":
setSelection(main_center, FRAGMENT_TOOL);
break;
case "�˳�":
Platform.exit();
break;
default:
break;
}
}
});
main_left.getChildren().add(treeView);
intSelection(main_center);
return parent;
}