當前位置: 首頁>>代碼示例>>Java>>正文


Java Parent類代碼示例

本文整理匯總了Java中javafx.scene.Parent的典型用法代碼示例。如果您正苦於以下問題:Java Parent類的具體用法?Java Parent怎麽用?Java Parent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Parent類屬於javafx.scene包,在下文中一共展示了Parent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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();
	});
}
 
開發者ID:coding-dream,項目名稱:Notebook,代碼行數:30,代碼來源:SyncFragment.java

示例2: studyProfileDetails

import javafx.scene.Parent; //導入依賴的package包/類
/**
 * Displays the StudyProfile details page
 *
 * @param profile StudyProfile for which the details should be shown.
 */
public void studyProfileDetails(StudyProfile profile) throws IOException
{
    StudyProfileController spc = new StudyProfileController(profile);

    // Load in the .fxml file:
    FXMLLoader loader = new FXMLLoader(getClass().getResource("/View/StudyProfile.fxml"));
    loader.setController(spc);
    Parent root = loader.load();

    // Set the scene:
    Stage stage = new Stage();
    stage.initModality(Modality.APPLICATION_MODAL);
    stage.setScene(new Scene(root, 550, 232));
    stage.setTitle(profile.getName());
    stage.resizableProperty().setValue(false);
    stage.getIcons().add(new Image("file:icon.png"));
    stage.showAndWait();
}
 
開發者ID:Alienturnedhuman,項目名稱:PearPlanner,代碼行數:24,代碼來源:UIManager.java

示例3: start

import javafx.scene.Parent; //導入依賴的package包/類
@Override
public void start(Stage stage) throws Exception {

    FXMLLoader fxmlLoader = new FXMLLoader(
            getClass().getResource("/FXML/main.fxml"));
    Parent root = (Parent) fxmlLoader.load();
    MainController mainController
            = (MainController) fxmlLoader.getController();

    DataModel model = new DataModel();
    mainController.initModel(model);
    mainController.setStage(stage);
    
    Scene scene = new Scene(root);
    scene.getStylesheets().add("/CSS/main.css");
    stage.setTitle("Ember");
    stage.getIcons().add(new Image(
            "/images/EMBER-LOGO-COLOR.png"));
    stage.setScene(scene);
    stage.setMinHeight(550);
    stage.setMinWidth(550);
    stage.show();
    stage.toFront();
}
 
開發者ID:Soheibooo,項目名稱:EMBER,代碼行數:25,代碼來源:Ember.java

示例4: goToHelp

import javafx.scene.Parent; //導入依賴的package包/類
public void goToHelp(double positionX, double positionY) {
	try {
		Stage HelpStage = new Stage();
		Parent root = FXMLLoader.load(getClass().getResource("/view/Help.fxml"));
		Scene scene = new Scene(root,800,550);
		HelpStage.setScene(scene);
		HelpStage.setResizable(false);
		HelpStage.getIcons().add(new Image(getClass().getResourceAsStream("/imges/purse.png")));
		HelpStage.setTitle("Help");
		HelpStage.setX(positionX);
		HelpStage.setY(positionY);
		HelpStage.show();
	} catch(Exception e) {
		e.printStackTrace();
	}
}
 
開發者ID:krHasan,項目名稱:Money-Manager,代碼行數:17,代碼來源:GoToOperation.java

示例5: start

import javafx.scene.Parent; //導入依賴的package包/類
@Override
public void start(Stage primaryStage) throws Exception {
    FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/main.fxml"));
    Parent root = fxmlLoader.load();
    primaryStage.setTitle("ソースリスト作るよ");
    primaryStage.setScene(new Scene(root, 700, 500));
    primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/icons.png")));
    primaryStage.setMinHeight(500);
    primaryStage.setMinWidth(700);
    Controller controller = fxmlLoader.getController();
    controller.init(primaryStage);
    primaryStage.setMaxHeight(500);
    primaryStage.setMaxWidth(700);


    primaryStage.show();
}
 
開發者ID:Khromium,項目名稱:MakeSourceList4j,代碼行數:18,代碼來源:Main.java

示例6: openSubmitAction

import javafx.scene.Parent; //導入依賴的package包/類
@FXML
public void openSubmitAction(ActionEvent event) throws IOException {
    Node node = (Node) event.getSource();
    final Stage stage = (Stage) node.getScene().getWindow();
    final Parent home = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml"));
    final Scene hScene = new Scene(home);
    Parent root = FXMLLoader.load(getClass().getResource("/fxml/Submit.fxml"));
    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.show();

    root.setOnKeyPressed(new EventHandler<KeyEvent>() {
        public void handle(KeyEvent ke) {
            if (ke.getCode() == KeyCode.ESCAPE) {
                System.out.println("Key Pressed: " + ke.getCode());
                stage.setScene(hScene);
            }
        }
    });
}
 
開發者ID:dewarian,項目名稱:FYS_T3,代碼行數:21,代碼來源:submitController.java

示例7: setState

import javafx.scene.Parent; //導入依賴的package包/類
public void setState(int state)
{
	// 0 is on, 1 is off
	for (int index = 0; index < segments.size(); index++)
	{
		int maskedBit = (state >> index) & 1;
		boolean isOn = (maskedBit == 0);

		String color = isOn ? OFF_COLOR : ON_COLOR;
		Parent segment = segments.get(index);
		for (Node section : segment.getChildrenUnmodifiable())
		{
			section.setStyle("-fx-background-color: " + color);
		}
	}
}
 
開發者ID:dhawal9035,項目名稱:WebPLP,代碼行數:17,代碼來源:SevenSegmentPanel.java

示例8: DrilldownPieChartSample

import javafx.scene.Parent; //導入依賴的package包/類
public DrilldownPieChartSample() {
    String drilldownCss = DrilldownPieChartSample.class.getResource("DrilldownChart.css").toExternalForm();

    PieChart pie = new PieChart(
            FXCollections.observableArrayList(
            A = new PieChart.Data("A", 20),
            B = new PieChart.Data("B", 30),
            C = new PieChart.Data("C", 10),
            D = new PieChart.Data("D", 40)));
    ((Parent) pie).getStylesheets().add(drilldownCss);

    setDrilldownData(pie, A, "a");
    setDrilldownData(pie, B, "b");
    setDrilldownData(pie, C, "c");
    setDrilldownData(pie, D, "d");
    getChildren().add(pie);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:18,代碼來源:DrilldownPieChartSample.java

示例9: doFindEntryView

import javafx.scene.Parent; //導入依賴的package包/類
private EntryViewBase<?> doFindEntryView(Parent parent, Entry<?> entry) {
    EntryViewBase<?> result = null;

    for (Node node : parent.getChildrenUnmodifiable()) {
        if (node instanceof EntryViewBase) {
            EntryViewBase<?> base = (EntryViewBase<?>) node;
            if (base.getEntry().equals(entry)) {
                result = base;
                break;
            }
        } else if (node instanceof Parent) {
            result = doFindEntryView((Parent) node, entry);
            if (result != null) {
                break;
            }
        }
    }

    return result;
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:21,代碼來源:DateControl.java

示例10: openHome

import javafx.scene.Parent; //導入依賴的package包/類
@FXML
public void openHome(ActionEvent event) throws IOException {
    Node node = (Node) event.getSource();
    final Stage stage = (Stage) node.getScene().getWindow();
    final Parent home = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml"));
    final Scene hScene = new Scene(home);
    Parent root = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml"));
    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.show();
    stage.centerOnScreen();

    root.setOnKeyPressed(new EventHandler<KeyEvent>() {
        public void handle(KeyEvent ke) {
            if (ke.getCode() == KeyCode.ESCAPE) {
                System.out.println("Key Pressed: " + ke.getCode() + " Made by ShaMaster");
                stage.setScene(hScene);
            }
        }
    });
}
 
開發者ID:dewarian,項目名稱:FYS_T3,代碼行數:22,代碼來源:searchLugController.java

示例11: start

import javafx.scene.Parent; //導入依賴的package包/類
@Override
    public void start(Stage primaryStage) throws Exception{
        FXMLLoader fxmlLoader = new FXMLLoader();
        fxmlLoader.setLocation(getClass().getResource("sample.fxml"));
        Parent root = fxmlLoader.load();
        Screen screen = Screen.getPrimary ();

//        界麵初始化
        Controller controller = fxmlLoader.getController();
        controller.init(primaryStage);

        Rectangle2D bounds = screen.getVisualBounds ();

        double minX = bounds.getMinX ();
        double minY = bounds.getMinY ();
        double maxX = bounds.getMaxX ();
        double maxY = bounds.getMaxY ();

        screenWidth = maxX - minX;
        screenHeight = maxY - minY;

        Scene scene = new Scene(root, (maxX - minX) * 0.6, (maxY - minY) * 0.6);

        primaryStage.setTitle ("Higher Cloud Compute Platform");
        primaryStage.setScene (scene);
		primaryStage.setFullScreen(true);
        primaryStage.show ();

    }
 
開發者ID:Luodian,項目名稱:Higher-Cloud-Computing-Project,代碼行數:30,代碼來源:Main.java

示例12: overlay

import javafx.scene.Parent; //導入依賴的package包/類
private static Parent overlay(int version, int display,
        YCbCr params, int yCode, String suffix) {
    double ye = params.fromLumaCode(yCode);

    Label label = new Label(getLabel(version, display, params, yCode,
            suffix));
    label.setFont(font(40));
    label.setTextFill(gray(max(0.25, min(0.5, ye))));

    BorderPane.setMargin(label, new Insets(20));
    BorderPane layout = new BorderPane();
    layout.setBackground(EMPTY);
    layout.setBottom(label);
    return layout;
}
 
開發者ID:testing-av,項目名稱:testing-video,代碼行數:16,代碼來源:Calibrate2160pHDR10_LGOLED.java

示例13: showHome

import javafx.scene.Parent; //導入依賴的package包/類
public static void showHome()
{
    try {
        FXMLLoader loader	= new FXMLLoader();
        loader.setLocation( AppDelegate.class.getResource( "view/home.fxml" ) );
        Parent root = (Parent) loader.load();

        HomeController homeController = (HomeController)loader.getController();
        homeController.init( );

        m_scene = new Scene(root, 700, 532);

        static_stage.hide();
        static_stage.setTitle("亮金跨平台串口助手V1.0.0 by brok1n");
        static_stage.setScene(m_scene);
        static_stage.show();

    }catch (IOException e)
    {}
}
 
開發者ID:brok1n,項目名稱:SerialAssistant,代碼行數:21,代碼來源:AppDelegate.java

示例14: joinNow

import javafx.scene.Parent; //導入依賴的package包/類
public void joinNow(ActionEvent actionEvent) {
    try {
        FXMLLoader fxmlLoader2 = new FXMLLoader(getClass().getResource("../../Resources/Layouts/register_stage.fxml"));
        Parent root2 = (Parent) fxmlLoader2.load();
        Stage stage2 = new Stage();
        stage2.setScene(new Scene(root2));
        stage2.setResizable(false);
        stage2.initModality(Modality.WINDOW_MODAL);
        stage2.initOwner(ApplicationLauncher.primaryStage);
        stage2.initStyle(StageStyle.UNDECORATED);
        stage2.showAndWait();
    } catch (Exception e1) {
    }
}
 
開發者ID:alchemsynergy,項目名稱:alchem,代碼行數:15,代碼來源:LoginController.java

示例15: NewTaskListWindow

import javafx.scene.Parent; //導入依賴的package包/類
/**
 * Builds the window and add events.
 * @throws IOException 
 */
public NewTaskListWindow() throws IOException {
    super();
    FXMLLoader fxmlLoader = new FXMLLoader(
            getClass().getResource("/FXML/newTaskList.fxml"));
    Parent root = (Parent) fxmlLoader.load();
    taskListController
            = (NewTaskListController) fxmlLoader.getController();

    Scene scene = new Scene(root);
    setScene(scene);
    setResizable(false);
    initStyle(StageStyle.TRANSPARENT);

    this.wantsToAdd = false;
    //After pressing 'Enter', closes this window (which returns the value)
    scene.setOnKeyPressed((final KeyEvent keyEvent) -> {
        if (keyEvent.getCode() == KeyCode.ENTER) {
            this.wantsToAdd = true;
            this.close();
        } else if (keyEvent.getCode() == KeyCode.ESCAPE) {
            this.close();
        }
    });

    //Not focusing the window means closing it
    focusedProperty().addListener((obs, wasFocused, isNowFocused) -> {
        if (!isNowFocused) {
            close();
        }
    });
}
 
開發者ID:Soheibooo,項目名稱:EMBER,代碼行數:36,代碼來源:NewTaskListWindow.java


注:本文中的javafx.scene.Parent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。