Bug 52562 - API method for creating java.awt.Image from javax.swing.Icon
API method for creating java.awt.Image from javax.swing.Icon
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: -- Other --
4.x
All All
: P2 (vote)
: 6.x
Assigned To: _ rkubacki
issues@platform
: API, API_REVIEW_FAST
Depends on:
Blocks: 32101
  Show dependency treegraph
 
Reported: 2004-12-16 15:37 UTC by Tomas Zezula
Modified: 2008-12-22 16:43 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
patch for openide/util (3.59 KB, patch)
2006-07-04 09:41 UTC, _ rkubacki
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2004-12-16 15:37:08 UTC
There are several methods in the NetBeans API
which works woth Image and Icon types. The
conversion from Image to Icon is simple, but the
coversion in the opposite way is a bit tricky.
There should be a method doing it in the API (eg.
org.openide.Utilities).
Comment 1 Jesse Glick 2006-01-20 17:50:34 UTC
See at least:

DataFolder
core.execution.Install
apisupport.project.ui.UIUtil
j2seproject.ui.ProjectNode (and probably other copies)
PackageRootNode
Comment 2 _ rkubacki 2006-07-04 09:41:03 UTC
Created attachment 31614 [details]
patch for openide/util
Comment 3 _ rkubacki 2006-07-04 09:43:19 UTC
Looks like non-controversial and simple addition. I will fix mentioned places +
couple of other similar usages when applyig the patch
Comment 4 Jaroslav Tulach 2006-07-06 09:24:24 UTC
I believe this change shall ensure correct cooperation with other methods in 
IconManager. I guess it is desirable to be sure that for example:

Image img = Utilities.loadImage("...");
Icon icon = Utilities.image2Icon(img);
assertSame("load image is optimized for conversion to icon", img, icon);

and similar tests for Utilities.mergeImages and other utility methods in 
openide/util. Can such behaviour be ensured?
Comment 5 _ rkubacki 2006-07-10 13:20:16 UTC
To Jarda: added method is icon2Image so proposed test does not make sense.
Adding image2Icon can be considered in the future
Comment 6 _ rkubacki 2006-07-11 13:44:58 UTC
I am going to commit this.
Comment 7 _ rkubacki 2006-07-11 13:55:33 UTC
Checking in src/org/openide/util/Utilities.java;
/shared/data/ccvs/repository/openide/util/src/org/openide/util/Utilities.java,v
 <--  Utilities.java
new revision: 1.20; previous revision: 1.19
done
Checking in apichanges.xml;
/shared/data/ccvs/repository/openide/util/apichanges.xml,v  <--  apichanges.xml
new revision: 1.17; previous revision: 1.16
done
Checking in SerialDataNode.java;
/shared/data/ccvs/repository/core/settings/src/org/netbeans/modules/settings/convertors/SerialDataNode.java,v
 <--  SerialDataNode.java
new revision: 1.24; previous revision: 1.23
Checking in UIUtil.java;
/shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/UIUtil.java,v
 <--  UIUtil.java
new revision: 1.30; previous revision: 1.29
Checking in ProjectNode.java;
/shared/data/ccvs/repository/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/ProjectNode.java,v
 <--  ProjectNode.java
new revision: 1.11; previous revision: 1.10
Checking in ProjectNode.java;
/shared/data/ccvs/repository/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/logicalview/libraries/ProjectNode.java,v
 <--  ProjectNode.java
new revision: 1.10; previous revision: 1.9
done
Checking in LibrariesNode.java;
/shared/data/ccvs/repository/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/logicalview/libraries/LibrariesNode.java,v
 <--  LibrariesNode.java
new revision: 1.19; previous revision: 1.18
Checking in DataFolder.java;
/shared/data/ccvs/repository/openide/loaders/src/org/openide/loaders/DataFolder.java,v
 <--  DataFolder.java
new revision: 1.53; previous revision: 1.52
done
Checking in InstanceNode.java;
/shared/data/ccvs/repository/openide/loaders/src/org/openide/loaders/InstanceNode.java,v
 <--  InstanceNode.java
new revision: 1.10; previous revision: 1.9
Checking in Install.java;
/shared/data/ccvs/repository/core/execution/src/org/netbeans/core/execution/Install.java,v
 <--  Install.java
new revision: 1.29; previous revision: 1.28
Checking in Choosers.java;
/shared/data/ccvs/repository/tasklist/docscan/src/org/netbeans/modules/tasklist/docscan/Choosers.java,v
 <--  Choosers.java
new revision: 1.5; previous revision: 1.4
Checking in ProjectNode.java;
/shared/data/ccvs/repository/web/project/src/org/netbeans/modules/web/project/ui/ProjectNode.java,v
 <--  ProjectNode.java
new revision: 1.12; previous revision: 1.11
Comment 8 _ rkubacki 2006-07-17 14:50:15 UTC
fixing also module deps (except apisupport where Jesse reverted the change to be
compatible with 5.x).

$ nbcvs -q ci -m "fixing deps after adding Utilities.icon2Image (#52562)"
core/execution/nbproject/project.xml core/settings/nbproject/project.xml
j2ee/ejbjarproject/nbproject/project.xml java/j2seproject/nbproject/project.xml
openide/loaders/nbproject/project.xml tasklist/docscan/nbproject/project.xml
web/project/nbproject/project.xml openide/util/nbproject/project.xml
Checking in core/execution/nbproject/project.xml;
/shared/data/ccvs/repository/core/execution/nbproject/project.xml,v  <-- 
project.xml
new revision: 1.12; previous revision: 1.11
done
Checking in core/settings/nbproject/project.xml;
/shared/data/ccvs/repository/core/settings/nbproject/project.xml,v  <--  project.xml
new revision: 1.11; previous revision: 1.10
done
Checking in j2ee/ejbjarproject/nbproject/project.xml;
/shared/data/ccvs/repository/j2ee/ejbjarproject/nbproject/project.xml,v  <-- 
project.xml
new revision: 1.26; previous revision: 1.25
done
Checking in java/j2seproject/nbproject/project.xml;
/shared/data/ccvs/repository/java/j2seproject/nbproject/project.xml,v  <-- 
project.xml
new revision: 1.24; previous revision: 1.23
done
Checking in openide/loaders/nbproject/project.xml;
/shared/data/ccvs/repository/openide/loaders/nbproject/project.xml,v  <-- 
project.xml
new revision: 1.16; previous revision: 1.15
done
Checking in tasklist/docscan/nbproject/project.xml;
/shared/data/ccvs/repository/tasklist/docscan/nbproject/project.xml,v  <-- 
project.xml
new revision: 1.6; previous revision: 1.5
done
Checking in web/project/nbproject/project.xml;
/shared/data/ccvs/repository/web/project/nbproject/project.xml,v  <--  project.xml
new revision: 1.42; previous revision: 1.41
done

Comment 9 Jesse Glick 2006-07-17 15:43:56 UTC
Build was broken since openide/util was actually still left at 7.2! I think I
just fixed this. (openide/util/nbproject/project.properties 1.18)


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo