Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libjava / classpath / javax / swing / colorchooser / DefaultSwatchChooserPanel.java
blobff3436808ec0a32184596dda38b232386df36b27
1 /* DefaultSwatchChooserPanel.java --
2 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package javax.swing.colorchooser;
41 import java.awt.BorderLayout;
42 import java.awt.Color;
43 import java.awt.Component;
44 import java.awt.Container;
45 import java.awt.Dimension;
46 import java.awt.Graphics;
47 import java.awt.Insets;
48 import java.awt.LayoutManager;
49 import java.awt.event.MouseAdapter;
50 import java.awt.event.MouseEvent;
51 import java.awt.event.MouseListener;
53 import javax.swing.Icon;
54 import javax.swing.JColorChooser;
55 import javax.swing.JLabel;
56 import javax.swing.JPanel;
58 /**
59 * This class is the DefaultSwatchChooserPanel. This chooser panel displays a
60 * set of colors that can be picked. Recently picked items will go into a
61 * side panel so the user can see the history of the chosen colors.
63 class DefaultSwatchChooserPanel extends AbstractColorChooserPanel
65 /** The main panel that holds the set of choosable colors. */
66 MainSwatchPanel mainPalette;
68 /** A panel that holds the recent colors. */
69 RecentSwatchPanel recentPalette;
71 /** The mouse handlers for the panels. */
72 MouseListener mouseHandler;
74 /**
75 * This the base class for all swatch panels. Swatch panels are panels that
76 * hold a set of blocks where colors are displayed.
78 abstract static class SwatchPanel extends JPanel
80 /** The width of each block. */
81 protected int cellWidth = 10;
83 /** The height of each block. */
84 protected int cellHeight = 10;
86 /** The gap between blocks. */
87 protected int gap = 1;
89 /** The number of rows in the swatch panel. */
90 protected int numRows;
92 /** The number of columns in the swatch panel. */
93 protected int numCols;
95 /**
96 * Creates a new SwatchPanel object.
98 SwatchPanel()
100 super();
101 setBackground(Color.WHITE);
105 * This method returns the preferred size of the swatch panel based on the
106 * number of rows and columns and the size of each cell.
108 * @return The preferred size of the swatch panel.
110 public Dimension getPreferredSize()
112 int height = numRows * cellHeight + (numRows - 1) * gap;
113 int width = numCols * cellWidth + (numCols - 1) * gap;
114 Insets insets = getInsets();
116 return new Dimension(width + insets.left + insets.right,
117 height + insets.top + insets.bottom);
121 * This method returns the color for the given position.
123 * @param x The x coordinate of the position.
124 * @param y The y coordinate of the position.
126 * @return The color at the given position.
128 public abstract Color getColorForPosition(int x, int y);
131 * This method initializes the colors for the swatch panel.
133 protected abstract void initializeColors();
137 * This is the main swatch panel. This panel sits in the middle and allows a
138 * set of colors to be picked which will move to the recent swatch panel.
140 static class MainSwatchPanel extends SwatchPanel
142 /** The color describing (204, 255, 255) */
143 public static final Color C204255255 = new Color(204, 204, 255);
145 /** The color describing (255, 204, 204) */
146 public static final Color C255204204 = new Color(255, 204, 204);
148 /** The color describing (204, 255, 204) */
149 public static final Color C204255204 = new Color(204, 255, 204);
151 /** The color describing (204, 204, 204) */
152 public static final Color C204204204 = new Color(204, 204, 204);
154 /** The color (153, 153, 255). */
155 public static final Color C153153255 = new Color(153, 153, 255);
157 /** The color (51, 51, 255). */
158 public static final Color C051051255 = new Color(51, 51, 255);
160 /** The color (153, 0, 153). */
161 public static final Color C153000153 = new Color(153, 0, 153);
163 /** The color (0, 51, 51). */
164 public static final Color C000051051 = new Color(0, 51, 51);
166 /** The color (51, 0, 51). */
167 public static final Color C051000051 = new Color(51, 0, 51);
169 /** The color (51, 51, 0). */
170 public static final Color C051051000 = new Color(51, 51, 0);
172 /** The color (102, 102, 0). */
173 public static final Color C102102000 = new Color(102, 102, 0);
175 /** The color (153, 255, 153). */
176 public static final Color C153255153 = new Color(153, 255, 153);
178 /** The color (102, 255, 102). */
179 public static final Color C102255102 = new Color(102, 255, 102);
181 /** The color (0, 102, 102). */
182 public static final Color C000102102 = new Color(0, 102, 102);
184 /** The color (102, 0, 102). */
185 public static final Color C102000102 = new Color(102, 0, 102);
187 /** The color (0, 153, 153). */
188 public static final Color C000153153 = new Color(0, 153, 153);
190 /** The color (153, 153, 0). */
191 public static final Color C153153000 = new Color(153, 153, 0);
193 /** The color (204, 204, 0). */
194 public static final Color C204204000 = new Color(204, 204, 0);
196 /** The color (204, 0, 204). */
197 public static final Color C204000204 = new Color(204, 0, 204);
199 /** The color (0, 204, 204). */
200 public static final Color C000204204 = new Color(0, 204, 204);
202 /** The color (51, 255, 51). */
203 public static final Color C051255051 = new Color(51, 255, 51);
205 /** The color (255, 51, 51). */
206 public static final Color C255051051 = new Color(255, 51, 51);
208 /** The color (255, 102, 102). */
209 public static final Color C255102102 = new Color(255, 102, 102);
211 /** The color (102, 102, 255). */
212 public static final Color C102102255 = new Color(102, 102, 255);
214 /** The color (255, 153, 153). */
215 public static final Color C255153153 = new Color(255, 153, 153);
216 static Color[] colors =
218 // Row 1
219 Color.WHITE, new Color(204, 255, 255), C204255255, C204255255, C204255255,
220 C204255255, C204255255, C204255255, C204255255,
221 C204255255, C204255255, new Color(255, 204, 255),
222 C255204204, C255204204, C255204204, C255204204,
223 C255204204, C255204204, C255204204, C255204204,
224 C255204204, new Color(255, 255, 204), C204255204,
225 C204255204, C204255204, C204255204, C204255204,
226 C204255204, C204255204, C204255204, C204255204,
228 // Row 2
229 C204204204, new Color(153, 255, 255), new Color(153, 204, 255), C153153255,
230 C153153255, C153153255, C153153255, C153153255,
231 C153153255, C153153255, new Color(204, 153, 255),
232 new Color(255, 153, 255),
233 new Color(255, 153, 204), C255153153, C255153153,
234 C255153153, C255153153, C255153153, C255153153,
235 C255153153, new Color(255, 204, 153),
236 new Color(255, 255, 153),
237 new Color(204, 255, 153), C153255153, C153255153,
238 C153255153, C153255153, C153255153, C153255153,
239 C153255153, new Color(153, 255, 204),
241 // Row 3
242 C204204204, new Color(102, 255, 255), new Color(102, 204, 255),
243 new Color(102, 153, 255), C102102255, C102102255,
244 C102102255, C102102255, C102102255,
245 new Color(153, 102, 255),
246 new Color(204, 102, 255),
247 new Color(255, 102, 255),
248 new Color(255, 102, 204),
249 new Color(255, 102, 153), C255102102, C255102102,
250 C255102102, C255102102, C255102102,
251 new Color(255, 153, 102),
252 new Color(255, 204, 102),
253 new Color(255, 255, 102),
254 new Color(204, 255, 102),
255 new Color(153, 255, 102), C102255102, C102255102,
256 C102255102, C102255102, C102255102,
257 new Color(102, 255, 153),
258 new Color(102, 255, 204),
260 // Row 4
261 new Color(153, 153, 153), new Color(51, 255, 255), new Color(51, 204, 255),
262 new Color(51, 153, 255), new Color(51, 102, 255),
263 C051051255, C051051255, C051051255,
264 new Color(102, 51, 255), new Color(153, 51, 255),
265 new Color(204, 51, 255), new Color(255, 51, 255),
266 new Color(255, 51, 204), new Color(255, 51, 153),
267 new Color(255, 51, 102), C255051051, C255051051,
268 C255051051, new Color(255, 102, 51),
269 new Color(255, 153, 51), new Color(255, 204, 51),
270 new Color(255, 255, 51), new Color(204, 255, 51),
271 new Color(153, 255, 51), new Color(102, 255, 51),
272 C051255051, C051255051, C051255051,
273 new Color(51, 255, 102), new Color(51, 255, 153),
274 new Color(51, 255, 204),
276 // Row 5
277 new Color(153, 153, 153), new Color(0, 255, 255), new Color(0, 204, 255),
278 new Color(0, 153, 255), new Color(0, 102, 255),
279 new Color(0, 51, 255), new Color(0, 0, 255),
280 new Color(51, 0, 255), new Color(102, 0, 255),
281 new Color(153, 0, 255), new Color(204, 0, 255),
282 new Color(255, 0, 255), new Color(255, 0, 204),
283 new Color(255, 0, 153), new Color(255, 0, 102),
284 new Color(255, 0, 51), new Color(255, 0, 0),
285 new Color(255, 51, 0), new Color(255, 102, 0),
286 new Color(255, 153, 0), new Color(255, 204, 0),
287 new Color(255, 255, 0), new Color(204, 255, 0),
288 new Color(153, 255, 0), new Color(102, 255, 0),
289 new Color(51, 255, 0), new Color(0, 255, 0),
290 new Color(0, 255, 51), new Color(0, 255, 102),
291 new Color(0, 255, 153), new Color(0, 255, 204),
293 // Row 6
294 new Color(102, 102, 102), C000204204, C000204204, new Color(0, 153, 204),
295 new Color(0, 102, 204), new Color(0, 51, 204),
296 new Color(0, 0, 204), new Color(51, 0, 204),
297 new Color(102, 0, 204), new Color(153, 0, 204),
298 C204000204, C204000204, C204000204,
299 new Color(204, 0, 153), new Color(204, 0, 102),
300 new Color(204, 0, 51), new Color(204, 0, 0),
301 new Color(204, 51, 0), new Color(204, 102, 0),
302 new Color(204, 153, 0), C204204000, C204204000,
303 C204204000, new Color(153, 204, 0),
304 new Color(102, 204, 0), new Color(51, 204, 0),
305 new Color(0, 204, 0), new Color(0, 204, 51),
306 new Color(0, 204, 102), new Color(0, 204, 153),
307 new Color(0, 204, 204),
309 // Row 7
310 new Color(102, 102, 102), C000153153, C000153153, C000153153,
311 new Color(0, 102, 153), new Color(0, 51, 153),
312 new Color(0, 0, 153), new Color(51, 0, 153),
313 new Color(102, 0, 153), C153000153, C153000153,
314 C153000153, C153000153, C153000153,
315 new Color(153, 0, 102), new Color(153, 0, 51),
316 new Color(153, 0, 0), new Color(153, 51, 0),
317 new Color(153, 102, 0), C153153000, C153153000,
318 C153153000, C153153000, C153153000,
319 new Color(102, 153, 0), new Color(51, 153, 0),
320 new Color(0, 153, 0), new Color(0, 153, 51),
321 new Color(0, 153, 102), C000153153, C000153153,
323 // Row 8
324 new Color(51, 51, 51), C000102102, C000102102, C000102102, C000102102,
325 new Color(0, 51, 102), new Color(0, 0, 102),
326 new Color(51, 0, 102), C102000102, C102000102,
327 C102000102, C102000102, C102000102, C102000102,
328 C102000102, new Color(102, 0, 51),
329 new Color(102, 0, 0), new Color(102, 51, 0),
330 C102102000, C102102000, C102102000, C102102000,
331 C102102000, C102102000, C102102000,
332 new Color(51, 102, 0), new Color(0, 102, 0),
333 new Color(0, 102, 51), C000102102, C000102102,
334 C000102102,
336 // Row 9.
337 Color.BLACK, C000051051, C000051051, C000051051, C000051051, C000051051,
338 new Color(0, 0, 51), C051000051, C051000051,
339 C051000051, C051000051, C051000051, C051000051,
340 C051000051, C051000051, C051000051,
341 new Color(51, 0, 0), C051051000, C051051000,
342 C051051000, C051051000, C051051000, C051051000,
343 C051051000, C051051000, new Color(0, 51, 0),
344 C000051051, C000051051, C000051051, C000051051,
345 new Color(51, 51, 51)
349 * Creates a new MainSwatchPanel object.
351 MainSwatchPanel()
353 super();
354 numCols = 31;
355 numRows = 9;
356 initializeColors();
357 revalidate();
361 * This method returns the color for the given position.
363 * @param x The x location for the position.
364 * @param y The y location for the position.
366 * @return The color for the given position.
368 public Color getColorForPosition(int x, int y)
370 if (x % (cellWidth + gap) > cellWidth
371 || y % (cellHeight + gap) > cellHeight)
372 // position is located in gap.
373 return null;
375 int row = y / (cellHeight + gap);
376 int col = x / (cellWidth + gap);
377 return colors[row * numCols + col];
381 * This method initializes the colors for the main swatch panel.
383 protected void initializeColors()
385 // Unnecessary
389 * This method paints the main graphics panel with the given Graphics
390 * object.
392 * @param graphics The Graphics object to paint with.
394 public void paint(Graphics graphics)
396 int index = 0;
397 Insets insets = getInsets();
398 int currX = insets.left;
399 int currY = insets.top;
400 Color saved = graphics.getColor();
402 for (int i = 0; i < numRows; i++)
404 for (int j = 0; j < numCols; j++)
406 graphics.setColor(colors[index++]);
407 graphics.fill3DRect(currX, currY, cellWidth, cellHeight, true);
408 currX += gap + cellWidth;
410 currX = insets.left;
411 currY += gap + cellHeight;
413 graphics.setColor(saved);
417 * This method returns the tooltip text for the given MouseEvent.
419 * @param e The MouseEvent to find tooltip text for.
421 * @return The tooltip text.
423 public String getToolTipText(MouseEvent e)
425 Color c = getColorForPosition(e.getX(), e.getY());
426 if (c == null)
427 return null;
428 return (c.getRed() + "," + c.getGreen() + "," + c.getBlue());
433 * This class is the recent swatch panel. It holds recently selected colors.
435 static class RecentSwatchPanel extends SwatchPanel
437 /** The array for storing recently stored colors. */
438 Color[] colors;
440 /** The default color. */
441 public static final Color defaultColor = Color.GRAY;
443 /** The index of the array that is the start. */
444 int start = 0;
447 * Creates a new RecentSwatchPanel object.
449 RecentSwatchPanel()
451 super();
452 numCols = 5;
453 numRows = 7;
454 initializeColors();
455 revalidate();
459 * This method returns the color for the given position.
461 * @param x The x coordinate of the position.
462 * @param y The y coordinate of the position.
464 * @return The color for the given position.
466 public Color getColorForPosition(int x, int y)
468 if (x % (cellWidth + gap) > cellWidth
469 || y % (cellHeight + gap) > cellHeight)
470 // position is located in gap.
471 return null;
473 int row = y / (cellHeight + gap);
474 int col = x / (cellWidth + gap);
476 return colors[getIndexForCell(row, col)];
480 * This method initializes the colors for the recent swatch panel.
482 protected void initializeColors()
484 colors = new Color[numRows * numCols];
485 for (int i = 0; i < colors.length; i++)
486 colors[i] = defaultColor;
490 * This method returns the array index for the given row and column.
492 * @param row The row.
493 * @param col The column.
495 * @return The array index for the given row and column.
497 private int getIndexForCell(int row, int col)
499 return ((row * numCols) + col + start) % (numRows * numCols);
503 * This method adds the given color to the beginning of the swatch panel.
504 * Package-private to avoid an accessor method.
506 * @param c The color to add.
508 void addColorToQueue(Color c)
510 if (--start == -1)
511 start = numRows * numCols - 1;
513 colors[start] = c;
517 * This method paints the panel with the given Graphics object.
519 * @param g The Graphics object to paint with.
521 public void paint(Graphics g)
523 Color saved = g.getColor();
524 Insets insets = getInsets();
525 int currX = insets.left;
526 int currY = insets.top;
528 for (int i = 0; i < numRows; i++)
530 for (int j = 0; j < numCols; j++)
532 g.setColor(colors[getIndexForCell(i, j)]);
533 g.fill3DRect(currX, currY, cellWidth, cellHeight, true);
534 currX += cellWidth + gap;
536 currX = insets.left;
537 currY += cellWidth + gap;
542 * This method returns the tooltip text for the given MouseEvent.
544 * @param e The MouseEvent.
546 * @return The tooltip text.
548 public String getToolTipText(MouseEvent e)
550 Color c = getColorForPosition(e.getX(), e.getY());
551 if (c == null)
552 return null;
553 return c.getRed() + "," + c.getGreen() + "," + c.getBlue();
558 * This class handles mouse events for the two swatch panels.
560 class MouseHandler extends MouseAdapter
563 * This method is called whenever the mouse is pressed.
565 * @param e The MouseEvent.
567 public void mousePressed(MouseEvent e)
569 SwatchPanel panel = (SwatchPanel) e.getSource();
570 Color c = panel.getColorForPosition(e.getX(), e.getY());
571 recentPalette.addColorToQueue(c);
572 DefaultSwatchChooserPanel.this.getColorSelectionModel().setSelectedColor(c);
573 DefaultSwatchChooserPanel.this.repaint();
578 * This is the layout manager for the main panel.
580 static class MainPanelLayout implements LayoutManager
583 * This method is called when a new component is added to the container.
585 * @param name The name of the component.
586 * @param comp The added component.
588 public void addLayoutComponent(String name, Component comp)
590 // Nothing to do here.
594 * This method is called to set the size and position of the child
595 * components for the given container.
597 * @param parent The container to lay out.
599 public void layoutContainer(Container parent)
601 Component[] comps = parent.getComponents();
602 Insets insets = parent.getInsets();
603 Dimension[] pref = new Dimension[comps.length];
605 int xpos = 0;
606 int ypos = 0;
607 int maxHeight = 0;
608 int totalWidth = 0;
610 for (int i = 0; i < comps.length; i++)
612 pref[i] = comps[i].getPreferredSize();
613 if (pref[i] == null)
614 return;
615 maxHeight = Math.max(maxHeight, pref[i].height);
616 totalWidth += pref[i].width;
619 ypos = (parent.getSize().height - maxHeight) / 2 + insets.top;
620 xpos = insets.left + (parent.getSize().width - totalWidth) / 2;
622 for (int i = 0; i < comps.length; i++)
624 if (pref[i] == null)
625 continue;
626 comps[i].setBounds(xpos, ypos, pref[i].width, pref[i].height);
627 xpos += pref[i].width;
632 * This method is called when a component is removed from the container.
634 * @param comp The component that was removed.
636 public void removeLayoutComponent(Component comp)
638 // Nothing to do here.
642 * This methods calculates the minimum layout size for the container.
644 * @param parent The container.
646 * @return The minimum layout size.
648 public Dimension minimumLayoutSize(Container parent)
650 return preferredLayoutSize(parent);
654 * This method returns the preferred layout size for the given container.
656 * @param parent The container.
658 * @return The preferred layout size.
660 public Dimension preferredLayoutSize(Container parent)
662 int xmax = 0;
663 int ymax = 0;
665 Component[] comps = parent.getComponents();
666 Dimension pref;
668 for (int i = 0; i < comps.length; i++)
670 pref = comps[i].getPreferredSize();
671 if (pref == null)
672 continue;
673 xmax += pref.width;
674 ymax = Math.max(ymax, pref.height);
677 Insets insets = parent.getInsets();
679 return new Dimension(insets.left + insets.right + xmax,
680 insets.top + insets.bottom + ymax);
685 * This is the layout manager for the recent swatch panel.
687 static class RecentPanelLayout implements LayoutManager
690 * This method is called when a component is added to the container.
692 * @param name The name of the component.
693 * @param comp The added component.
695 public void addLayoutComponent(String name, Component comp)
697 // Nothing needs to be done.
701 * This method sets the size and position of the child components of the
702 * given container.
704 * @param parent The container to lay out.
706 public void layoutContainer(Container parent)
708 Component[] comps = parent.getComponents();
709 Dimension parentSize = parent.getSize();
710 Insets insets = parent.getInsets();
711 int currY = insets.top;
712 Dimension pref;
714 for (int i = 0; i < comps.length; i++)
716 pref = comps[i].getPreferredSize();
717 if (pref == null)
718 continue;
719 comps[i].setBounds(insets.left, currY, pref.width, pref.height);
720 currY += pref.height;
725 * This method calculates the minimum layout size for the given container.
727 * @param parent The container.
729 * @return The minimum layout size.
731 public Dimension minimumLayoutSize(Container parent)
733 return preferredLayoutSize(parent);
737 * This method calculates the preferred layout size for the given
738 * container.
740 * @param parent The container.
742 * @return The preferred layout size.
744 public Dimension preferredLayoutSize(Container parent)
746 int width = 0;
747 int height = 0;
748 Insets insets = parent.getInsets();
749 Component[] comps = parent.getComponents();
750 Dimension pref;
751 for (int i = 0; i < comps.length; i++)
753 pref = comps[i].getPreferredSize();
754 if (pref != null)
756 width = Math.max(width, pref.width);
757 height += pref.height;
761 return new Dimension(width + insets.left + insets.right,
762 height + insets.top + insets.bottom);
766 * This method is called whenever a component is removed from the
767 * container.
769 * @param comp The removed component.
771 public void removeLayoutComponent(Component comp)
773 // Nothing needs to be done.
778 * Creates a new DefaultSwatchChooserPanel object.
780 DefaultSwatchChooserPanel()
782 super();
786 * This method updates the chooser panel with the new value from the
787 * JColorChooser.
789 public void updateChooser()
791 // Nothing to do here yet.
795 * This method builds the chooser panel.
797 protected void buildChooser()
799 // The structure of the swatch panel is:
800 // One large panel (minus the insets).
801 // Inside that panel, there are two panels, one holds the palette.
802 // The other holds the label and the recent colors palette.
803 // The two palettes are two custom swatch panels.
804 setLayout(new MainPanelLayout());
806 JPanel mainPaletteHolder = new JPanel();
807 JPanel recentPaletteHolder = new JPanel();
809 mainPalette = new MainSwatchPanel();
810 recentPalette = new RecentSwatchPanel();
811 JLabel label = new JLabel("Recent:");
813 mouseHandler = new MouseHandler();
814 mainPalette.addMouseListener(mouseHandler);
815 recentPalette.addMouseListener(mouseHandler);
817 mainPaletteHolder.setLayout(new BorderLayout());
818 mainPaletteHolder.add(mainPalette, BorderLayout.CENTER);
820 recentPaletteHolder.setLayout(new RecentPanelLayout());
821 recentPaletteHolder.add(label);
822 recentPaletteHolder.add(recentPalette);
824 JPanel main = new JPanel();
825 main.add(mainPaletteHolder);
826 main.add(recentPaletteHolder);
828 this.add(main);
832 * This method removes the chooser panel from the JColorChooser.
834 * @param chooser The JColorChooser this panel is being removed from.
836 public void uninstallChooserPanel(JColorChooser chooser)
838 recentPalette = null;
839 mainPalette = null;
841 removeAll();
842 super.uninstallChooserPanel(chooser);
846 * This method returns the JTabbedPane displayed name.
848 * @return The name displayed in the JTabbedPane.
850 public String getDisplayName()
852 return "Swatches";
856 * This method returns the small display icon.
858 * @return The small display icon.
860 public Icon getSmallDisplayIcon()
862 return null;
866 * This method returns the large display icon.
868 * @return The large display icon.
870 public Icon getLargeDisplayIcon()
872 return null;
876 * This method paints the chooser panel with the given Graphics object.
878 * @param g The Graphics object to paint with.
880 public void paint(Graphics g)
882 super.paint(g);
886 * This method returns the tooltip text for the given MouseEvent.
888 * @param e The MouseEvent.
890 * @return The tooltip text.
892 public String getToolTipText(MouseEvent e)
894 return null;