static Logger logger = LoggerFactory.getLogger(MonitorMain.class);
@Override
public void start(final Stage primaryStage) { //Stage = window
ApplicationContext applicationContext = new ApplicationContext();
primaryStage.titleProperty().bind(new SimpleStringProperty("Copper Monitor (server: ").concat(applicationContext.serverAdressProperty().concat(")")));
new Button(); // Trigger loading of default stylesheet
final Scene scene = new Scene(applicationContext.getMainPane(), 1300, 900, Color.WHEAT);
scene.getStylesheets().add(this.getClass().getResource("/de/scoopgmbh/copper/gui/css/base.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
//"--name=value".
Map<String, String> parameter = getParameters().getNamed();
String monitorServerAdress = parameter.get("monitorServerAdress");
String monitorServerUser = parameter.get("monitorServerUser");
String monitorServerPassword = parameter.get("monitorServerPassword");
if (!Strings.isNullOrEmpty(monitorServerAdress)){
applicationContext.setHttpGuiCopperDataProvider(monitorServerAdress,monitorServerUser,monitorServerPassword);
} else {
applicationContext.createLoginForm().show();
}
// new Thread(){
// {
// setDaemon(true);