protected void updateHistoryIndexSceneSetUpSync() { org.lgna.croquet.undo.UndoHistory history = this.getProjectHistory(); if (history != null) { this.projectHistoryIndexSceneSetUp = history.getInsertionIndex(); } else { this.projectHistoryIndexSceneSetUp = PROJECT_HISTORY_INDEX_IF_PROJECT_HISTORY_IS_NULL; } }
protected boolean isProjectUpToDateWithSceneSetUp() { org.lgna.croquet.undo.UndoHistory history = this.getProjectHistory(); if (history == null) { return true; } else { return this.projectHistoryIndexSceneSetUp == history.getInsertionIndex(); } }
protected void handleInsertionIndexChanged( org.lgna.croquet.undo.event.HistoryInsertionIndexEvent e) { this.updateTitle(); org.lgna.croquet.undo.UndoHistory source = e.getTypedSource(); if (source.getGroup() == PROJECT_GROUP) { this.updateUndoRedoEnabled(); } }
public boolean isProjectUpToDateWithFile() { org.lgna.croquet.undo.UndoHistory history = this.getProjectHistory(); if (history == null) { return true; } else { if (this.frozenProjectHistoryIndexFile == null) { return this.projectHistoryIndexFile == history.getInsertionIndex(); } else { return this.frozenProjectHistoryIndexFile; } } }
/* <lg> */ public /* </lg> */ void updateUndoRedoEnabled() { org.lgna.croquet.undo.UndoHistory historyManager = this.getProjectHistory(org.lgna.croquet.Application.PROJECT_GROUP); boolean isUndoEnabled; boolean isRedoEnabled; if (historyManager != null) { int index = historyManager.getInsertionIndex(); int size = historyManager.getStack().size(); isUndoEnabled = index > 0; isRedoEnabled = index < size; } else { isUndoEnabled = false; isRedoEnabled = false; } ProjectDocumentFrame documentFrame = this.getDocumentFrame(); documentFrame.getUndoOperation().setEnabled(isUndoEnabled); documentFrame.getRedoOperation().setEnabled(isRedoEnabled); }