Skip to content
Snippets Groups Projects
Verified Commit 9be14232 authored by tristan.muller's avatar tristan.muller Committed by philippe.verley_ird.fr
Browse files

Fix the medium value of the colorbar preview

parent 04bf09ac
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ package fr.amap.lidar.amapvox.visualization.views; ...@@ -27,6 +27,7 @@ package fr.amap.lidar.amapvox.visualization.views;
import fr.amap.commons.util.swing.FrameView; import fr.amap.commons.util.swing.FrameView;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Frame; import java.awt.Frame;
import java.util.function.Consumer;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.WindowConstants; import javax.swing.WindowConstants;
import net.jcip.annotations.GuardedBy; import net.jcip.annotations.GuardedBy;
...@@ -143,26 +144,19 @@ public class MainView extends FrameView { ...@@ -143,26 +144,19 @@ public class MainView extends FrameView {
/* Init the properties component */ /* Init the properties component */
propertiesView = new PropertiesView(); propertiesView = new PropertiesView();
propertiesView.setParentView(this); propertiesView.setParentView(this);
propertiesView.setOnChangePropertyCallback((name) -> {
if (scene != null) { final Consumer callback = (object) -> {
final Vector2f minAndMax = scene.getVoxelSpaceComponent().getMinAndMaxPropertyValues();
final float min = minAndMax.x;
final float max = minAndMax.y;
final float medium = (max - min) / 2;
viewView.setGradientTexts(Float.toString(min),
Float.toString(medium), Float.toString(max));
}
});
propertiesView.setOnChangeMinAndMaxCallback((name) -> {
if (scene != null) { if (scene != null) {
final Vector2f minAndMax = scene.getVoxelSpaceComponent().getMinAndMaxPropertyValues(); final Vector2f minAndMax = scene.getVoxelSpaceComponent().getMinAndMaxPropertyValues();
final float min = minAndMax.x; final float min = minAndMax.x;
final float max = minAndMax.y; final float max = minAndMax.y;
final float medium = (max - min) / 2; final float medium = min + (max - min) / 2;
viewView.setGradientTexts(Float.toString(min), viewView.setGradientTexts(Float.toString(min),
Float.toString(medium), Float.toString(max)); Float.toString(medium), Float.toString(max));
} }
}); };
propertiesView.setOnChangePropertyCallback(callback);
propertiesView.setOnChangeMinAndMaxCallback(callback);
getContentPane().add(propertiesView.getContentPane(), BorderLayout.WEST); getContentPane().add(propertiesView.getContentPane(), BorderLayout.WEST);
/* Init the options component */ /* Init the options component */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment