public class ColorPickPanel extends java.awt.Panel implements java.awt.event.AdjustmentListener, java.awt.event.ActionListener, java.awt.event.TextListener, ColorChangeListener
Modifier and Type | Field and Description |
---|---|
(package private) int |
b
I valori delle componenti rossa, verde e blu
|
(package private) java.awt.TextField |
blueTf
Il TextField contenente il valore della componente blu (0-255)
|
(package private) java.awt.Panel |
color
Il Panel contenente il colore selezionato
|
(package private) java.awt.Panel |
componentsPanel
Il Panel contenente gli sliders delle tre componenti del colore
|
(package private) int |
g
I valori delle componenti rossa, verde e blu
|
(package private) java.awt.TextField |
greenTf
Il TextField contenente il valore della componente verde (0-255)
|
(package private) int |
r
I valori delle componenti rossa, verde e blu
|
(package private) java.awt.TextField |
redTf
Il TextField contenente il valore della componente rossa (0-255)
|
(package private) java.awt.Scrollbar[] |
rgb
Le scrollaBars per le tre componenti di colore
|
(package private) ColorShades |
shades
Il Panel contenente tutte le sfumature di colore alle diverse intensità
selezionabile via mouse
|
Constructor and Description |
---|
ColorPickPanel()
Crea un COlorePickPanel con selezionato il colore nero
|
ColorPickPanel(java.awt.Color old)
Crea un ColorPickPanel con selezionato il colore dato
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae)
Viene richiamato quando viene modificato il testo allegato agli sliders
|
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Viene richiamato quando vengono modificate le posizioni degli sliders
|
void |
colorChanged(GraphEvent e)
Viene richiamato dal ColorShades quando viene modificato il colore col mouse
|
java.awt.Color |
getColor()
Ritorna il colore selezionato
|
java.awt.Dimension |
getPreferredSize()
Ritorna la dimensione preferita del Panel
|
static void |
main(java.lang.String[] args) |
void |
setColor(java.awt.Color c)
Posiziona tutte le informazioni per rappresentare un dato colore
|
void |
setSlider()
Posiziona gli sliders in corrispondenza del colore selezionato
|
void |
textValueChanged(java.awt.event.TextEvent te)
Viene richiamato quando viene modificato il testo allegato agli sliders
|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
java.awt.Panel color
java.awt.Panel componentsPanel
ColorShades shades
java.awt.Scrollbar[] rgb
java.awt.TextField redTf
java.awt.TextField greenTf
java.awt.TextField blueTf
int r
int g
int b
public ColorPickPanel()
public ColorPickPanel(java.awt.Color old)
old
- il colore selezionato all'iniziopublic java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Container
public java.awt.Color getColor()
public void colorChanged(GraphEvent e)
colorChanged
in interface ColorChangeListener
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged
in interface java.awt.event.AdjustmentListener
public void setColor(java.awt.Color c)
c
- il colore da rappresentarepublic void setSlider()
public void textValueChanged(java.awt.event.TextEvent te)
textValueChanged
in interface java.awt.event.TextListener
te
- l'evento sul testo che viene gestitopublic void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
ae
- l'evento sul testo che viene gestitopublic static void main(java.lang.String[] args)