use of easik.model.states.BasicEditingState in project fql by CategoricalData.
the class SketchFrame method closeWindow.
/**
* Trys to close window as long it is not dirty.
*/
@Override
public void closeWindow() {
// We're exiting, so update the width/height of the main window, and
// save the settings
_settings.setProperty("sketch_display_width", String.valueOf(getWidth()));
_settings.setProperty("sketch_display_height", String.valueOf(getHeight()));
_settings.setProperty("sketch_divider_position", String.valueOf(_mainSplitPane.getDividerLocation()));
_settings.setProperty("sketch_frame_location_x", String.valueOf(getX()));
_settings.setProperty("sketch_frame_location_y", String.valueOf(getY()));
_settings.store();
// Refresh displayed thumbnail
_ourSketch.clearSelection();
_ourSketch.getOverview().refreshAll();
final ModelStateManager<SketchFrame, SketchGraphModel, Sketch, EntityNode, SketchEdge> stateManager = _ourSketch.getStateManager();
final SketchGraphModel sgm = _ourSketch.getGraphModel();
while (sgm.inInsignificantUpdate()) {
sgm.cancelInsignificantUpdate();
}
while (!(stateManager.peekState() instanceof BasicEditingState)) {
stateManager.popState();
}
setVisible(false);
}
Aggregations