Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.services.swingx

Class XColorPanel

com.gentleware.services.swingx.XColorPanel

public class XColorPanel


XColorPanel shows a matrix of colors (colored rectangles) and fires an action event when the user picks one of it.


 Attribute Summary
private static int  COLOR_BOX_GAP_X
The horizontal gap between color boxes. 
private static int  COLOR_BOX_GAP_Y
The vertical gap between color boxes. 
private static int  COLOR_BOX_MAX_HEIGHT
 
private static int  COLOR_BOX_MAX_WIDTH
 
private static int  COLOR_BOX_MIN_HEIGHT
 
private static int  COLOR_BOX_MIN_WIDTH
 
private static int  COLOR_BOX_PREFERRED_HEIGHT
 
private static int  COLOR_BOX_PREFERRED_WIDTH
 
public static int  X_AXIS
Specifies that components should be laid out left to right. 
public static int  Y_AXIS
Specifies that components should be laid out top to bottom. 
private static Border  _colorBoxBorder
The border for each color box, that holds a non-null, not selected color. 
private static Border  _colorBoxCurrentColorBorder
The border for the color box that holds the currently selected color. 
private static Border  _colorBoxNoColorBorder
The border for any color box, that does not currently hold a color. 
private int  _columnCount
 
private int  _rowCount
 
arrow_up
 

 Association Summary
private Color  _backgroundColor
the default background color  
private Color  _colorBoxDefaultColor
the color in which a color box is painted, if it does not have a color set explicitly  
private Color  _colorBoxDisabledColor
the color in which each color box is painted, if the color panel is disabled  
private Color[]  _colors
 
private Color  _currentColor
The currently selected color, may be null  
private ActionListener  _listener
 
private MouseListener  _mouseListener
 
public XColorPicker  xColorPicker
 
public XColorPicker  xColorPicker_1
 
public XColorPicker  xColorPicker_2
 
arrow_up
 

 Constructor Summary
public   XColorPanel(ActionListener listener, Color currentColor, int divisions)
Construct a color panel using an equal distribution of red, green and blue values with n divisions on each axis. 
public   XColorPanel(ActionListener listener, Color currentColor, int hueFactor, float[][] saturationAndBrightness)
 
public   XColorPanel(ActionListener listener, Color currentColor, int hueFactor, int saturationCount, int brightnessCount)
Construct a color panel using a HSB color model. 
public   XColorPanel(ActionListener listener, Color currentColor, int shades, int axis)
Creates a color panel that shows white, shades of gray and black. 
public   XColorPanel(ActionListener listener, Color currentColor, int columnCount, int rowCount, String colorText)
 
arrow_up
 

 Method Summary
public void   ensureContainsCurrentColor()
Ensure that this color panel contains the selected color: If it does not yet contain the color, the first empty color box is set to the current color. 
private Color   getColor(int columnIndex, int rowIndex)
 
private Color   getColorAt(Point point)
 
private int   getColorBoxHeight()
 
private int   getColorBoxWidth()
 
public String   getColorText()
 
private String   getConfigColor(Color color)
 
public Color   getCurrentColor()
 
private float[]   getHues(int hueFactor)
Create an array of hues using hueFactory multiples of the six primary colors  
public Dimension   getMaximumSize()
 
public Dimension   getMinimumSize()
 
public Dimension   getPreferredSize()
 
public String   getToolTipText(MouseEvent event)
 
private void   handleMouseClick(MouseEvent mouseEvent)
 
private void   init()
Initialization code common to all constructors  
private Color   makeColor(String configText)
 
private static Color   makeColor(float r, float g, float b)
Construct a color using red, green and blue float values in the range [0,255]. 
private void   paintColorBox(Graphics graphics, Color color, int x, int y, int width, int height)
 
protected void   paintComponent(Graphics graphics)
 
public void   setColors(String colorText)
 
public void   setCurrentColor(Color currentColor)
 
arrow_up
 

Tagged Values
static false
gentleware-imported-line-number 17
gentleware-imported-package-statement-line-number 1
 

 Attribute Detail

COLOR_BOX_GAP_X

private static int COLOR_BOX_GAP_X

The horizontal gap between color boxes. Is also not to the left and right.  
arrow_up


COLOR_BOX_GAP_Y

private static int COLOR_BOX_GAP_Y

The vertical gap between color boxes. Is also not to the top and bottom.  
arrow_up


COLOR_BOX_MAX_HEIGHT

private static int COLOR_BOX_MAX_HEIGHT

arrow_up


COLOR_BOX_MAX_WIDTH

private static int COLOR_BOX_MAX_WIDTH

arrow_up


COLOR_BOX_MIN_HEIGHT

private static int COLOR_BOX_MIN_HEIGHT

arrow_up


COLOR_BOX_MIN_WIDTH

private static int COLOR_BOX_MIN_WIDTH

arrow_up


COLOR_BOX_PREFERRED_HEIGHT

private static int COLOR_BOX_PREFERRED_HEIGHT

arrow_up


COLOR_BOX_PREFERRED_WIDTH

private static int COLOR_BOX_PREFERRED_WIDTH

arrow_up


X_AXIS

public static int X_AXIS

Specifies that components should be laid out left to right.  
arrow_up


Y_AXIS

public static int Y_AXIS

Specifies that components should be laid out top to bottom.  
arrow_up


_colorBoxBorder

private static Border _colorBoxBorder

The border for each color box, that holds a non-null, not selected color.  
arrow_up


_colorBoxCurrentColorBorder

private static Border _colorBoxCurrentColorBorder

The border for the color box that holds the currently selected color.  
arrow_up


_colorBoxNoColorBorder

private static Border _colorBoxNoColorBorder

The border for any color box, that does not currently hold a color.  
arrow_up


_columnCount

private int _columnCount

arrow_up


_rowCount

private int _rowCount

arrow_up
 Association Detail

_backgroundColor

private Color _backgroundColor

the default background color  
arrow_up


_colorBoxDefaultColor

private Color _colorBoxDefaultColor

the color in which a color box is painted, if it does not have a color set explicitly  
arrow_up


_colorBoxDisabledColor

private Color _colorBoxDisabledColor

the color in which each color box is painted, if the color panel is disabled  
arrow_up


_colors

private Color[] _colors

arrow_up


_currentColor

private Color _currentColor

The currently selected color, may be null  
arrow_up


_listener

private ActionListener _listener

arrow_up


_mouseListener

private MouseListener _mouseListener

arrow_up


xColorPicker

public XColorPicker xColorPicker

arrow_up


xColorPicker_1

public XColorPicker xColorPicker_1

arrow_up


xColorPicker_2

public XColorPicker xColorPicker_2

arrow_up
 Constructor Detail

XColorPanel

public com.gentleware.services.swingx.XColorPanel XColorPanel(ActionListener listener, Color currentColor, int divisions)


Construct a color panel using an equal distribution of red, green and blue values with n divisions on each axis. Not particulary useful: There will be too many shades of blue and green.  
Parameters:
listener -
currentColor -
divisions -
Returns:
arrow_up


XColorPanel

public com.gentleware.services.swingx.XColorPanel XColorPanel(ActionListener listener, Color currentColor, int hueFactor, float[][] saturationAndBrightness)

Parameters:
listener -
currentColor -
hueFactor -
saturationAndBrightness -
Returns:
arrow_up


XColorPanel

public com.gentleware.services.swingx.XColorPanel XColorPanel(ActionListener listener, Color currentColor, int hueFactor, int saturationCount, int brightnessCount)


Construct a color panel using a HSB color model. Uses the six primary colors defined in the chromatic color naming system: red, orange, yellow, green, blue, violett Additional hues are created as specified by the hueFactor (e.g. hueFactor = 4 means there are quarter steps in between.  
Parameters:
listener -
currentColor -
hueFactor -
saturationCount -
brightnessCount -
Returns:
arrow_up


XColorPanel

public com.gentleware.services.swingx.XColorPanel XColorPanel(ActionListener listener, Color currentColor, int shades, int axis)


Creates a color panel that shows white, shades of gray and black.  
Parameters:
listener -
currentColor -
shades -
axis -
Returns:
arrow_up


XColorPanel

public com.gentleware.services.swingx.XColorPanel XColorPanel(ActionListener listener, Color currentColor, int columnCount, int rowCount, String colorText)

Parameters:
listener -
currentColor -
columnCount -
rowCount -
colorText -
Returns:
arrow_up
 Method Detail

ensureContainsCurrentColor

public void ensureContainsCurrentColor()


Ensure that this color panel contains the selected color: If it does not yet contain the color, the first empty color box is set to the current color. If no color box is empty, then all colors are shifted left (the first (top-left) color is lost) and the last color box is set to the current color.  
arrow_up


getColor

private Color getColor(int columnIndex, int rowIndex)

Parameters:
columnIndex -
rowIndex -
Returns:
arrow_up


getColorAt

private Color getColorAt(Point point)

Parameters:
point -
Returns:
arrow_up


getColorBoxHeight

private int getColorBoxHeight()

Returns:
arrow_up


getColorBoxWidth

private int getColorBoxWidth()

Returns:
arrow_up


getColorText

public String getColorText()

Returns:
arrow_up


getConfigColor

private String getConfigColor(Color color)

Parameters:
color -
Returns:
arrow_up


getCurrentColor

public Color getCurrentColor()

Returns:
arrow_up


getHues

private float[] getHues(int hueFactor)


Create an array of hues using hueFactory multiples of the six primary colors  
Parameters:
hueFactor -
Returns:
arrow_up


getMaximumSize

public Dimension getMaximumSize()

Returns:
arrow_up


getMinimumSize

public Dimension getMinimumSize()

Returns:
arrow_up


getPreferredSize

public Dimension getPreferredSize()

Returns:
arrow_up


getToolTipText

public String getToolTipText(MouseEvent event)

Parameters:
event -
Returns:
arrow_up


handleMouseClick

private void handleMouseClick(MouseEvent mouseEvent)

Parameters:
mouseEvent -
arrow_up


init

private void init()


Initialization code common to all constructors  
arrow_up


makeColor

private Color makeColor(String configText)

Parameters:
configText -
Returns:
arrow_up


makeColor

private static Color makeColor(float r, float g, float b)


Construct a color using red, green and blue float values in the range [0,255]. Values outside of this range are silently set to 0 resp. 255.  
Parameters:
r -
g -
b -
Returns:
arrow_up


paintColorBox

private void paintColorBox(Graphics graphics, Color color, int x, int y, int width, int height)

Parameters:
graphics -
color -
x -
y -
width -
height -
arrow_up


paintComponent

protected void paintComponent(Graphics graphics)

Parameters:
graphics -
arrow_up


setColors

public void setColors(String colorText)

Parameters:
colorText -
arrow_up


setCurrentColor

public void setCurrentColor(Color currentColor)

Parameters:
currentColor -
arrow_up
Created  2004 - 12 - 1

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.