コード例 #1
0
ファイル: Slider.java プロジェクト: winter1990/UISpec4J
 private TreeMap<Integer, String> getSortedTree() {
   Dictionary dictionary = jSlider.getLabelTable();
   TreeMap<Integer, String> treeMap = new TreeMap<Integer, String>();
   for (Enumeration indices = dictionary.keys(); indices.hasMoreElements(); ) {
     Integer index = (Integer) indices.nextElement();
     JComponent component = (JComponent) dictionary.get(index);
     treeMap.put(index, ComponentUtils.getDisplayedName(component));
   }
   return treeMap;
 }
コード例 #2
0
ファイル: Slider.java プロジェクト: winter1990/UISpec4J
 private int getIndexForLabel(String label) {
   Dictionary dictionary = jSlider.getLabelTable();
   for (Enumeration indices = dictionary.keys(); indices.hasMoreElements(); ) {
     Integer index = (Integer) indices.nextElement();
     JComponent component = (JComponent) dictionary.get(index);
     if (label.equals(ComponentUtils.getDisplayedName(component))) {
       return index;
     }
   }
   return -1;
 }
コード例 #3
0
ファイル: Slider.java プロジェクト: winter1990/UISpec4J
 private String getCurrentLabel() {
   int value = jSlider.getValue();
   Dictionary dictionary = jSlider.getLabelTable();
   for (Enumeration indices = dictionary.keys(); indices.hasMoreElements(); ) {
     Integer index = (Integer) indices.nextElement();
     JComponent component = (JComponent) dictionary.get(index);
     if (Utils.equals(index, value)) {
       return ComponentUtils.getDisplayedName(component);
     }
   }
   return null;
 }