Skip to content

Commit

Permalink
updated a few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
olbris committed Mar 19, 2024
1 parent e72d57b commit 86ab7fd
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
import java.awt.*;

/**
* this UI element is a drop-in replacement for UglyColorSlider, but it uses three
* textual spin boxes instead of a slider with three thumbs
* this UI element is a drop-in replacement for UglyColorSlider (it has the same
* public API); it uses three textual spin boxes instead of a slider with three thumbs
*
* much code in this class was adapted from UglyColorSlider
*
* if one were ambitious, I suppose one could define an interface common
* to these two classes
*/
public class TextColorSlider extends JPanel {

Expand All @@ -18,7 +23,7 @@ public class TextColorSlider extends JPanel {

private boolean updatingFromModel = false; // flag to prevent recursion

// probably not going to use but keep around in case:
// not currently using; see setWhiteColor() for more info:
// private Color whiteColor = Color.white;

// UI elements
Expand Down Expand Up @@ -69,9 +74,9 @@ private void setupUI() {

// note on labels: all the internal code refers to black/gray/white levels,
// and I'm not going to change that; when it came time to put text labels
// on it, it was pointed out min/mid/max makes more sense incase eg
// we enable an inverted lookup table; so the text labels will be the
// only place that language appears
// on it, it was pointed out min/mid/max makes more sense in case eg
// we enable an inverted lookup table, so the text labels (and only the
// text labels) will use those terms

add(Box.createRigidArea(new Dimension(10, 0)));
add(new JLabel("Min:"));
Expand Down Expand Up @@ -176,12 +181,12 @@ public void setWhiteLevel(int whiteLevel) {
}

public void setWhiteColor(Color color) {
// we don't currently plan to indicate the color visually, but if we
// do, this is where we'd do the update if it changes
// UglyColorSlider visually indicates the channel's display color, even
// though it's set elsewhere; we don't currently show the display
// color in this widget, but if we ever do, this is where we'd do the update
}

private void updateSliderValuesFromColorModel() {
// adapted code from UglyColorSlider
if (imageColorModel == null)
return;
if (imageColorModel.getChannelCount() <= channelIndex)
Expand Down

0 comments on commit 86ab7fd

Please sign in to comment.