use of easik.overview.Overview in project fql by CategoricalData.
the class DocumentInfo method setAllInfo.
/**
* Sets all editable information, with the parameters determined by the
* user. If any parameters have been changed, the sketch is set to dirty so
* user will be prompted for a save if an attempt to discard the current
* sketch is made before a save. If a name change results in a conflict, we
* add numbers. If no name is specified, we keep the old name.
*
* @param name
* The name of the sketch
* @param author
* The string of all authors of the sketch
* @param desc
* The description of the sketch
*/
public void setAllInfo(String name, String author, String desc) {
name = name.trim();
if (!_name.equals(name) || !getAuthorString().equals(author) || !_desc.equals(desc)) {
Overview overview = _theFrame.getOverview();
if (_theFrame instanceof SketchFrame) {
((SketchFrame) _theFrame).getNode().setName(name);
((SketchFrame) _theFrame).getMModel().setDirty();
} else if (_theFrame instanceof ViewFrame) {
((ViewFrame) _theFrame).getNode().setName(name);
((ViewFrame) _theFrame).getMModel().setDirty();
} else {
// The Sketch and View setDirty()'s
overview.setDirty(true);
// will make this happen anyway
}
if (!name.equals("")) {
setName(name);
}
_authors = new ArrayList<>();
for (String aut : author.split(",")) {
aut = aut.trim();
if (!aut.equals("")) {
_authors.add(aut);
}
}
_desc = desc;
}
}
use of easik.overview.Overview in project fql by CategoricalData.
the class SketchNode method setName.
/**
* Changes the ViewNode's name. Also updates the name in the Overview. The
* actual name, if it already exists, might have a number added and/or
* incremented.
*
* @param name
* the new name (which might be incremented)
*/
@Override
public void setName(String name) {
// incrementation
if ((_name == null) || !_name.equals(name)) {
Overview ov = _theFrame.getMModel().getOverview();
String oldName = _name;
// update node mapping in overview
name = ov.sketchRenamed(this, oldName, name);
// update node name in its document info
_theFrame.getMModel().getDocInfo().setName(name);
// update name stored here
_name = name;
}
}
use of easik.overview.Overview in project fql by CategoricalData.
the class ViewNode method setName.
/**
* Changes the ViewNode's name. Also updates the name in the Overview. The
* actual name, if it already exists, might have a number added and/or
* incremented.
*
* @param name
* the new name (which might be incremented)
*/
@Override
public void setName(String name) {
// incrementation
if (_name != name) {
Overview ov = _theFrame.getMModel().getOverview();
String oldName = _name;
// update node mapping in overview
name = ov.viewRenamed(this, oldName, name);
// update node name in its document info
_theFrame.getMModel().getDocInfo().setName(name);
// update name stored here
_name = name;
}
}
use of easik.overview.Overview in project fql by CategoricalData.
the class FileSaveAction method saveFile.
/**
* @param inFrame
* @param selFile
*
* @return
*/
public static boolean saveFile(ApplicationFrame inFrame, File selFile) {
Overview overview = inFrame.getOverview();
overview.getDocInfo().updateModificationDate();
overview.saveToXML(selFile);
overview.setFile(selFile);
overview.setDirty(false);
Easik.getInstance().getSettings().addRecentFile(selFile);
inFrame.updateRecentFilesMenu();
return true;
}
use of easik.overview.Overview in project fql by CategoricalData.
the class FileSaveAsAction method saveFileAs.
/**
* Prompts for a filename and saves the overview as that name. Returns true
* if the file was successfully saved, false if not (i.e. because the user
* cancelled).
*
* @param inFrame
*
* @return
*/
public static boolean saveFileAs(ApplicationFrame inFrame) {
@SuppressWarnings("unused") Overview overview = inFrame.getOverview();
File selFile = FileChooser.saveFile("Save EASIK Sketch", FileFilter.EASIK, "easik");
if (selFile != null) {
return FileSaveAction.saveFile(inFrame, selFile);
}
return false;
}
Aggregations