You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2006/09/01 18:57:45 UTC

DO NOT REPLY [Bug 40394] New: - Provide implementation of Icon interface in swing package

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394

           Summary: Provide implementation of Icon interface in swing
                    package
           Product: Batik
           Version: 1.6
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P1
         Component: (RFE) Request For Extension
        AssignedTo: batik-dev@xmlgraphics.apache.org
        ReportedBy: kirillcool@yahoo.com


The org.apache.batik.swing.svg provides Swing components that show SVG images.
However, there is no bundled support for the Icon interface. Since the
JGVTComponent extends the JComponent, it can't be used as a replacement for
existing Icon implementations. It doesn't have to be as "clever" as the
JGVTComponent and its extensions, but having painting / rendering transformation
support is a must.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From deweese@apache.org  2006-09-05 00:24 -------
Hi Kirill,

(In reply to comment #9)
> Where do i find that agreement to sign ICLA 

  Sorry I ment to include the link:
     http://www.apache.org/licenses/

> (hope it's OK and will not clash with my employer contract)? 

   This is exactly what the ICLA is ment to clarify, if you
can actually contribute code to an Apache Project.

> Last thing - about those * in imports. This is how i prefer them. 
> I just *hate* two-three page-long import sections :) But that's 
> just me. 

   I just hate having no clue what a file is really depending on ;)


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From kirillcool@yahoo.com  2006-09-03 07:16 -------
Thanks for the implementation you have provided. Is it possible to augment this
with resizability (as with the rendering transformation on the JGVTComponent)?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From cam@apache.org  2006-09-03 07:33 -------
No doubt it is possible.  For simple scaling, you can just pass in a different
width/height to the constructor.  For more complex transformations you could
perhaps clone the document to add in a transform attribute on the root, or
subclass the transcoder classes to do the same thing as the rendering transform
on a JGVTComponent.

Contributions are welcome. :)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From kirillcool@yahoo.com  2006-09-05 05:47 -------
Created an attachment (id=18819)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18819&action=view)
New implementation with support for thread pool


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394


cam@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Additional Comments From cam@apache.org  2006-09-03 07:00 -------
I agree, it probably would be handy to have such a class included in the
distribution.  Here is one I wrote a while ago (which isn't very clever), in
case you have a need for one: http://mcc.id.au/2005/04/SVGIcon.java

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From cam@apache.org  2006-09-03 22:19 -------
It is synchronous.  It just uses the transcoder to generate a BufferedImage the
first time it needs to draw the icon, then uses that in subsequent draws.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From kirillcool@yahoo.com  2006-09-05 05:53 -------
I just attached a new implementation that has support for thread pool. I've read
through the linked license and it's too much pain for me to understand / consult
at work / ... In addition, the thread pool implementation uses the new
concurrent stuff from 5.0 (Executors and ExecutorService) - i just can't justify
(for myself) to reinvent the wheel when my own project runs on 5.0. See comments
on 40393 about a possibility to depend on Apache Excalibur and their thread pool
- this is your decision if you want to provide support for this out of the box.

It's just too much hassle for me to do something that already exists in two
lines of code in JDK 5.0 by either implementing it myself / searching the web
for ASF-compliant implementation / copy-pasting stuff from Excalibur. 

The current implementation (attached) just extends your own code with stuff from
JGVTComponent + very simple support for resizing. Feel free to use it or any
other approach if you decide to implement it in the next Batik version. I just
don't feel very comfortable will that licensing / signing / lawyer-oriented
language. Sorry.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From deweese@apache.org  2006-09-04 23:38 -------
Hi Kirill,

   Thanks for the contribution!

   It is useful as a patch in Bugzilla but it would
be ideal if you could complete an Apache Individual
Contributor License Agreement (ICLA) which would 
allow us to make this part of Batik.

   From a short review of the code, A couple of other 
things would need to be done for us to add it to the 
Batik code base:

  1) It would have to be made compilable under JDK 1.3
     (the current target for Batik).  I see that it is
     using generics. I didn't see any really deep 
     dependencies.

  2) Something a little more elegant would need to be
     done with the rendering cache.  I think it will be
     problematic to have the cache grow without bound.

  3) Also a minor nit, remove the use of '*' in import
     statements.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From kirillcool@yahoo.com  2006-09-04 23:47 -------
Cameron,

Where do i find that agreement to sign ICLA (hope it's OK and will not clash
with my employer contract)? You're right about generics - i've wrote it in a 5.0
project, but the only thing there is for the image cache. I agree that it should
be bound (LinkedHashMap would be soooo great here). I need to find / write some
code to make the proper renderer thread pool. Hope it's not too complicated for 1.3.

Last thing - about those * in imports. This is how i prefer them. I just *hate*
two-three page-long import sections :) But that's just me. Feel free to hack at
that code in the meantime until i find a reasonable and robust thread pool
implementation. With any luck some other Apache project already has it...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From kirillcool@yahoo.com  2006-09-03 23:44 -------
Created an attachment (id=18815)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18815&action=view)
Extension for the Batik icon with resizability and asynchronous load

The attached class contains the implementation of Icon interface with
asynchronous load (copied and modified from JGVTComponent) and resizability
support (in setPreferredSize())

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From kirillcool@yahoo.com  2006-09-03 23:48 -------
I just attached the extended version of the class that you gave earlier. It
draws heavily from the asynchronous implementation of JGVTComponent (perhaps
this code can be extracted into a common layer) + resizability support in
setPreferredSize that schedules the rendering.

In my application i've extended this icon class with another one that registers
another GVT tree renderer listener and on completion calls a method on the
containing component asking it to redraw the icon. This way, the icon is loaded
asynchronously and the containing component is notified when it should redraw
the icon.

The only thing missing here for me - a static thread pool to dispatch the load
requests on a limited number of threads to prevent out of memory exceptions.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 40394] - Provide implementation of Icon interface in swing package

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40394>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40394





------- Additional Comments From kirillcool@yahoo.com  2006-09-03 18:26 -------
I was thinking about simple scaling, but not wanting to create a different icon
every time. SVG Salamander's implementation of SVGIcon has the
setPreferredSize() method that scales the internal representation to the correct
size. By the way, is the attached code synchronous or asynchronous (like
JGVTComponent)?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org