Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/java/edu/jhuapl/trinity/AppAsyncManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,8 @@ else if (null != projections3DPane.latestUmap)
}
if (null != originalFC.getDimensionLabels()) {
projectedFC.setDimensionLabels(originalFC.getDimensionLabels());
projections3DPane.setDimensionLabels(originalFC.getDimensionLabels());
//@SMP Projections are of a lower embedding and so labels are not meaningfl
//projections3DPane.setDimensionLabels(originalFC.getDimensionLabels());
}
projections3DPane.setHyperDimensionFeatures(originalFC);
projections3DPane.addFeatureCollection(projectedFC, false);
Expand All @@ -964,7 +965,8 @@ else if (null != projections3DPane.latestUmap)
}
if (null != originalFC.getDimensionLabels()) {
projectedFC.setDimensionLabels(originalFC.getDimensionLabels());
projections3DPane.setDimensionLabels(originalFC.getDimensionLabels());
//@SMP Projections are of a lower embedding and so labels are not meaningfl
//projections3DPane.setDimensionLabels(originalFC.getDimensionLabels());
}
projections3DPane.setHyperDimensionFeatures(originalFC);
projections3DPane.addFeatureCollection(projectedFC, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javafx.geometry.Bounds;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.SnapshotParameters;
Expand Down Expand Up @@ -110,12 +111,14 @@ public class ExportMicroToolbar {
private Border hoverBorder;
private Border pinnedBorder;

File latestDirectory = new File(".");

public ExportMicroToolbar(
Pane titleBarParent,
Node chromeNode,
Node contentNode,
Node contextTarget,
javafx.scene.Scene scene,
Scene scene,
double iconFitWidth
) {
this.titleBarParent = Objects.requireNonNull(titleBarParent);
Expand Down Expand Up @@ -474,9 +477,12 @@ private void saveSnapshotToFile() {
FileChooser fc = new FileChooser();
fc.getExtensionFilters().add(new FileChooser.ExtensionFilter("PNG Image", "*.png"));
fc.setInitialFileName("snapshot_content-" + exportScale + "x.png");
fc.setInitialDirectory(latestDirectory);
File f = fc.showSaveDialog(scene.getWindow());
if (f == null) return;
try {
if (f.getParentFile().isDirectory())
latestDirectory = f.getParentFile();
BufferedImage bi = SwingFXUtils.fromFXImage(wi, null);
ImageIO.write(bi, "png", f);
toast("Saved: " + f.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void handleCyberReport(FeatureVectorEvent event) {
Platform.runLater(() -> {
App.getAppScene().getRoot().fireEvent(
new FeatureVectorEvent(
FeatureVectorEvent.NEW_FEATURE_COLLECTION, fc));
FeatureVectorEvent.NEW_FEATURE_COLLECTION, fc, event.object2));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,6 @@ protected Void call() throws Exception {
if (end >= queueLimit) {
start = end - queueLimit;
}

featureCollection.getFeatures().subList(start, end)
.stream().forEach(featureVector -> {
//fail safe to gaurantee 3 dimensions
Expand Down Expand Up @@ -1950,6 +1949,8 @@ protected Void call() throws Exception {
}
};
task.setOnFailed(e -> {
//@DEBUG SMP useful print
//System.out.println(task.getException().getMessage());
Platform.runLater(() -> {
ProgressStatus ps = new ProgressStatus("Error Adding FeatureCollection.", -1);
getScene().getRoot().fireEvent(
Expand All @@ -1964,9 +1965,12 @@ protected Void call() throws Exception {
}

public void updateMaxAndMeans() {
meanVector = FeatureVector.getMeanVector(featureVectors);
maxAbsValue = FeatureVector.getMaxAbsValue(featureVectors);
meanCenteredMaxAbsValue = FeatureVector.getMeanCenteredMaxAbsValue(featureVectors, meanVector);
// Snapshot the list at call time to avoid ConcurrentModificationException
final List<FeatureVector> snapshot = List.copyOf(featureVectors);
if (snapshot.isEmpty()) return;
meanVector = FeatureVector.getMeanVector(snapshot);
maxAbsValue = FeatureVector.getMaxAbsValue(snapshot);
meanCenteredMaxAbsValue = FeatureVector.getMeanCenteredMaxAbsValue(snapshot, meanVector);

String str = "Mean Centered MaxAbsValue: " + meanCenteredMaxAbsValue;
cubeWorld.meanVector.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1578,9 +1578,11 @@ private void updateDataColors() {
sphereToFeatureVectorMap.forEach((s, fv) -> {
if (null != fv.getLabel()) {
FactorLabel fl = FactorLabel.getFactorLabel(fv.getLabel());
s.setVisible(fl.getVisible());
((PhongMaterial) s.getMaterial()).setDiffuseColor(fl.getColor());
((PhongMaterial) s.getMaterial()).setSpecularColor(fl.getColor());
if (null != fl) {
s.setVisible(fl.getVisible());
((PhongMaterial) s.getMaterial()).setDiffuseColor(fl.getColor());
((PhongMaterial) s.getMaterial()).setSpecularColor(fl.getColor());
}
}
});
}
Expand Down Expand Up @@ -2609,7 +2611,8 @@ public Group getManifoldViews() {

@Override
public void setDimensionLabels(List<String> labelStrings) {
featureLabels = labelStrings;
//featureLabels = labelStrings;
//need to override... projections should not have specific labels.
}

public void setHyperDimensionFeatures(FeatureCollection originalFC) {
Expand All @@ -2624,7 +2627,8 @@ public void projectFeatureCollection(FeatureCollection originalFC, PCAConfig con
setHyperDimensionFeatures(originalFC);
fc = (FeatureCollection) task.get();
if (null != originalFC.getDimensionLabels()) {
setDimensionLabels(originalFC.getDimensionLabels());
//@SMP Projections are of a lower embedding and so labels are not meaningfl
//setDimensionLabels(originalFC.getDimensionLabels());
fc.setDimensionLabels(originalFC.getDimensionLabels());
}
addFeatureCollection(fc, false);
Expand Down Expand Up @@ -2742,7 +2746,8 @@ public void projectFeatureCollection(FeatureCollection originalFC,
setHyperDimensionFeatures(originalFC);
fc = (FeatureCollection) task.get();
if (null != originalFC.getDimensionLabels()) {
setDimensionLabels(originalFC.getDimensionLabels());
//@SMP Projections are of a lower embedding and so labels are not meaningfl
//setDimensionLabels(originalFC.getDimensionLabels());
fc.setDimensionLabels(originalFC.getDimensionLabels());
}
addFeatureCollection(fc, false);
Expand All @@ -2765,7 +2770,8 @@ public void projectFeatureCollection(FeatureCollection originalFC, Umap umap) {
setHyperDimensionFeatures(originalFC);
fc = (FeatureCollection) task.get();
if (null != originalFC.getDimensionLabels()) {
setDimensionLabels(originalFC.getDimensionLabels());
//@SMP Projections are of a lower embedding and so labels are not meaningfl
//setDimensionLabels(originalFC.getDimensionLabels());
fc.setDimensionLabels(originalFC.getDimensionLabels());
}
addFeatureCollection(fc, false);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/edu/jhuapl/trinity/utils/ResourceUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ protected Void call() throws Exception {
//convert to Feature Vector Collection for the lulz
FeatureCollection fc = DataUtils.convertCdcCsv(cdcCsvFile.cdcCsvList, true);
Platform.runLater(() -> scene.getRoot().fireEvent(
new FeatureVectorEvent(FeatureVectorEvent.NEW_FEATURE_COLLECTION, fc)));
new FeatureVectorEvent(FeatureVectorEvent.NEW_FEATURE_COLLECTION, fc, file.getName())));
Trajectory trajectory = new Trajectory(file.getName());
trajectory.totalStates = fc.getFeatures().size();
Platform.runLater(() -> scene.getRoot().fireEvent(
Expand Down Expand Up @@ -629,7 +629,7 @@ protected Void call() throws Exception {
} else if (CyberReporterFile.isFileType(file)) {
CyberReporterFile cyberReportFile = new CyberReporterFile(file.getAbsolutePath(), true);
Platform.runLater(() -> scene.getRoot().fireEvent(
new FeatureVectorEvent(FeatureVectorEvent.NEW_CYBER_REPORT, cyberReportFile.cyberReports)));
new FeatureVectorEvent(FeatureVectorEvent.NEW_CYBER_REPORT, cyberReportFile.cyberReports, file.getName())));
}
} catch (IOException ex) {
LOG.error(null, ex);
Expand Down