Fix for colour limits on DL prediction pane

This commit is contained in:
Jamie Mac 2024-07-26 16:40:18 +01:00
parent 7be2e4eeed
commit 9e65fb18f4

View File

@ -207,12 +207,24 @@ public class DLSymbolOptionPanel implements PamDialogPanel, ActionListener {
*/ */
private void setPredictionColParams(DLSymbolModifierParams symbolOptions) { private void setPredictionColParams(DLSymbolModifierParams symbolOptions) {
//just incasesettings have messed up
if (symbolOptions.clims[0]==symbolOptions.clims[1]) {
symbolOptions.clims[0]=Math.max(0.,symbolOptions.clims[1]-0.1);
symbolOptions.clims[1]=Math.min(1.,symbolOptions.clims[1]+0.1);
}
//now set frequency parameters //now set frequency parameters
colorRangeSlider.setValue((int) symbolOptions.clims[0]*100); // System.out.println("Set colour limits: " + symbolOptions.clims[0] + " " + symbolOptions.clims[1] + " " + colorRangeSlider.getMaximum());
colorRangeSlider.setUpperValue((int) symbolOptions.clims[1]*100);
//careful of casting to int here or else end up with setting the two thumbs in the same place.
colorRangeSlider.setColourMap(PamUtilsFX.fxColArray2Swing(symbolOptions.colArray));
colorRangeSlider.setValue((int) (symbolOptions.clims[0]*100.));
colorRangeSlider.setUpperValue((int) (symbolOptions.clims[1]*100.));
// colorRangeSlider.setColourArrayType( symbolOptions.colArray); // colorRangeSlider.setColourArrayType( symbolOptions.colArray);
colorRangeSlider.setColourMap(PamUtilsFX.fxColArray2Swing(symbolOptions.colArray));
int nClass = checkClassNamesBox( symbolOptions, classNameBox); int nClass = checkClassNamesBox( symbolOptions, classNameBox);