|
From: Liu Z. <ntu...@ya...> - 2001-12-18 06:36:16
|
Hihi,
The problem with ColorDialog seems to be caused by the Scrollbar in
ColorPicker. We need to set the maximum value to 265, instead of 255, to
include the width of the scroll bar bubble, whose default value I guess is
10. Below are the changes that I have made.
cvs -q diff ColorPicker.java (in directory
C:\Zehua\Work\src\geotools\src\uk\ac\leeds\ccg\widgets\)
Password: Index: ColorPicker.java
===================================================================
RCS file:
/cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/widgets/ColorPicker.java,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ColorPicker.java
*** ColorPicker.java 2000/04/14 09:18:51 1.1.1.1
--- ColorPicker.java 2001/12/18 06:29:17
***************
*** 18,26 ****
sliders.setLayout(new GridLayout(1,3));
rgb = new Scrollbar[3];
for(int i=0;i<3;i++){
! rgb[i] = new Scrollbar();
! rgb[i].setMaximum(255);
! rgb[i].setMinimum(0);
rgb[i].addAdjustmentListener(this);
sliders.add(rgb[i]);
}
--- 18,26 ----
sliders.setLayout(new GridLayout(1,3));
rgb = new Scrollbar[3];
for(int i=0;i<3;i++){
! rgb[i] = new Scrollbar(Scrollbar.VERTICAL, 0, 10, 0, 265);
! //rgb[i].setMaximum(255);
! //rgb[i].setMinimum(0);
rgb[i].addAdjustmentListener(this);
sliders.add(rgb[i]);
}
Regards,
Liu Zehua
Project Officer
Centre for Advanced Information Systems
Nanyang Technological University, Singapore
----- Original Message -----
From: "Liu Zehua" <ntu...@ya...>
To: <geo...@li...>
Sent: Tuesday, December 18, 2001 11:48 AM
Subject: [Geotools-devel] ColorPickLabel
> Hihi,
>
> I am using ColorPickLabel in widgets subpackage.
>
> I found that the label [r,g,b] does not reflect the changes of the color.
> More specifically, when someone double click and use the popup dialog to
> change the color, the background color of this label is changed, but the
> [r,g,b] text is not changed.
>
> This might be fixed by adding a line of code to change the text of the
label
> in the method setPickColor() when new color is set.
> Below are the suggested changes. It seems working fine on my machine.
>
>
> cvs -q diff ColorPickLabel.java (in directory
> C:\Zehua\Work\src\geotools\src\uk\ac\leeds\ccg\widgets\)
> Password: Index: ColorPickLabel.java
> ===================================================================
> RCS file:
>
/cvsroot/geotools/geotools/src/uk/ac/leeds/ccg/widgets/ColorPickLabel.java,v
> retrieving revision 1.5
> diff -c -r1.5 ColorPickLabel.java
> *** ColorPickLabel.java 2001/04/04 08:54:38 1.5
> --- ColorPickLabel.java 2001/12/18 03:36:01
> ***************
> *** 25,30 ****
> --- 25,32 ----
> public void setPickColor(java.awt.Color propValue)
> {
> setBackground(propValue);
> +
>
setText("["+propValue.getRed()+","+propValue.getGreen()+","+propValue.getBlu
> e()+"]");
> + if(DEBUG)System.out.println("CoPL>Color set to
>
["+propValue.getRed()+","+propValue.getGreen()+","+propValue.getBlue()+"]");
> changes.firePropertyChange("pickColor", getPickColor(), propValue);
> }
>
>
> The other problem is about ColorDialog. When the slider is set to minimum,
> it seems to return a value of 10, instead of 0. I am not able to suggest
any
> fix, as I have not looked at the code yet. Going to do that soon.
>
>
> These kinds of problem seem to small to be put into the bug list. I am not
> sure whether this way of fixing them appropriate? any opinion?
>
>
> Regards,
>
> Liu Zehua
> Project Officer
> Centre for Advanced Information Systems
> Nanyang Technological University, Singapore
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|