This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 56494 - A color chooser panel based on Robot.getPixelValue(x, y)
Summary: A color chooser panel based on Robot.getPixelValue(x, y)
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Property Editors (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2005-03-15 23:41 UTC by _ sandipchitale
Modified: 2008-12-22 11:02 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Implementation of the Color Sampler panel (6.97 KB, text/plain)
2005-03-15 23:42 UTC, _ sandipchitale
Details
Color Chooser Panel implementation (2.63 KB, text/plain)
2005-03-15 23:42 UTC, _ sandipchitale
Details
icon used for sampler button (978 bytes, image/gif)
2005-03-15 23:43 UTC, _ sandipchitale
Details
Executable jar file with an example. (43.78 KB, application/octet-stream)
2005-03-15 23:44 UTC, _ sandipchitale
Details
DesktopSampler NetBeans toolbar screenshot (16.58 KB, image/jpeg)
2005-08-22 22:48 UTC, _ sandipchitale
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ sandipchitale 2005-03-15 23:41:15 UTC
The java.awt.Robot class has an api to sample pixel value of any screen pixel. 
It can be used to build a color sampler panel that can be added to the 
JColorChoosers used inside NetBeans.
Comment 1 _ sandipchitale 2005-03-15 23:42:27 UTC
Created attachment 20861 [details]
Implementation of the Color Sampler panel
Comment 2 _ sandipchitale 2005-03-15 23:42:57 UTC
Created attachment 20862 [details]
Color Chooser Panel implementation
Comment 3 _ sandipchitale 2005-03-15 23:43:24 UTC
Created attachment 20863 [details]
icon used for sampler button
Comment 4 _ sandipchitale 2005-03-15 23:44:30 UTC
Created attachment 20864 [details]
Executable jar file with an example.
Comment 5 _ sandipchitale 2005-03-15 23:47:40 UTC
1. Save ColorSampler.java, ColorSampler.gif and 
ColorSamplerColorChooserPanel.java.
2. Compile ColorSampler.java and ColorSamplerColorChooserPanel.java
3. Run

> java ColorSamplerColorChooserPanel

Alternatively save ColorSampler.jar and run:

> java -jar ColorSampler.jar
Comment 6 _ sandipchitale 2005-03-17 21:07:42 UTC
Actually this may become part of J2SE Swing JFileChooser. I filed an RFE:

bug_id=6242279

It may take a day or two before it shows up in the external database.
Comment 7 _ sandipchitale 2005-08-22 22:47:04 UTC
A module based on the concept has been uploaded on the contrib website. Here 
are the details.

The DesktopSampler module installs a toolbar in NetBeans IDE which has a Color
Sampler and a Magnifier. (Note: Makes use of APIs from java.awt.Robot)

(See the attached screenshot)

Drag on the dropper icon to sample color from desktop. The sampled color is
displayed in the label and the color value is set in the text field. The color
value string is also copied to the system clipboard. Click on the pencil icon 
to
select different color string formats. Various popular formats are supported
that work  in HTML/CSS (such as #XXXXXX, rgb(r, g, b) or Java BeanInfo Java
initializer string (such as new Color(r,g,b) or NetBeans property sheet (such 
as
[r,g,b]).

Click on the magnifying glass icon to show the magnifier. Drag on the magnifier
label to magnify 16x16 area of desktop.

Double click on the sampled color label to show the JColorChooser with a
ColorSampler tab which makes use of the same components.

I use to sample colors from web pages etc while working with HTML/CSS/JSP files
(hence the different formats).

Here are the links to the files:

http://contrib.netbeans.org/files/documents/130/544/org-netbeans-modules-
desktopsampler.nbm
http://contrib.netbeans.org/files/documents/130/546/DesktopSampler4.2devmodulep
roject.zip
http://contrib.netbeans.org/files/documents/130/545/DesktopSampler4.1moduleproj
ect.zip
Comment 8 _ sandipchitale 2005-08-22 22:48:47 UTC
Created attachment 24137 [details]
DesktopSampler NetBeans toolbar screenshot
Comment 9 _ sandipchitale 2005-12-13 17:12:49 UTC
The DesktopSampler module has been checked in under "contrib/". Here is the 
link:

http://www.netbeans.org/source/browse/contrib/DesktopSampler/
Comment 10 Jiri Rechtacek 2008-10-16 16:00:56 UTC
It's not planned for long time. It's fair to close as WONTFIX