You can create a model for your JSlider
to
adjust either the upper or lower bound of your
ThresholdList
. Two factory methods are provided
by the GlazedListsSwing
factory class:
GlazedListsSwing.lowerRangeModel()
adjusts the lower bound of your ThresholdList.
GlazedListsSwing.upperRangeModel()
adjusts the upper bound of your ThresholdList.
The Issue Browser priority range is between 1 and 5. The slider
can adjust the minimum priority displayed in the table. This is the
ThresholdList
's lower bound.
// create the threshold slider BoundedRangeModel priorityFilterRangeModel = GlazedListsSwing.lowerRangeModel(priorityFilteredIssues); priorityFilterRangeModel.setRangeProperties(1, 0, 1, 5, false); JSlider priorityFilterSlider = new JSlider(priorityFilterRangeModel); Hashtable priorityFilterSliderLabels = new Hashtable(); priorityFilterSliderLabels.put(new Integer(1), new JLabel("Low")); priorityFilterSliderLabels.put(new Integer(5), new JLabel("High")); priorityFilterSlider.setLabelTable(priorityFilterSliderLabels); priorityFilterSlider.setMajorTickSpacing(1); priorityFilterSlider.setSnapToTicks(true); priorityFilterSlider.setPaintLabels(true); priorityFilterSlider.setPaintTicks(true);