/**
* Creates stage by calling createScene and with almost every properties of object.
*
* @see GenericView#createScene()
* @see javafx.stage.Stage
* @return
* @throws IOException
*/
public Stage createStage() throws IOException {
Stage stage = new Stage();
if (this.getTitle() != null) stage.setTitle(this.getTitle());
stage.setScene(this.createScene());
stage.setResizable(this.isResizable());
stage.setMaximized(this.isMaximized());
stage.setFullScreen(this.isFullscreen());
stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
if (!this.isDecorated()) stage.initStyle(StageStyle.UNDECORATED);
if (this.isModal()) stage.initModality(Modality.APPLICATION_MODAL);
if (this.getIcon() != null)
stage.getIcons().add(this.getIcon());
if (this.getIcon() == null && GenericView.getGlobalIcon() != null)
stage.getIcons().add(GenericView.getGlobalIcon());
return stage;
}
java类javafx.stage.StageStyle的实例源码
GenericView.java 文件源码
项目:primitivefxmvc
阅读 22
收藏 0
点赞 0
评论 0
TopsoilWindow.java 文件源码
项目:Squid
阅读 19
收藏 0
点赞 0
评论 0
public void loadTopsoilWindow(double x, double y) {
Pane topsoilPlotUI = topsoilPlot.initializePlotPane();
Scene topsoilPlotScene = new Scene(topsoilPlotUI, 600, 600);
topsoilPlotWindow = new Stage(StageStyle.DECORATED);
// center on Squid
topsoilPlotWindow.setX(x);
topsoilPlotWindow.setY(y);
topsoilPlotWindow.setResizable(true);
topsoilPlotWindow.setScene(topsoilPlotScene);
topsoilPlotWindow.setTitle("Topsoil Plot");
topsoilPlotWindow.requestFocus();
topsoilPlotWindow.initOwner(null);
topsoilPlotWindow.initModality(Modality.NONE);
topsoilPlotWindow.show();
}
AboutView.java 文件源码
项目:hygene
阅读 31
收藏 0
点赞 0
评论 0
/**
* Creates an instance of a {@link AboutView}.
*
* @throws IOException if unable to load the controller
*/
@Inject
public AboutView(final FXMLLoader fxmlLoader) throws UIInitialisationException, IOException {
stage = new Stage();
stage.initStyle(StageStyle.UNDECORATED);
stage.setResizable(false);
final URL resource = getClass().getResource(ABOUT_VIEW);
fxmlLoader.setLocation(resource);
final Scene rootScene = new Scene(fxmlLoader.load());
rootScene.addEventHandler(KeyEvent.KEY_PRESSED, event -> {
if (event.getCode() == KeyCode.ESCAPE) {
stage.hide();
}
});
stage.setScene(rootScene);
stage.focusedProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue) {
stage.hide();
}
});
}
StoreController.java 文件源码
项目:rsam-gui
阅读 24
收藏 0
点赞 0
评论 0
@FXML
private void loadImageArchiveEditor() {
try {
FXMLLoader loader = new FXMLLoader(App.class.getResource("/ImageArchiveUI.fxml"));
Parent root = loader.load();
ImageArchiveController controller = loader.getController();
Stage stage = new Stage();
controller.setStage(stage);
stage.setTitle("Image Archive Editor");
Scene scene = new Scene(root);
scene.getStylesheets().add(App.class.getResource("/style.css").toExternalForm());
stage.getIcons().add(new Image(getClass().getResourceAsStream("/icons/app_icon_128.png")));
stage.setScene(scene);
stage.initStyle(StageStyle.TRANSPARENT);
stage.setResizable(false);
stage.centerOnScreen();
stage.setTitle("Archive Editor");
stage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
UDEDesktop.java 文件源码
项目:UDE
阅读 22
收藏 0
点赞 0
评论 0
@Override
public void start(final Stage stage) throws Exception {
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
int width = gd.getDisplayMode().getWidth();
int height = gd.getDisplayMode().getHeight();
Scene scene = new Scene(FXMLLoader.load(UDEDesktop.class.getResource("resources/UDEDesktopWindow.fxml")), width, height);
scene.setFill(null);
scene.getStylesheets().add("resources/stylesheet.css");
stage.setScene(scene);
// stage.initStyle(StageStyle.UNDECORATED);
stage.initStyle(StageStyle.TRANSPARENT);
stage.setTitle("UDEDesktop");
stage.setMinWidth(300);
stage.setMinHeight(300);
stage.show();
stage.toBack();
}
App.java 文件源码
项目:osrs-data-converter
阅读 42
收藏 0
点赞 0
评论 0
@Override
public void start(Stage stage) {
App.stage = stage;
try {
Parent root = FXMLLoader.load(App.class.getResource("/ui/Main.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("/style.css").toExternalForm());
stage.setTitle("OSRS Data To 317 Converter");
stage.centerOnScreen();
stage.setResizable(false);
stage.sizeToScene();
stage.initStyle(StageStyle.UNDECORATED);
stage.setScene(scene);
stage.getIcons().add(new Image(App.class.getResourceAsStream("/icons/icon.png")));
stage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
XpanderFX.java 文件源码
项目:xpanderfx
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void start(Stage stage) throws Exception {
URL location = getClass().getResource("MainFXMLDocument.fxml");
Parent root = FXMLLoader.load(location);
root.setOnMouseDragged(e -> this.dragStage(e, stage));
root.setOnMouseMoved(e -> this.calculateGap(e, stage));
Scene scene = new Scene(root, Color.TRANSPARENT);
scene.getStylesheets().add("/com/shekkar/xpanderfx/mainStyler.css");
stage.setScene(scene);
stage.setAlwaysOnTop(true);
stage.initStyle(StageStyle.TRANSPARENT);
stage.show();
}
MainDisplay.java 文件源码
项目:SnapDup
阅读 27
收藏 0
点赞 0
评论 0
@FXML
private void btnAboutAction()
{
try
{
FXMLLoader loader = new FXMLLoader(MainDisplay.class.getResource("/fxml/AboutDialog.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root);
Stage stage = new Stage();
stage.initModality(Modality.APPLICATION_MODAL);
stage.initStyle(StageStyle.UNDECORATED);
stage.setScene(scene);
stage.show();
}
catch(IOException e)
{
e.printStackTrace();
}
}
OverLayWindow.java 文件源码
项目:CapsLock
阅读 18
收藏 0
点赞 0
评论 0
void Exe(int i) {
if(i==1) {
warnmesse="プレイ開始から5分経過しました\n混雑している場合は次の人に\n交代してください";
fontsize=25;
}else if(i==2) {
warnmesse="プレイ開始から10分経過しました\n混雑している場合は次の人に\n交代してください";
fontsize=25;
}else if(i==-1) {
warnmesse="user timer is reset";
fontsize=35;
}
final Stage primaryStage = new Stage(StageStyle.TRANSPARENT);
primaryStage.initModality(Modality.NONE);
final StackPane root = new StackPane();
final Scene scene = new Scene(root, 350, 140);
scene.setFill(null);
final Label label = new Label(warnmesse);
label.setFont(new Font("Arial", fontsize));
BorderPane borderPane = new BorderPane();
borderPane.setCenter(label);
borderPane.setStyle("-fx-background-radius: 10;-fx-background-color: rgba(0,0,0,0.3);");
root.getChildren().add(borderPane);
final Rectangle2D d = Screen.getPrimary().getVisualBounds();
primaryStage.setScene(scene);
primaryStage.setAlwaysOnTop(true);
primaryStage.setX(d.getWidth()-350);
primaryStage.setY(d.getHeight()-300);
primaryStage.show();
final Timeline timer = new Timeline(new KeyFrame(Duration.seconds(CLOSE_SECONDS), (ActionEvent event) -> primaryStage.close()));
timer.setCycleCount(Timeline.INDEFINITE);
timer.play();
}
ExternalMonitor.java 文件源码
项目:keyboard-light-composer
阅读 24
收藏 0
点赞 0
评论 0
public static Stage getStage(Window owner) {
Stage stage = new Stage();
ResourceBundle resources = ResourceBundle.getBundle("fxml/i18n/klc");
URL location = ExternalMonitor.class.getResource("/fxml/ExternalMonitor.fxml");
FXMLLoader loader = new FXMLLoader(location, resources);
try {
loader.load();
} catch (IOException e) {
throw new RuntimeException(e);
}
stage.setTitle("Server Monitor");
stage.initModality(Modality.NONE);
stage.initStyle(StageStyle.UTILITY);
stage.initOwner(owner);
stage.setScene(new Scene(loader.getRoot()));
return stage;
}
UIUtils.java 文件源码
项目:ChessBot
阅读 27
收藏 0
点赞 0
评论 0
public static void alwaysInTop(Alert alert) {
try{
DialogPane root = alert.getDialogPane();
Stage dialogStage = new Stage(StageStyle.UTILITY);
for (ButtonType buttonType : root.getButtonTypes()) {
ButtonBase button = (ButtonBase) root.lookupButton(buttonType);
button.setOnAction(evt -> {
root.setUserData(buttonType);
dialogStage.close();
});
}
root.getScene().setRoot(new Group());
Scene scene = new Scene(root);
dialogStage.setScene(scene);
dialogStage.initModality(Modality.APPLICATION_MODAL);
dialogStage.setAlwaysOnTop(true);
dialogStage.setResizable(false);
dialogStage.showAndWait();
}catch(Exception e){
}
// Optional<ButtonType> result = Optional.ofNullable((ButtonType) root.getUserData());
}
SpecificationTableView.java 文件源码
项目:stvs
阅读 18
收藏 0
点赞 0
评论 0
private void showInDialog(javafx.event.ActionEvent event) {
//("SpecificationTableView.SpecificationTableView");
Stage s = new Stage(StageStyle.DECORATED);
s.setTitle(getText());
s.initModality(Modality.APPLICATION_MODAL);
s.setMinHeight(640);
s.setMinHeight(480);
s.setFullScreen(true);
//s.setMaximized(true);
//TableView<HybridRow> newView = new TableView<>(tableView.getItems());
setContent(new Label("opened externally"));
BorderPane root = new BorderPane(tableView);
ButtonBar bb = new ButtonBar();
root.setTop(bb);
s.setScene(new Scene(root));
Button yesButton = new Button("Close");
ButtonBar.setButtonData(yesButton, ButtonBar.ButtonData.CANCEL_CLOSE);
bb.getButtons().addAll(yesButton);
yesButton.setOnAction(e -> s.hide());
s.showAndWait();
setContent(tableView);
}
Alert.java 文件源码
项目:Lernkartei_2017
阅读 27
收藏 0
点赞 0
评论 0
private static Stage buildWindow (String title)
{
tempStage = new Stage();
tempStage.initStyle(StageStyle.UTILITY); // Einfaches Fenster
// ohne 'minimiere'
// und 'maximiere'
// Buttons
tempStage.setResizable(false); // Verbiete �nderung
// der Gr�sse
tempStage.initModality(Modality.APPLICATION_MODAL); // Blockiere alle
// anderen
// Fenster
tempStage.setTitle(title); // Setze Titel
return tempStage;
}
HomeController.java 文件源码
项目:Shield
阅读 26
收藏 0
点赞 0
评论 0
private void createModal(String fxmlRes) throws IOException{
Stage modalLogin = new Stage();
Parent root = FXMLLoader.load(getClass().getResource("/fxml/"+fxmlRes));
Scene scene = new Scene(root);
scene.getStylesheets().add("/styles/Styles.css");
modalLogin.setScene(scene);
modalLogin.initStyle(StageStyle.UNDECORATED);
modalLogin.initOwner(login_btn.getScene().getWindow());
modalLogin.initModality(Modality.APPLICATION_MODAL);
modalLogin.showAndWait();
if(toggle) {
this.toggleControls();
HomeController.refreshMySong();
}
toggle = false;
}
ProgressBarView.java 文件源码
项目:hygene
阅读 22
收藏 0
点赞 0
评论 0
/**
* Create instance of {@link ProgressBarView}.
*/
public ProgressBarView() {
try {
final Stage newStage = new Stage();
newStage.setResizable(false);
final URL resource = getClass().getResource(PROGRESS_BAR_VIEW);
fxmlLoader = new FXMLLoader(resource);
final Stage primaryStage = Hygene.getInstance().getPrimaryStage();
newStage.initOwner(primaryStage);
newStage.initStyle(StageStyle.UTILITY);
newStage.initModality(Modality.APPLICATION_MODAL);
final double centerXPosition = primaryStage.getX() + primaryStage.getWidth() / 2;
final double centerYPosition = primaryStage.getY() + primaryStage.getHeight() / 2;
newStage.setOnShowing(event -> newStage.hide());
newStage.setOnShown(event -> {
newStage.setX(centerXPosition - newStage.getWidth() / 2);
newStage.setY(centerYPosition - newStage.getHeight() / 2);
newStage.show();
});
setStage(newStage);
} catch (final UIInitialisationException e) {
LOGGER.error("Progress bar view could not be loaded.", e);
}
}
HygenePreloader.java 文件源码
项目:hygene
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void start(final Stage primaryStage) throws IOException, UIInitialisationException {
stage = primaryStage;
primaryStage.setTitle(Hygene.TITLE);
primaryStage.initStyle(StageStyle.UNDECORATED);
progress = new ProgressBar();
final URL resource = getClass().getResource(PRELOADER_VIEW);
final Parent root = FXMLLoader.load(resource);
if (root == null) {
throw new UIInitialisationException("Root of Preloader could not be found.");
}
final Scene rootScene = new Scene(root);
primaryStage.setScene(rootScene);
primaryStage.show();
}
GoliathOUFX.java 文件源码
项目:Goliath-Overclocking-Utility-FX
阅读 22
收藏 0
点赞 0
评论 0
@Override
public void start(Stage stage)
{
scene = new Scene(new AppFrame(stage));
scene.getStylesheets().add("skins/Goliath-Magma.css");
stage.setScene(scene);
stage.setTitle("Goliath Overclocking Utility V1.0 Alpha");
stage.initStyle(StageStyle.UNDECORATED);
stage.setResizable(false);
stage.setHeight(368);
stage.setWidth(750);
stage.show();
}
StoreController.java 文件源码
项目:rsam-gui
阅读 42
收藏 0
点赞 0
评论 0
@FXML
private void loadArchiveEditor() {
try {
FXMLLoader loader = new FXMLLoader(App.class.getResource("/ArchiveUI.fxml"));
Parent root = (Parent) loader.load();
ArchiveController controller = (ArchiveController) loader.getController();
Stage stage = new Stage();
controller.setStage(stage);
stage.setTitle("Archive Editor");
Scene scene = new Scene(root);
scene.getStylesheets().add(App.class.getResource("/style.css").toExternalForm());
stage.getIcons().add(new Image(getClass().getResourceAsStream("/icons/app_icon_128.png")));
stage.setScene(scene);
stage.initStyle(StageStyle.TRANSPARENT);
stage.setResizable(false);
stage.centerOnScreen();
stage.setTitle("Archive Editor");
stage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
App.java 文件源码
项目:rsam-gui
阅读 32
收藏 0
点赞 0
评论 0
@Override
public void start(Stage stage) {
App.stage = stage;
try {
FXMLLoader loader = new FXMLLoader(App.class.getResource("/StoreUI.fxml"));
Parent root = (Parent)loader.load();
StoreController controller = (StoreController)loader.getController();
controller.setStage(stage);
Scene scene = new Scene(root);
App.scene = scene;
scene.getStylesheets().add(App.class.getResource("/style.css").toExternalForm());
stage.setScene(scene);
stage.getIcons().add(new Image(getClass().getResourceAsStream("/icons/app_icon_128.png")));
stage.initStyle(StageStyle.TRANSPARENT);
stage.setResizable(false);
stage.centerOnScreen();
stage.setTitle("RS2 Asset Manager");
stage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
SettingsWindow.java 文件源码
项目:LMSGrabber
阅读 21
收藏 0
点赞 0
评论 0
public SettingsWindow(Stage parent) throws IOException {
super(StageStyle.UNDECORATED);
prefs = Preferences.userNodeForPackage(App.class);
// Load root layout from fxml file.
FXMLLoader loader = new FXMLLoader(getClass().getResource("fxml/settings_menu.fxml"));
loader.setController(this);
this.initModality(Modality.WINDOW_MODAL);
this.initOwner(parent);
this.setAlwaysOnTop(true);
TabPane layout = loader.load();
Scene scene2 = new Scene(layout);
this.setScene(scene2);
this.setTitle("LMSGrabber Settings");
min_delay_slider.setValue(prefs.getDouble("min_delay", 1.0));
max_delay_slider.setValue(prefs.getDouble("max_delay", 3.0));
input_proxy.setText(prefs.get("proxy", ""));
multithreaded_check.setSelected(prefs.getBoolean("multithreaded", true));
}
NewTaskWindow.java 文件源码
项目:EMBER
阅读 18
收藏 0
点赞 0
评论 0
/**
* Builds the window and add events.
* @throws IOException
*/
public NewTaskWindow() throws IOException {
super();
FXMLLoader fxmlLoader = new FXMLLoader(
getClass().getResource("/FXML/newTask.fxml"));
Parent root = (Parent) fxmlLoader.load();
taskController
= (NewTaskController) fxmlLoader.getController();
taskController.applyGUIMods();
Scene scene = new Scene(root);
scene.setFill(javafx.scene.paint.Color.TRANSPARENT);
setScene(scene);
setTitle("Add a task");
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.ALT) {
//Using alt key since tab doesn't work
taskController.showDetails();
} else if (keyEvent.getCode() == KeyCode.ESCAPE) {
this.close();
}
});
//Not focusing the window means closing it
focusedProperty().addListener((obs, wasFocused, isNowFocused) -> {
if (!isNowFocused) {
close();
}
});
}
NewTaskListWindow.java 文件源码
项目:EMBER
阅读 26
收藏 0
点赞 0
评论 0
/**
* 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();
}
});
}
ModifyTaskWindow.java 文件源码
项目:EMBER
阅读 16
收藏 0
点赞 0
评论 0
/**
* Builds the window and add events.
* @param oldTask Task to use.
* @throws IOException
*/
public ModifyTaskWindow(Task oldTask)
throws IOException {
super();
FXMLLoader fxmlLoader = new FXMLLoader(
getClass().getResource("/fxml/modifyTask.fxml"));
Parent root = (Parent) fxmlLoader.load();
taskController
= (ModifyTaskController) fxmlLoader.getController();
Scene scene = new Scene(root);
setScene(scene);
setResizable(false);
initStyle(StageStyle.TRANSPARENT);
taskController.fillOldTaskInfos(oldTask);
//After pressing 'Enter', closes this window (which returns the value)
scene.setOnKeyPressed((final KeyEvent keyEvent) -> {
if (null != keyEvent.getCode()) switch (keyEvent.getCode()) {
case ENTER:
this.wantsToAdd = true;
this.close();
break;
case ESCAPE:
this.close();
break;
default:
break;
}
});
//Not focusing the window means closing it
focusedProperty().addListener((obs, wasFocused, isNowFocused) -> {
if (!isNowFocused) {
close();
}
});
}
BaseDialog.java 文件源码
项目:easyMvvmFx
阅读 41
收藏 0
点赞 0
评论 0
private void create(){
mStage = new Stage();
mStage.initModality(Modality.APPLICATION_MODAL);
mStage.initOwner(null);
mStage.initStyle(StageStyle.TRANSPARENT);
mStage.setResizable(false);
viewTuple = createContent();
if(viewTuple.getView() instanceof BaseView){
BaseView view = (BaseView) viewTuple.getView();
view.onDialogSet(this);
root = (Pane) viewTuple.getRoot();
alignCenter(root.getPrefWidth(), root.getPrefHeight());
if(isDragable)
dragDialogAbleNode(root);
}else{
try {
throw new Exception("your view is not a BaseView!");
} catch (Exception e) {
e.printStackTrace();
}
}
mScene = new Scene(viewTuple.getRoot());
// mScene.getStylesheets().setAll(TestinStage.getInstance().getStylesheet());
mStage.setScene(mScene);
}
MineIDEPreloader.java 文件源码
项目:MineIDE
阅读 26
收藏 0
点赞 0
评论 0
@Override
public void start(final Stage primaryStage) throws Exception
{
this.preloaderStage = primaryStage;
final ImageView splash = new ImageView(new Image(Constant.IMG_DIR + "banner.png"));
this.loadProgressPhase = new JFXProgressBar();
this.loadProgressPhase.setPrefWidth(Constant.SPLASH_WIDTH);
this.splashLayout = new VBox();
this.splashLayout.getChildren().addAll(splash, this.loadProgressPhase);
this.splashLayout.setStyle("-fx-padding: 5; " + "-fx-background-color: gainsboro; " + "-fx-border-width:2; "
+ "-fx-border-color: " + "linear-gradient(" + "to bottom, " + "MediumSeaGreen, "
+ "derive(MediumSeaGreen, 50%)" + ");");
this.splashLayout.setEffect(new DropShadow());
final Scene splashScene = new Scene(this.splashLayout, Color.TRANSPARENT);
final Rectangle2D bounds = Screen.getPrimary().getBounds();
primaryStage.setScene(splashScene);
primaryStage.setX(bounds.getMinX() + bounds.getWidth() / 2 - Constant.SPLASH_WIDTH / 2);
primaryStage.setY(bounds.getMinY() + bounds.getHeight() / 2 - Constant.SPLASH_HEIGHT / 2);
primaryStage.getIcons().add(new Image(Constant.IMG_DIR + "icon.png"));
primaryStage.setTitle(Constant.APP_NAME);
primaryStage.initStyle(StageStyle.UNDECORATED);
primaryStage.setAlwaysOnTop(true);
primaryStage.show();
}
MineIDE.java 文件源码
项目:MineIDE
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void start(final Stage primaryStage) throws Exception
{
MineIDE.primaryStage = new Stage(StageStyle.DECORATED);
MineIDE.primaryStage.getIcons().add(new Image(Constant.IMG_DIR + "icon.png"));
MineIDE.primaryStage.setTitle(Constant.APP_NAME);
// stage.setTitle(Gui.mineIdeInfo.getAppName() + " v" +
// Gui.mineIdeInfo.getAppVersion() + " " + "Forge "
// + Gui.mineIdeInfo.getForgeVersion());
final GuiMain main = GuiMain.getInstance();
main.init();
main.setOldPreferences();
// MineIDE.primaryStage.setMaximized(true);
main.show(MineIDE.primaryStage);
}
DataImportDialog.java 文件源码
项目:TechnicalAnalysisTool
阅读 19
收藏 0
点赞 0
评论 0
public DataImportDialog(Window owner, FinancialMarket fm, TatConfig config) {
super();
this.fm = fm;
this.config = config;
setResizable(false);
initStyle(StageStyle.DECORATED);
initOwner(owner);
setTitle("Financial Market Import");
initModality(Modality.APPLICATION_MODAL);
Image appIcon = new Image("icon/IMPORT_MARKET_DATA.png");
getIcons().add(appIcon);
root = new Group();
Scene scene = new Scene(root, 500, 440, Color.WHITE);
ImagePattern pattern = new ImagePattern(new Image("icon/bk5.jpg"));
scene.setFill(pattern);
setScene(scene);
initGui();
//Add listener to exit when press Esc key
addEventHandler(KeyEvent.KEY_PRESSED, (KeyEvent event) -> {
if (KeyCode.ESCAPE == event.getCode()) {
DataImportDialog.this.close();
}
if (KeyCode.ENTER == event.getCode()) {
doImport();
}
});
setX(owner.getX() + Math.abs(owner.getWidth() - scene.getWidth()) / 2.0);
setY(owner.getY() + Math.abs(owner.getHeight() - scene.getHeight()) / 2.0);
}
PaymentController.java 文件源码
项目:CNU_TermProject_SoftwareEngineering
阅读 34
收藏 0
点赞 0
评论 0
private Dialog getPayProgressDialog() {
try {
FXMLLoader loader = new FXMLLoader(
getClass().getResource("/View/PayProgress.fxml")
);
Parent root = loader.load();
dialog = new Dialog();
dialog.setResizable(false);
dialog.setDialogPane((DialogPane) root);
dialog.initOwner(owner);
dialog.initModality(Modality.WINDOW_MODAL);
dialog.initStyle(StageStyle.UTILITY);
} catch (IOException e) {
System.out.println("Unable to load dialog FXML");
e.printStackTrace();
}
return dialog;
}
MainDisplay.java 文件源码
项目:SnapDup
阅读 25
收藏 0
点赞 0
评论 0
@FXML
private void btnDeleteAction()
{
try
{
FXMLLoader loader = new FXMLLoader(MainDisplay.class.getResource("/fxml/DeleteResultDialog.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root);
Stage stage = new Stage();
stage.initModality(Modality.APPLICATION_MODAL);
stage.initStyle(StageStyle.UNDECORATED);
stage.setScene(scene);
stage.show();
Node node = scene.lookup("#txtArea");
if(node instanceof TextArea)
{
TextArea textArea = (TextArea)node;
DeleteTask task = new DeleteTask(dataContainer);
textArea.textProperty().bind(task.valueProperty());
Thread th = new Thread(task);
th.setDaemon(true);
th.start();
}
else
throw new IOException("Unable to find \"TextArea\" node");
}
catch(IOException e)
{
e.printStackTrace();
}
}
MainDisplay.java 文件源码
项目:SnapDup
阅读 27
收藏 0
点赞 0
评论 0
@FXML
private void btnMapDevicesAction()
{
try
{
FXMLLoader loader = new FXMLLoader(MainDisplay.class.getResource("/fxml/MapDevicesDialog.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root);
Stage stage = new Stage();
stage.initModality(Modality.APPLICATION_MODAL);
stage.initStyle(StageStyle.UNDECORATED);
stage.setScene(scene);
stage.show();
Node node = scene.lookup("#tblMapDevice");
if(node instanceof TableView)
{
TableView<Pair<String, String>> table = (TableView)node;
ArrayList<Pair<String, String>> pairList = new ArrayList<>();
dataContainer.getDeviceMap().entrySet().forEach(entry -> pairList.add(new Pair<String, String>(entry.getKey(), entry.getValue())));
ObservableList<Pair<String, String>> tableModel = FXCollections.<Pair<String, String>> observableArrayList(pairList);
table.setItems(tableModel);
}
}
catch(IOException e)
{
e.printStackTrace();
}
}