Startup
This commit is contained in:
@@ -916,16 +916,23 @@ public class ScreenPanel extends Panel {
|
||||
buttonFullRange.setSelected(true);
|
||||
} else if (config.colormapAutomatic) {
|
||||
buttonAutomatic.setSelected(true);
|
||||
} else {
|
||||
} else {
|
||||
buttonManual.setSelected(true);
|
||||
}
|
||||
btFixColormapRange.setVisible(buttonAutomatic.isSelected());
|
||||
|
||||
//spinnerMin.setVisible(buttonManual.isSelected()); labelMin.setVisible(spinnerMin.isVisible());
|
||||
//spinnerMax.setVisible(buttonManual.isSelected()); labelMax.setVisible(spinnerMax.isVisible());
|
||||
spinnerMin.setEnabled(buttonManual.isSelected());
|
||||
spinnerMax.setEnabled(buttonManual.isSelected());
|
||||
spinnerMin.setValue(Double.isNaN(config.colormapMin) ? 0 : Math.min(Math.max((int) config.colormapMin, 0), 65535));
|
||||
spinnerMax.setValue(Double.isNaN(config.colormapMax) ? 0 : Math.min(Math.max((int) config.colormapMax, 0), 65535));
|
||||
//spinnerMin.setValue(Double.isNaN(config.colormapMin) ? 0 : Math.min(Math.max((int) config.colormapMin, 0), 65535));
|
||||
//spinnerMax.setValue(Double.isNaN(config.colormapMax) ? 0 : Math.min(Math.max((int) config.colormapMax, 0), 65535));
|
||||
if (!Double.isNaN(config.colormapMin) ){
|
||||
spinnerMin.setValue(Math.min(Math.max((int) config.colormapMin, 0), 65535));
|
||||
}
|
||||
if (!Double.isNaN(config.colormapMax) ){
|
||||
spinnerMax.setValue(Math.min(Math.max((int) config.colormapMax, 0), 65535));
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -2283,6 +2290,11 @@ public class ScreenPanel extends Panel {
|
||||
labelMax.setText("Max:");
|
||||
|
||||
btFixColormapRange.setText("Fix");
|
||||
btFixColormapRange.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
btFixColormapRangeActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
@@ -2310,7 +2322,7 @@ public class ScreenPanel extends Panel {
|
||||
.addComponent(labelMin)
|
||||
.addGap(2, 2, 2)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(btFixColormapRange, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(btFixColormapRange, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(spinnerMin, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
.addContainerGap())
|
||||
);
|
||||
@@ -2331,7 +2343,7 @@ public class ScreenPanel extends Panel {
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonAutomatic)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(btFixColormapRange))
|
||||
.addComponent(btFixColormapRange, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(0, 0, 0)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(labelMin)
|
||||
@@ -2827,7 +2839,7 @@ public class ScreenPanel extends Panel {
|
||||
renderer.setPenReticle(new Pen(colorReticule));
|
||||
renderer.setPenProfile(new Pen(colorReticule, 0));
|
||||
renderer.setPenMarker(new Pen(colorMarker, 2));
|
||||
renderer.setShowReticle(false);
|
||||
renderer.setShowReticle(false);
|
||||
checkReticle();
|
||||
source.getConfig().colormapAutomatic = buttonAutomatic.isSelected();
|
||||
source.getConfig().colormapMin = buttonFullRange.isSelected() ? Double.NaN : (Integer) spinnerMin.getValue();
|
||||
@@ -3060,6 +3072,21 @@ public class ScreenPanel extends Panel {
|
||||
}
|
||||
}//GEN-LAST:event_spinnerGrThresholdonChange
|
||||
|
||||
private void btFixColormapRangeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btFixColormapRangeActionPerformed
|
||||
try {
|
||||
updatingColormap = true;
|
||||
ArrayProperties properties = currentFrame.data.getProperties();
|
||||
spinnerMax.setValue(properties.max.intValue());
|
||||
spinnerMin.setValue(properties.min.intValue());
|
||||
buttonManual.setSelected(true);
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
} finally{
|
||||
updatingColormap = false;
|
||||
onChangeColormap(null);
|
||||
}
|
||||
}//GEN-LAST:event_btFixColormapRangeActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btFixColormapRange;
|
||||
private javax.swing.JButton buttonArgs;
|
||||
|
||||
Reference in New Issue
Block a user