|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
javax.swing.colorchooser.SwatchPanel
javax.swing.colorchooser.RecentSwatchPanel
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
protected Color[] |
colors
|
protected Dimension |
gap
|
protected Dimension |
numSwatches
|
protected Dimension |
swatchSize
|
| Fields inherited from class javax.swing.JPanel |
|
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
(package private) |
RecentSwatchPanel()
|
| Method Summary | |
Color |
getColorForLocation(int x,
int y)
|
Dimension |
getPreferredSize()
If the preferredSize has been set to a
non-null value just returns it.
|
String |
getToolTipText(MouseEvent e)
Returns the string to be used as the tooltip for event. |
protected void |
initColors()
|
protected void |
initValues()
|
boolean |
isFocusTraversable()
Returns whether this Component can become the focus
owner. |
void |
paintComponent(Graphics g)
Calls the UI delegate's paint method, if the UI delegate is non- null. |
void |
setMostRecentColor(Color c)
|
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Color[] colors
protected Dimension swatchSize
protected Dimension numSwatches
protected Dimension gap
| Constructor Detail |
RecentSwatchPanel()
| Method Detail |
protected void initValues()
initValues in class SwatchPanelprotected void initColors()
initColors in class SwatchPanelpublic void setMostRecentColor(Color c)
public boolean isFocusTraversable()
ComponentComponent can become the focus
owner.
isFocusTraversable in class Componenttrue if this Component is
focusable; false otherwiseComponent.setFocusable(boolean)public void paintComponent(Graphics g)
JComponentnull. We pass the delegate a copy of the
Graphics object to protect the rest of the
paint code from irrevocable changes
(for example, Graphics.translate).
If you override this in a subclass you should not make permanent
changes to the passed in Graphics. For example, you
should not alter the clip Rectangle or modify the
transform. If you need to do these operations you may find it
easier to create a new Graphics from the passed in
Graphics and manipulate it. Further, if you do not
invoker super's implementation you must honor the opaque property,
that is
if this component is opaque, you must completely fill in the background
in a non-opaque color. If you do not honor the opaque property you
will likely see visual artifacts.
paintComponent in class JComponentg - the Graphics object to protectJComponent.paint(java.awt.Graphics),
ComponentUIpublic Dimension getPreferredSize()
JComponentpreferredSize has been set to a
non-null value just returns it.
If the UI delegate's getPreferredSize
method returns a non null value then return that;
otherwise defer to the component's layout manager.
getPreferredSize in class JComponentpreferredSize propertyJComponent.setPreferredSize(java.awt.Dimension),
ComponentUIpublic String getToolTipText(MouseEvent e)
JComponentsetToolTipText. If a component provides
more extensive API to support differing tooltips at different locations,
this method should be overridden.
getToolTipText in class JComponent
public Color getColorForLocation(int x,
int y)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||