use of blue.projects.BlueProject in project blue by kunstmusik.
the class NewProjectAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
final BlueProjectManager blueProjectManager = BlueProjectManager.getInstance();
BlueProject project = BlueProjectManager.createNewProject();
blueProjectManager.setCurrentProject(project);
}
use of blue.projects.BlueProject in project blue by kunstmusik.
the class BackupFileSaver method saveFileBackups.
private void saveFileBackups() {
for (int i = 0; i < projectManager.getNumProjects(); i++) {
BlueProject bdf = projectManager.getProject(i);
if (bdf.getDataFile() != null && !bdf.isOpenedFromTempFile()) {
if (bdf.getTempFile() == null) {
bdf.setTempFile(new File(bdf.getDataFile().getAbsolutePath() + "~"));
}
try {
try (PrintWriter out = new PrintWriter(new FileWriter(bdf.getTempFile()))) {
out.print(bdf.getData().saveAsXML().toString());
out.flush();
}
} catch (IOException ioe) {
// String errorMessage = BlueSystem
// .getString("message.file.couldNotSave")
// + "\n\n" + ioe.getLocalizedMessage();
// JOptionPane.showMessageDialog(null, errorMessage,
// BlueSystem
// .getString("message.error"),
// JOptionPane.ERROR_MESSAGE);
// StatusBar.updateStatus(BlueSystem
// .getString("message.file.couldNotSave")
// + " - " + ioe.getLocalizedMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
use of blue.projects.BlueProject in project blue by kunstmusik.
the class TempFileCleaner method propertyChange.
@Override
public void propertyChange(PropertyChangeEvent evt) {
BlueProjectManager bpm = BlueProjectManager.getInstance();
BlueProject currentProject = bpm.getCurrentProject();
if (currentProject.isTempCsdFilesChecked()) {
return;
}
currentProject.setTempCsdFilesChecked(true);
File curProjFile = currentProject.getDataFile();
if (curProjFile == null) {
return;
}
File parentProjDir = curProjFile.getParentFile();
int size = bpm.getNumProjects();
boolean otherOpenProjectsFound = false;
for (int i = 0; i < size; i++) {
BlueProject project = bpm.getProject(i);
if (project != currentProject) {
if (project.getDataFile() != null) {
File parentDir = project.getDataFile().getParentFile();
if (parentDir.equals(parentProjDir)) {
otherOpenProjectsFound = true;
break;
}
}
}
}
if (otherOpenProjectsFound) {
return;
}
File[] tempFiles = parentProjDir.listFiles((File dir, String name) -> name.startsWith("tempCsd") && name.endsWith(".csd"));
if (tempFiles.length > 0) {
int retVal = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), "Temporary CSD files were found. These are " + "probably from a previous Blue session that crashed. Would you like to " + "delete these?", "Temp CSD Files Found", JOptionPane.YES_NO_OPTION);
if (retVal == JOptionPane.YES_OPTION) {
deleteTempFiles(tempFiles);
}
}
}
use of blue.projects.BlueProject in project blue by kunstmusik.
the class BlueLiveTopComponent method reinitialize.
private void reinitialize() {
this.data = null;
this.compileData = CompileData.createEmptyCompileData();
BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
BlueData currentData = null;
if (project != null) {
currentData = project.getData();
}
if (currentData != null) {
LiveData liveData = currentData.getLiveData();
this.liveObjectsTable.setAutoCreateColumnsFromModel(true);
model.setLiveObjectBins(liveData.getLiveObjectBins());
setModel.setLiveObjectSetList(liveData.getLiveObjectSets());
this.liveObjectsTable.setModel(model);
this.liveObjectSetListTable.setModel(setModel);
this.commandLineText.setText(liveData.getCommandLine());
this.enableAdvancedFlags.setSelected(liveData.isCommandLineEnabled());
this.completeOverride.setSelected(liveData.isCommandLineOverride());
this.repeatButton.setSelected(liveData.isRepeatEnabled());
commandLineText.setEnabled(liveData.isCommandLineEnabled());
// liveObjectsTable.getColumnModel().getColumn(2).setMaxWidth(100);
// liveObjectsTable.getColumnModel().getColumn(2).setMinWidth(100);
// liveObjectsTable.getColumnModel().getColumn(2).setWidth(100);
// csoundCommand.setText(data.getLiveData().getCommandLine());
// liveSpace.setLiveObjects(data.getLiveData().getLiveSoundObjects());
repeatSpinner.setValue(liveData.getRepeat());
tempoSpinner.setValue(liveData.getTempo());
liveCodeEditor.setText(liveData.getLiveCodeText());
this.data = currentData;
this.repaint();
}
}
use of blue.projects.BlueProject in project blue by kunstmusik.
the class OrchestraTopComponent method reinitialize.
private void reinitialize() {
BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
if (project == null) {
instrumentEditPanel1.editInstrument(null);
arrangementPanel.setMixer(null);
arrangementPanel.setArrangement(null);
} else {
instrumentEditPanel1.editInstrument(null);
arrangementPanel.setMixer(project.getData().getMixer());
arrangementPanel.setArrangement(project.getData().getArrangement());
}
}
Aggregations