private void setBg(int change) { int tmp = cbg + change; if (tmp >= 0 && tmp < this.bgs.size() && this.bgs.size() > 0) { cbg += change; GenericElement bg = this.bgs.get(cbg); bgName.setText((String) bg.getAttr("name").getValue()); // validate if the picture already exist try { bgGC.setFill(Color.WHITE); bgGC.fillRect(0, 0, 200, 200); bgGC.drawImage( new Image(new File((String) bg.getAttr("picture").getValue()).toURI().toString()), 0, 0, 200, 200); } catch (Exception npe) { npe.printStackTrace(); } } }
private void setDg(int change) { int tmp = cdg + change; if (tmp >= 0 && tmp < this.designs.size() && this.designs.size() > 0) { cdg += change; GenericElement dg = this.designs.get(cdg); dgName.setText((String) dg.getAttr("name").getValue()); dgType.setText((String) dg.getAttr("type").getValue()); if (dg.getAttr("destroy") != null) { dgCredits.setText(dg.getAttr("destroy").getValue().toString()); } else { dgCredits.setText(""); } if (dg.getAttr("credits") != null) { dgDestroy.setText(dg.getAttr("credits").getValue().toString()); } else { dgDestroy.setText(""); } try { dgGC.setFill(Color.WHITE); dgGC.fillRect(0, 0, 200, 200); dgGC.drawImage( new Image(new File((String) dg.getAttr("picture").getValue()).toURI().toString()), 0, 0, 200, 200); } catch (Exception npe) { npe.printStackTrace(); } } }
private void setFg(int change) { int tmp = cfg + change; if (tmp >= 0 && tmp < this.figures.size() && this.figures.size() > 0) { cfg += change; GenericElement fg = this.figures.get(cfg); fgName.setText((String) fg.getAttr("name").getValue()); fgLive.setText(fg.getAttr("live").getValue().toString()); fgType.setText((String) fg.getAttr("type").getValue()); fgDestroy.setText(fg.getAttr("destroy").getValue().toString()); fgDescription.setText((String) fg.getAttr("description").getValue()); // validate if the picture already exist try { fgGC.setFill(Color.WHITE); fgGC.fillRect(0, 0, 200, 200); fgGC.drawImage( new Image(new File((String) fg.getAttr("picture").getValue()).toURI().toString()), 0, 0, 200, 200); } catch (Exception npe) { npe.printStackTrace(); } } }