77 |
77 |
78 /** |
78 /** |
79 * For a Home action, scrolls to the top. Otherwise, scroll to the end. |
79 * For a Home action, scrolls to the top. Otherwise, scroll to the end. |
80 */ |
80 */ |
81 public void actionPerformed(final ActionEvent e) { |
81 public void actionPerformed(final ActionEvent e) { |
82 final JList list = (JList)e.getSource(); |
82 final JList<?> list = (JList<?>)e.getSource(); |
83 |
83 |
84 if (fHomeAction) { |
84 if (fHomeAction) { |
85 list.ensureIndexIsVisible(0); |
85 list.ensureIndexIsVisible(0); |
86 } else { |
86 } else { |
87 final int size = list.getModel().getSize(); |
87 final int size = list.getModel().getSize(); |
133 public void mouseDragged(final MouseEvent e) { |
133 public void mouseDragged(final MouseEvent e) { |
134 super.mouseDragged(new SelectionMouseEvent(e)); |
134 super.mouseDragged(new SelectionMouseEvent(e)); |
135 }*/ |
135 }*/ |
136 } |
136 } |
137 |
137 |
138 JList getComponent() { |
138 JList<Object> getComponent() { |
139 return list; |
139 return list; |
140 } |
140 } |
141 |
141 |
142 // this is used for blinking combobox popup selections when they are selected |
142 // this is used for blinking combobox popup selections when they are selected |
143 protected void repaintCell(final Object value, final int selectedIndex, final boolean selected) { |
143 protected void repaintCell(final Object value, final int selectedIndex, final boolean selected) { |
144 final Rectangle rowBounds = getCellBounds(list, selectedIndex, selectedIndex); |
144 final Rectangle rowBounds = getCellBounds(list, selectedIndex, selectedIndex); |
145 if (rowBounds == null) return; |
145 if (rowBounds == null) return; |
146 |
146 |
147 final ListCellRenderer renderer = list.getCellRenderer(); |
147 final ListCellRenderer<Object> renderer = list.getCellRenderer(); |
148 if (renderer == null) return; |
148 if (renderer == null) return; |
149 |
149 |
150 final Component rendererComponent = renderer.getListCellRendererComponent(list, value, selectedIndex, selected, true); |
150 final Component rendererComponent = renderer.getListCellRendererComponent(list, value, selectedIndex, selected, true); |
151 if (rendererComponent == null) return; |
151 if (rendererComponent == null) return; |
152 |
152 |