Changeset 7962
- Timestamp:
- 04/12/12 17:28:55 (8 years ago)
- Location:
- trunk/projects/slim-plugin/src/main/java/loci/slim/histogram
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/projects/slim-plugin/src/main/java/loci/slim/histogram/HistogramTool.java
r7950 r7962 433 433 434 434 @Override 435 public void setExcludePixels(boolean excludePixels) { 436 synchronized (_synchObject) { 437 //TODO ARG 438 System.out.println("set exclude pixels " + excludePixels); 439 } 440 } 441 442 @Override 435 443 public void setCombineChannels(boolean combineChannels) { 436 444 synchronized (_synchObject) { -
trunk/projects/slim-plugin/src/main/java/loci/slim/histogram/IUIPanelListener.java
r7889 r7962 20 20 21 21 /** 22 * User has clicked the exclude pixels checkbox. 23 * 24 * @param excludePixels 25 */ 26 public void setExcludePixels(boolean excludePixels); 27 28 /** 22 29 * User has clicked the combine channels checkbox. 23 30 */ -
trunk/projects/slim-plugin/src/main/java/loci/slim/histogram/UIPanel.java
r7889 r7962 25 25 */ 26 26 public class UIPanel extends JPanel { 27 private static final String AUTO_RANGING = "Adjust range to min/max values"; 28 private static final String EXCLUDE_PIXELS = "Hide pixels outside range"; 29 private static final String DISPLAY_CHANNELS = "Display all channels"; 30 private static final String COMBINE_CHANNELS = "Combine all channels"; 31 27 32 private static final int DIGITS = 5; 28 33 IUIPanelListener _listener; 29 34 JCheckBox _autoRangeCheckBox; 35 JCheckBox _excludePixelsCheckBox; 30 36 JCheckBox _combineChannelsCheckBox; 31 37 JCheckBox _displayChannelsCheckBox; … … 33 39 JTextField _maxTextField; 34 40 boolean _autoRange; 41 boolean _excludePixels; 35 42 boolean _combineChannels; 36 43 boolean _displayChannels; … … 47 54 48 55 // initial state 49 _autoRange = true; 56 _autoRange = true; 57 _excludePixels = false; 58 _combineChannels = false; 59 _displayChannels = false; 50 60 _minLUT = _maxLUT = 0.0; 51 61 … … 95 105 add(readOutPanel); 96 106 97 _autoRangeCheckBox = new JCheckBox( "Automatic Ranging", _autoRange);107 _autoRangeCheckBox = new JCheckBox(AUTO_RANGING, _autoRange); 98 108 _autoRangeCheckBox.addItemListener( 99 109 new ItemListener() { 100 110 public void itemStateChanged(ItemEvent e) { 101 111 _autoRange = _autoRangeCheckBox.isSelected(); 102 enable TextFields(_autoRange);112 enableUI(_autoRange); 103 113 if (null != _listener) { 104 114 _listener.setAutoRange(_autoRange); … … 109 119 add(_autoRangeCheckBox); 110 120 121 _excludePixelsCheckBox = new JCheckBox(EXCLUDE_PIXELS, _excludePixels); 122 _excludePixelsCheckBox.addItemListener( 123 new ItemListener() { 124 public void itemStateChanged(ItemEvent e) { 125 _excludePixels = _excludePixelsCheckBox.isSelected(); 126 if (null != _listener) { 127 _listener.setExcludePixels(_excludePixels); 128 } 129 } 130 } 131 ); 132 add(_excludePixelsCheckBox); 133 111 134 _combineChannelsCheckBox = 112 new JCheckBox( "Combine Channels", _combineChannels);135 new JCheckBox(COMBINE_CHANNELS, _combineChannels); 113 136 _combineChannelsCheckBox.addItemListener( 114 137 new ItemListener() { … … 121 144 } 122 145 ); 146 123 147 /** 124 148 * IJ1 uses the same LUT for the entire stack. It might be possible for … … 136 160 137 161 _displayChannelsCheckBox = 138 new JCheckBox( "Display All Channels", _displayChannels);162 new JCheckBox(DISPLAY_CHANNELS, _displayChannels); 139 163 _displayChannelsCheckBox.addItemListener( 140 164 new ItemListener() { … … 157 181 } 158 182 159 enable TextFields(_autoRange);183 enableUI(_autoRange); 160 184 } 161 185 … … 172 196 _autoRange = autoRange; 173 197 _autoRangeCheckBox.setSelected(autoRange); 174 enable TextFields(autoRange);198 enableUI(autoRange); 175 199 } 176 200 … … 214 238 215 239 /** 216 * Enable/disable min/max text fields as appropriate.217 */ 218 private void enable TextFields(boolean auto) {240 * Enable/disable UI elements as appropriate. 241 */ 242 private void enableUI(boolean auto) { 219 243 _minTextField.setEnabled(!auto); 220 244 _maxTextField.setEnabled(!auto); 245 _excludePixelsCheckBox.setEnabled(!auto); 221 246 } 222 247
Note: See TracChangeset
for help on using the changeset viewer.