public synchronized void setMemento(Object o) { if (o instanceof JidgetMemento) { JidgetMemento m = (JidgetMemento) o; memento.x = m.x; memento.y = m.y; if (frame != null) { frame.setLocation(m.x, m.y); } } }
private synchronized void asyncInitFrame() { if (active) { Scene scene = new Scene(root); scene.setFill(Color.TRANSPARENT); for (File f : styles) { scene.getStylesheets().add(f.toURI().toString()); } styles = null; this.frame = FrameFactory.create(scene); double x = Double.isNaN(memento.x) ? frame.getX() : memento.x; double y = Double.isNaN(memento.y) ? frame.getY() : memento.y; frame.setLocation(x, y); } }