| Modifier and Type | Class and Description |
|---|---|
| private static class | GTKColorChooserPanel.
Action class used for colors. |
| private class | GTKColorChooserPanel.
Class responsible for rendering a color wheel and color triangle. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private JSpinner | |
| private float | |
| private JTextField | |
| private static final int | FLAGS_CHANGED_ANGLE
Flag indicating the angle, or hue, has changed and the triangle needs to be recreated. |
| private static final int | FLAGS_DRAGGING
Indicates the wheel is being dragged. |
| private static final int | FLAGS_DRAGGING_TRIANGLE
Indicates the triangle is being dragged. |
| private static final int | FLAGS_FOCUSED_TRIANGLE
Indicates the triangle has focus. |
| private static final int | FLAGS_FOCUSED_WHEEL
Indicates the wheel has focus. |
| private static final int | FLAGS_SETTING_COLOR
Indicates a color is being set and we should ignore setColor |
| private JSpinner | |
| private float | |
| private JSpinner | |
| private JLabel | |
| private JLabel | |
| private static final float | |
| private JSpinner | |
| private float | |
| private JSpinner | |
| private boolean | |
| private GTKColorChooserPanel. | |
| private JSpinner |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | add(Container parent, String key, JComponent widget, int x, int y)
Adds the widget creating a JLabel with the specified name. |
| protected void | buildChooser()
Implements abstract javax. Builds and configures the widgets for the GTKColorChooserPanel. |
| pack-priv static void | compositeRequestFocus(Component component, boolean direction)
Convenience method to transfer focus to the next child of component. |
| private void | |
| private float | |
| public Color | |
| public int | getDisplayedMnemonicIndex()
Overrides javax. Character to underline that represents the mnemonic. |
| public String | getDisplayName()
Implements abstract javax. Returns a user presentable description of this GTKColorChooserPane. |
| private float | |
| public Icon | getLargeDisplayIcon()
Implements abstract javax. Returns the large display icon for the panel. |
| public int | getMnemonic()
Overrides javax. Returns the mnemonic to use with |
| private float | |
| public Icon | getSmallDisplayIcon()
Implements abstract javax. Returns the small display icon for the panel. |
| private void | |
| private void | |
| private void | |
| public void | setEnabled(boolean enabled)
Overrides javax. Sets whether or not this component is enabled. |
| private static void | |
| private void | |
| private void | |
| private void | setHue(float hue, boolean update)
Sets the hue of the selected color and updates the display if necessary. |
| private void | |
| private void | |
| private void | |
| private void | setSaturationAndBrightness(float s, float b, boolean update)
Sets the saturation and brightness and updates the display if necessary. |
| public void | stateChanged(ChangeEvent e)
Implements javax. ChangeListener method, updates the necessary display widgets. |
| public void | uninstallChooserPanel(JColorChooser enclosingChooser)
Overrides javax. Invoked when the panel is removed from the chooser. |
| public void | updateChooser()
Implements abstract javax. Refreshes the display from the model. |
| blueSpinner | back to summary |
|---|---|
| private JSpinner blueSpinner | |
| brightness | back to summary |
|---|---|
| private float brightness | |
| colorNameTF | back to summary |
|---|---|
| private JTextField colorNameTF | |
| FLAGS_CHANGED_ANGLE | back to summary |
|---|---|
| private static final int FLAGS_CHANGED_ANGLE Flag indicating the angle, or hue, has changed and the triangle needs to be recreated. | |
| FLAGS_DRAGGING | back to summary |
|---|---|
| private static final int FLAGS_DRAGGING Indicates the wheel is being dragged. | |
| FLAGS_DRAGGING_TRIANGLE | back to summary |
|---|---|
| private static final int FLAGS_DRAGGING_TRIANGLE Indicates the triangle is being dragged. | |
| FLAGS_FOCUSED_TRIANGLE | back to summary |
|---|---|
| private static final int FLAGS_FOCUSED_TRIANGLE Indicates the triangle has focus. | |
| FLAGS_FOCUSED_WHEEL | back to summary |
|---|---|
| private static final int FLAGS_FOCUSED_WHEEL Indicates the wheel has focus. | |
| FLAGS_SETTING_COLOR | back to summary |
|---|---|
| private static final int FLAGS_SETTING_COLOR Indicates a color is being set and we should ignore setColor | |
| greenSpinner | back to summary |
|---|---|
| private JSpinner greenSpinner | |
| hue | back to summary |
|---|---|
| private float hue | |
| hueSpinner | back to summary |
|---|---|
| private JSpinner hueSpinner | |
| label | back to summary |
|---|---|
| private JLabel label | |
| lastLabel | back to summary |
|---|---|
| private JLabel lastLabel | |
| PI_3 | back to summary |
|---|---|
| private static final float PI_3 | |
| redSpinner | back to summary |
|---|---|
| private JSpinner redSpinner | |
| saturation | back to summary |
|---|---|
| private float saturation | |
| saturationSpinner | back to summary |
|---|---|
| private JSpinner saturationSpinner | |
| settingColor | back to summary |
|---|---|
| private boolean settingColor | |
| triangle | back to summary |
|---|---|
| private GTKColorChooserPanel. | |
| valueSpinner | back to summary |
|---|---|
| private JSpinner valueSpinner | |
| GTKColorChooserPanel | back to summary |
|---|---|
| pack-priv GTKColorChooserPanel() | |
| add | back to summary |
|---|---|
| private void add(Container parent, String key, JComponent widget, int x, int y) Adds the widget creating a JLabel with the specified name. | |
| buildChooser | back to summary |
|---|---|
| protected void buildChooser() Implements abstract javax. Builds and configures the widgets for the GTKColorChooserPanel.
| |
| compositeRequestFocus | back to summary |
|---|---|
| pack-priv static void compositeRequestFocus(Component component, boolean direction) Convenience method to transfer focus to the next child of component. | |
| configureSpinner | back to summary |
|---|---|
| private void configureSpinner(JSpinner spinner, String name) Configures the spinner. | |
| getBrightness | back to summary |
|---|---|
| private float getBrightness() Returns the brightness. | |
| getColor | back to summary |
|---|---|
| public Color getColor() | |
| getDisplayedMnemonicIndex | back to summary |
|---|---|
| public int getDisplayedMnemonicIndex() Overrides javax. Character to underline that represents the mnemonic.
| |
| getDisplayName | back to summary |
|---|---|
| public String getDisplayName() Implements abstract javax. Returns a user presentable description of this GTKColorChooserPane.
| |
| getHue | back to summary |
|---|---|
| private float getHue() Returns the current amount of hue. | |
| getLargeDisplayIcon | back to summary |
|---|---|
| public Icon getLargeDisplayIcon() Implements abstract javax. Doc from javax. Returns the large display icon for the panel.
| |
| getMnemonic | back to summary |
|---|---|
| public int getMnemonic() Overrides javax. Returns the mnemonic to use with
| |
| getSaturation | back to summary |
|---|---|
| private float getSaturation() Returns the saturation. | |
| getSmallDisplayIcon | back to summary |
|---|---|
| public Icon getSmallDisplayIcon() Implements abstract javax. Doc from javax. Returns the small display icon for the panel.
| |
| setBlue | back to summary |
|---|---|
| private void setBlue(int blue) Resets the blue component of the selected color. | |
| setBrightness | back to summary |
|---|---|
| private void setBrightness(float brightness) Sets the brightness. | |
| setColor | back to summary |
|---|---|
| private void setColor(Color color, boolean updateSpinners, boolean updateHSB, boolean updateModel) Rests the color.
| |
| setEnabled | back to summary |
|---|---|
| public void setEnabled(boolean enabled) Overrides javax. Doc from javax. Sets whether or not this component is enabled. A component that is enabled may respond to user input, while a component that is not enabled cannot respond to user input. Some components may alter their visual representation when they are disabled in order to provide feedback to the user that they cannot take input. Note Disabling a component does not disable its children. Note Disabling a lightweight component does not prevent it from receiving MouseEvents.
| |
| setEnabled | back to summary |
|---|---|
| private static void setEnabled(Container container, boolean enabled) | |
| setGreen | back to summary |
|---|---|
| private void setGreen(int green) Resets the green component of the selected color. | |
| setHSB | back to summary |
|---|---|
| private void setHSB(float h, float s, float b) Resets the hsb values. | |
| setHue | back to summary |
|---|---|
| private void setHue(float hue, boolean update) Sets the hue of the selected color and updates the display if necessary. | |
| setRed | back to summary |
|---|---|
| private void setRed(int red) Resets the red component of the selected color. | |
| setRGB | back to summary |
|---|---|
| private void setRGB(int rgb) Resets the rgb values. | |
| setSaturation | back to summary |
|---|---|
| private void setSaturation(float saturation) Resets the saturation. | |
| setSaturationAndBrightness | back to summary |
|---|---|
| private void setSaturationAndBrightness(float s, float b, boolean update) Sets the saturation and brightness and updates the display if necessary. | |
| stateChanged | back to summary |
|---|---|
| public void stateChanged(ChangeEvent e) Implements javax. ChangeListener method, updates the necessary display widgets.
| |
| uninstallChooserPanel | back to summary |
|---|---|
| public void uninstallChooserPanel(JColorChooser enclosingChooser) Overrides javax. Doc from javax. Invoked when the panel is removed from the chooser.
If override this, be sure to call
| |
| updateChooser | back to summary |
|---|---|
| public void updateChooser() Implements abstract javax. Refreshes the display from the model.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | actionPerformed(ActionEvent e)
Implements java. Invoked when an action occurs. |
| type | back to summary |
|---|---|
| private int type | |
| ColorAction | back to summary |
|---|---|
| pack-priv ColorAction(String name, int type) | |
| actionPerformed | back to summary |
|---|---|
| public void actionPerformed(ActionEvent e) Implements java. Doc from java. Invoked when an action occurs.
| |
| Modifier and Type | Field and Description |
|---|---|
| private double | angle
Angle triangle is rotated by. |
| private int | circleX
X location of selected color indicator. |
| private int | circleY
Y location of selected color indicator. |
| private int | flags
Hides javax. |
| private Image | triangleImage
Cached image of the triangle. |
| private Image | wheelImage
Cached image of the wheel. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | Returns: true if the location is valid.X location to adjust to, relative to the origin of the
wheel x, int Y location to adjust to, relative to the origin of the
wheel y, boolean if true the location is checked to make sure
it is contained in the wheel, if false the location is
constrained to fit in the wheel check)Adjusts the hue based on the passed in location. |
| pack-priv boolean | Returns: true if the location is validX coordinate on the triangle to adjust to x, int Y coordinate on the triangle to adjust to y, boolean if true the location is checked to make sure
it is contained in the triangle, if false the location is
constrained to fit in the triangle. checkLoc)Adjusts the saturation and brightness. |
| private int | Returns: integer with red, green and blue componentsX location to get color for x, int Y location to get color for y, double Radius from center of color wheel rad)Returns the RGB color to use for the specified location. |
| pack-priv void | |
| pack-priv void | |
| public Color | |
| pack-priv int | |
| pack-priv int | |
| pack-priv GTKColorChooserPanel | |
| private Image | |
| private int | |
| private int | |
| private Image | Returns: Color wheel imageInteger giving size of color wheel. size)Returns a color wheel image for the specified size. |
| private int | |
| private int | |
| private int | |
| private int | |
| pack-priv void | |
| private boolean | |
| pack-priv boolean | |
| public void | paintComponent(Graphics g)
Overrides javax. Calls the UI delegate's paint method, if the UI delegate
is non- |
| private void | |
| protected void | processEvent(AWTEvent e)
Overrides java. Processes events on this container. |
| private void | |
| public void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | setSaturationAndBrightness(float s, float b, int newCircleX, int newCircleY)
Sets the saturation and brightness. |
| angle | back to summary |
|---|---|
| private double angle Angle triangle is rotated by. | |
| circleX | back to summary |
|---|---|
| private int circleX X location of selected color indicator. | |
| circleY | back to summary |
|---|---|
| private int circleY Y location of selected color indicator. | |
| flags | back to summary |
|---|---|
| private int flags Hides javax. Boolean bitmask. | |
| triangleImage | back to summary |
|---|---|
| private Image triangleImage Cached image of the triangle. | |
| wheelImage | back to summary |
|---|---|
| private Image wheelImage Cached image of the wheel. | |
| ColorTriangle | back to summary |
|---|---|
| public ColorTriangle() | |
| adjustHue | back to summary |
|---|---|
| private boolean adjustHue(int x, int y, boolean check) Adjusts the hue based on the passed in location.
| |
| adjustSB | back to summary |
|---|---|
| pack-priv boolean adjustSB(int x, int y, boolean checkLoc) Adjusts the saturation and brightness.
| |
| colorWheelLocationToRGB | back to summary |
|---|---|
| private int colorWheelLocationToRGB(int x, int y, double rad) Returns the RGB color to use for the specified location. The passed in point must be on the color wheel and be relative to the origin of the color wheel.
| |
| focusTriangle | back to summary |
|---|---|
| pack-priv void focusTriangle() Gives focus to the triangle. | |
| focusWheel | back to summary |
|---|---|
| pack-priv void focusWheel() Gives focus to the wheel. | |
| getColor | back to summary |
|---|---|
| public Color getColor() Returns the selected color. | |
| getColorX | back to summary |
|---|---|
| pack-priv int getColorX() Returns the x location of the selected color indicator. | |
| getColorY | back to summary |
|---|---|
| pack-priv int getColorY() Returns the y location of the selected color indicator. | |
| getGTKColorChooserPanel | back to summary |
|---|---|
| pack-priv GTKColorChooserPanel getGTKColorChooserPanel() Returns the GTKColorChooserPanel. | |
| getImage | back to summary |
|---|---|
| private Image getImage(int size) Returns an image representing the triangle and wheel. | |
| getIndicatorSize | back to summary |
|---|---|
| private int getIndicatorSize() Returns the size of the color indicator. | |
| getTriangleCircumscribedRadius | back to summary |
|---|---|
| private int getTriangleCircumscribedRadius() Returns the circumscribed radius of the triangle. | |
| getWheelImage | back to summary |
|---|---|
| private Image getWheelImage(int size) Returns a color wheel image for the specified size.
| |
| getWheelRadius | back to summary |
|---|---|
| private int getWheelRadius() Returns the radius of the wheel. | |
| getWheelWidth | back to summary |
|---|---|
| private int getWheelWidth() Returns the width of the wheel. | |
| getWheelXOrigin | back to summary |
|---|---|
| private int getWheelXOrigin() Returns the x origin of the wheel and triangle. | |
| getWheelYOrigin | back to summary |
|---|---|
| private int getWheelYOrigin() Returns y origin of the wheel and triangle. | |
| incrementHue | back to summary |
|---|---|
| pack-priv void incrementHue(boolean positive) Increments the hue. | |
| isSet | back to summary |
|---|---|
| private boolean isSet(int flag) Returns true if a particular flag has been set. | |
| isWheelFocused | back to summary |
|---|---|
| pack-priv boolean isWheelFocused() Returns true if the wheel currently has focus. | |
| paintComponent | back to summary |
|---|---|
| public void paintComponent(Graphics g) Overrides javax. Doc from javax. Calls the UI delegate's paint method, if the UI delegate
is non-
If you override this in a subclass you should not make permanent
changes to the passed in
The passed in
| |
| paintTriangle | back to summary |
|---|---|
| private void paintTriangle(Graphics g, int size, Color color) | |
| processEvent | back to summary |
|---|---|
| protected void processEvent(AWTEvent e) Overrides java. Doc from java. Processes events on this container. If the event is a
Note that if the event parameter is
| |
| setAngleFromHue | back to summary |
|---|---|
| private void setAngleFromHue(float hue) Rotates the triangle to accommodate the passed in hue. | |
| setColor | back to summary |
|---|---|
| public void setColor(float h, float s, float b) Resets the selected color. | |
| setFlag | back to summary |
|---|---|
| private void setFlag(int flag, boolean value) Hides javax. Updates the flags bitmask. | |
| setFocusType | back to summary |
|---|---|
| private void setFocusType(int type) Sets the focus to one of: 0 no one, 1 the wheel or 2 the triangle. | |
| setHueAngle | back to summary |
|---|---|
| private void setHueAngle(double angle) Sets the angle representing the hue. | |
| setSaturationAndBrightness | back to summary |
|---|---|
| private void setSaturationAndBrightness(float s, float b) Sets the saturation and brightness. | |
| setSaturationAndBrightness | back to summary |
|---|---|
| private void setSaturationAndBrightness(float s, float b, int newCircleX, int newCircleY) Sets the saturation and brightness. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isOpaque()
Overrides javax. Returns true if this component is completely opaque. |
| OpaqueLabel | back to summary |
|---|---|
| private OpaqueLabel() | |
| isOpaque | back to summary |
|---|---|
| public boolean isOpaque() Overrides javax. Doc from javax. Returns true if this component is completely opaque. An opaque component paints every pixel within its rectangular bounds. A non-opaque component paints only a subset of its pixels or none at all, allowing the pixels underneath it to "show through". Therefore, a component that does not fully paint its pixels provides a degree of transparency. Subclasses that guarantee to always completely paint their contents should override this method and return true.
| |