United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4233811 JEditorPane, HTMLEditorKit and ImageView - how to get the Image-Object
JDK-4233811 : JEditorPane, HTMLEditorKit and ImageView - how to get the Image-Object

Details
Type:
Enhancement
Submit Date:
1999-04-28
Status:
Resolved
Updated Date:
2002-03-07
Project Name:
JDK
Resolved Date:
2000-03-09
Component:
client-libs
OS:
windows_98
Sub-Component:
javax.swing
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.2.0
Fixed Versions:
1.4.0 (beta)

Related Reports

Sub Tasks

Description

Name: vi73552			Date: 04/28/99


I don't know, if my problem is a bug or a feature, or both?

I tried to get an Image from an loaded HTML-Site via HTMLEditorKit.setPage(URl url).

I found, that the class ImageView loads the Image from the URL. ImageView is created by the Method HTMLEditorKit.HTMLFactory.create(Element elem)...
( But all that you know too (or better :) ))

ImageView is a package-class, and has no method, to get the downloaded Image! that is more a feature problem than a bug.
->What about -making the class ImageView public (why is this class package (InlineView, ListView ... are public too!)
->           -adding a method to ImageView to return the Image 

Then:
In the class ImageView is a property called 
    static final String IMAGE_CACHE_PROPERTY = "imageCache";
but this property isn't yet used. (I don't know, but the cache would be the right place for getting the Images)

The third:
Is it possible to create a method in HTMLEditorKit, to abort the loading of a WebPage? (and still viewing the page with the Images, which are already loaded);

I only used the swing-version of jdk1.2 (the java-doc too)
but in the on-line version of the documentation swing1.1.1 (eary access) the class ImageView was still a package class.

In the class HTMLEditorKit.HTMLFactory in the javadoc-document is a table, which view is used for the tags (The table is one line! ->the writer forgotten some tags)
For Tag.IMG is the view ImageView - that is correct. But because the ImageView-class is package, there is no documentation for this class available - there is no way to find Information for the ImageView class (the souce-code, but ...)
(Review ID: 57116) 
======================================================================

                                    

Comments
EVALUATION

ImageView has been rewritten and will be public. The methods that are public/protected are now:

    public String getAltText() {
    public URL getImageURL() {
    public Icon getNoImageIcon() {
    public Icon getLoadingImageIcon() {
    public Image getImage() {
    public void setLoadsSynchronously(boolean newValue) {
    public boolean getLoadsSynchronously() {
    protected StyleSheet getStyleSheet() {
    protected void setPropertiesFromAttributes() {

scott.violet@eng 2000-02-28
                                     
2000-02-28
WORK AROUND



Name: vi73552			Date: 04/28/99


There is a way ... (or more ways) but it is very long.

I copied the source-Code of HTMLEditorKit.
My new class extends the HTMLEditorKit.

I changed the method in the subclass HTMLEditorKit.HTMLFactory
by returning not an new ImageView(Element elem)but my class MyImageView. this class has a method called public Image getImage() :)
======================================================================
                                     
2004-06-11
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
merlin-beta

FIXED IN:
merlin-beta

INTEGRATED IN:
merlin-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together