Search in sources :

Example 1 with BasicEditingState

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);
}
Also used : SketchEdge(easik.sketch.edge.SketchEdge) BasicEditingState(easik.model.states.BasicEditingState) Sketch(easik.sketch.Sketch) SketchGraphModel(easik.sketch.util.graph.SketchGraphModel) EntityNode(easik.sketch.vertex.EntityNode)

Aggregations

BasicEditingState (easik.model.states.BasicEditingState)1 Sketch (easik.sketch.Sketch)1 SketchEdge (easik.sketch.edge.SketchEdge)1 SketchGraphModel (easik.sketch.util.graph.SketchGraphModel)1 EntityNode (easik.sketch.vertex.EntityNode)1