Skip to content

Instantly share code, notes, and snippets.

@NotArchon
Created August 20, 2022 19:24
Show Gist options
  • Save NotArchon/95a0b35d4f6fbad67a3a41722600be5d to your computer and use it in GitHub Desktop.
Save NotArchon/95a0b35d4f6fbad67a3a41722600be5d to your computer and use it in GitHub Desktop.
package com.discrypto.client.screens.main;
import com.discrypto.client.Client;
import com.discrypto.client.scenes.StrategyScene;
import com.discrypto.client.screens.Screen;
import javafx.scene.input.MouseButton;
import javafx.stage.Modality;
public class StrategyScreen extends Screen<StrategyScene> {
public final StrategyListScreen listScreen;
public StrategyScreen(StrategyListScreen listScreen) {
super(
"Discrpyto Trading Bot | Viewing Strategy",
"strategy",
new StrategyScene()
);
this.listScreen = listScreen;
}
@Override
public void beforeShow() {
stage.setResizable(false);
stage.initOwner(listScreen.stage);
stage.initModality(Modality.APPLICATION_MODAL);
//stage.setOnCloseRequest(e -> listScreen.controller.pane.setDisable(false));
//listScreen.controller.pane.setDisable(true);
listScreen.stage.hide();
stage.setOnCloseRequest(e -> listScreen.stage.show());
}
@Override
public void afterShow() {
controller.backtest_button.setOnMouseClicked(e -> {
if(e.getButton() == MouseButton.PRIMARY)
Client.openScreen(new StrategyBacktestScreen(this));
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment