use of com.kotcrab.vis.ui.widget.file.FileChooserAdapter in project gdx-graph by MarcinSc.
the class LibgdxGraphScreen method exportShader.
private void exportShader() {
FileChooser fileChooser = new FileChooser(FileChooser.Mode.SAVE);
fileChooser.setModal(true);
fileChooser.setSelectionMode(FileChooser.SelectionMode.FILES);
fileChooser.setListener(new FileChooserAdapter() {
@Override
public void selected(Array<FileHandle> file) {
FileHandle selectedFile = file.get(0);
if (!selectedFile.name().toLowerCase().endsWith(".json")) {
selectedFile = selectedFile.parent().child(selectedFile.name() + ".json");
}
writeGraph(selectedFile, ((GraphDesignTab) tabbedPane.getActiveTab()).serializeGraph());
}
});
getStage().addActor(fileChooser.fadeIn());
}
use of com.kotcrab.vis.ui.widget.file.FileChooserAdapter in project gdx-graph by MarcinSc.
the class LibgdxGraphScreen method saveAs.
private void saveAs() {
FileChooser fileChooser = new FileChooser(FileChooser.Mode.SAVE);
fileChooser.setModal(true);
fileChooser.setSelectionMode(FileChooser.SelectionMode.FILES);
fileChooser.setListener(new FileChooserAdapter() {
@Override
public void selected(Array<FileHandle> file) {
FileHandle selectedFile = file.get(0);
if (!selectedFile.name().toLowerCase().endsWith(".json")) {
selectedFile = selectedFile.parent().child(selectedFile.name() + ".json");
}
editedFile = selectedFile;
saveToFile(graphDesignTab, selectedFile);
}
});
getStage().addActor(fileChooser.fadeIn());
}
use of com.kotcrab.vis.ui.widget.file.FileChooserAdapter in project gdx-graph by MarcinSc.
the class LibgdxGraphScreen method open.
private void open() {
if (graphDesignTab != null && graphDesignTab.isDirty()) {
Dialogs.showErrorDialog(getStage(), "Current pipeline has been modified, close it or save it");
} else {
removeAllTabs();
FileChooser fileChooser = new FileChooser(FileChooser.Mode.OPEN);
fileChooser.setModal(true);
fileChooser.setSelectionMode(FileChooser.SelectionMode.FILES);
fileChooser.setListener(new FileChooserAdapter() {
@Override
public void selected(Array<FileHandle> file) {
FileHandle selectedFile = file.get(0);
loadPipelineFromFile(selectedFile);
editedFile = selectedFile;
graphDesignTab.setDirty(false);
}
});
getStage().addActor(fileChooser.fadeIn());
}
}
use of com.kotcrab.vis.ui.widget.file.FileChooserAdapter in project talos by rockbite.
the class BatchConvertDialog method showFolderSelect.
private void showFolderSelect(final TextField pathField) {
fileChooser.setMode(FileChooser.Mode.OPEN);
fileChooser.setMultiSelectionEnabled(false);
fileChooser.setSelectionMode(FileChooser.SelectionMode.DIRECTORIES);
fileChooser.setListener(new FileChooserAdapter() {
@Override
public void selected(Array<FileHandle> file) {
pathField.setText(file.get(0).path());
}
});
getStage().addActor(fileChooser.fadeIn());
}
use of com.kotcrab.vis.ui.widget.file.FileChooserAdapter in project talos by rockbite.
the class NewProjectDialog method showFolderSelect.
private void showFolderSelect() {
fileChooser.setMode(FileChooser.Mode.OPEN);
fileChooser.setMultiSelectionEnabled(false);
fileChooser.setSelectionMode(FileChooser.SelectionMode.DIRECTORIES);
fileChooser.setListener(new FileChooserAdapter() {
@Override
public void selected(Array<FileHandle> file) {
parentPathField.setText(file.get(0).path());
}
});
getStage().addActor(fileChooser.fadeIn());
}
Aggregations