Пример #1
0
 private void handleAction() {
   if (xmlLoader.getValue() != null) {
     AbstractGrid newScreen =
         ConfigManager.getAbstractGrid(
             ConfigManager.getString(
                 ConfigManager.scope(this.getClass().getName(), selected.iconName)),
             xmlLoader.getValue());
     nextScreen = newScreen;
   } else {
     Alert uhoh = new Alert(AlertType.ERROR);
     uhoh.setTitle("whoops");
     uhoh.setContentText("please select an XML file");
     uhoh.showAndWait();
   }
 }
Пример #2
0
 private Icon(String s, int xOffset, int numberOfIcons) {
   xmlList = ConfigManager.getStringList(ConfigManager.scope(s, "xmlList"));
   Image img =
       new Image(
           getClass()
               .getClassLoader()
               .getResourceAsStream(ConfigManager.getString(ConfigManager.scope(s, "image"))));
   image = new ImageView(img);
   image.setFitWidth(WIDTH / (numberOfIcons * 3 / 2));
   image.setPreserveRatio(true);
   image.setSmooth(true);
   image.setCache(true);
   setGraphic(image);
   setLayoutY(
       ConfigManager.getInt(ConfigManager.scope(this.getClass().getName(), "yPos"), HEIGHT / 3));
   setLayoutX(xOffset - (image.getBoundsInParent().getWidth() + 18) / 2);
   iconName = s;
 }