Rendering of an 8Bit-tiff with java.awt produces crap

Hi Folks,
i do a downsampling of tiff images. The source tiffs are colored 8 Bit greyscale with a 256 color-table. Now i have 2 possibilities to resample with java.awt:
1. the target-tiff is of 24Bit true color:
BufferedImage objDownsample = new BufferedImage(iTargetWidth, iTargetHeight, BufferedImage.TYPE_INT_RGB);The result is a perfect looking, but oversized tiff with 16 million colors each pixel.
2. the target-tiff is of 8Bit like the source-tiff:
BufferedImage objDownsample = new BufferedImage(iTargetWidth, iTargetHeight, BufferedImage.TYPE_BYTE_INDEXED,(IndexColorModel)image.getColorModel());The result is a small sized tiff image of 8Bit. Problem: it now has visible vertical stripes of two colors (which both composed result the source-color i assume).
Does anybody know what's wrong here and how to retrieve the 8Bit color-image without stripes?
Here comes the whole source:
    private BufferedImage resize(int newHeight, int newWidth, BufferedImage image) {
        int iTargetHeight = newHeight;
        int iTargetWidth = newWidth;
        //Create a BufferedImage that fits
        BufferedImage objDownsample = new BufferedImage(iTargetWidth, iTargetHeight, BufferedImage.TYPE_BYTE_INDEXED,(IndexColorModel)image.getColorModel());
        //A map with all necessary rendering hints to optimize the quality of the image
        Map<java.awt.RenderingHints.Key, java.lang.Object> obj_Map = new HashMap<java.awt.RenderingHints.Key, java.lang.Object>();       
        obj_Map.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
        obj_Map.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        obj_Map.put(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
      // Draw the scaled image
      Graphics2D graphics2D = objDownsample.createGraphics();
        graphics2D.addRenderingHints(obj_Map);
        graphics2D.drawImage(image, 0, 0, iTargetWidth, iTargetHeight, null);
        return objDownsample;
    }Thanks
Albrecht

As far as I can tell, this solution only allows compositing within the component that is currently being painted. What would be nice is if I could add a custom composite to say .. a JLabel, which paints based on the colors of the underlying pixel data (ie. from its parent container). In this way you could make a JLabel that always inverts the color of what's underneath.
Here, painting to the screen using a composite allows me to get the pixels underneath as the destination raster, the pixels in the JLabel as the source raster, and what actually gets painted which is the destination output raster.
If I paint to a BufferedImage instead, the composite's 'destination raster' is the new BufferedImage's default values which are all black. Thus compositing over this would not have the desired effects described above (inverting the underlying image for instance). The missing piece when rendering to the BufferedImage is first copying the underlying screen data into a BufferedImage before painting to it. How do I do that? Something tells me it's very difficult.

Similar Messages

  • Quality of Cursors created with java.awt.Toolkit(createCutsomCursor)

    Hi -
    I encountered a small problem while creating my own cursors for my Java application , I used the java.awt.Toolkit Objects createCustomCursor method to use a .GIF image as a cursor ... it worked but the quality of that cursor is horrible, the outline is rough ... I tried the same with a transparent PNG file afterwards unfortunately the same result , does anyone know why the quality is that bad or may this just be a problem of the choosen color pool ?
    Help would be very appreciated since I have no clue how to use .cur files ... seems like a non supported format , in case someone knows how to import those it would help a lot if you would drop some lines of code.
    I am currently using Java 2 SDK 1.4.0_01 , newest version.
    Thanks for you time and thanks in advance for possible answers
    -- Harald Scheckenbacher

    I noticed this problem too. It looks like the routine is generating cursors which are scaled to to the maximum size of the system. On my win XP system,
    Dimension dim = toolkit.getBestCursorSize(256, 256);
    int maxColors = toolkit.getMaximumCursorColors();
    return 32,32 and 256 respectively
    If I provide a 16x16, all the pixels have been pixel doubled. If I specify a 32x32 image, then the cursor looks perfect. This looks like a bug for the java folks. Not sure why someone would ever want a cursor image to be pixel scaled.
              

  • Problem with java.awt.MouseInfo or java.awt.event.*;

    I have a problem with the MouseInfo class. I think.. because in my mousePressed(MouseEvent event) method, I have this:
         public void mousePressed(MouseEvent event) {
              pInfo = mInfo.getPointerInfo();
              point = pInfo.getLocation();
              pointX = point.getX();
              pointY = point.getY();
              System.out.println("pointer is at: (" + (int)pointX + ", " + (int)pointY + ")");
         }I think you all could figure out what this does. I declared the variables at the top and I implemented MouseListener... when I click it doesnt tell me the X and Y coords.
    Alright, thanks. Any help appreciated.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MouseExample extends MouseAdapter implements Runnable {
        @Override
        public void mousePressed(MouseEvent event) {
            int x = event.getX();
            int y = event.getY();
            System.out.println("x=" + x + ", y=" + y);
        @Override
        public void run() {
            JLabel label = new JLabel("Click anywhere", SwingConstants.CENTER);
            label.setPreferredSize(new Dimension(300, 200));
            label.addMouseListener(this);
            JFrame f = new JFrame();
            f.getContentPane().add(label);
            f.pack();
            f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        public static void main(String[] args) {
            EventQueue.invokeLater(new MouseExample());
    }

  • Help with java.awt.Headless

    I added the following line to the catalina.sh file:
    JAVA_OPTS=-Djava.awt.headless=true
    My image was rendered the first time round but when I hit refresh it goes away and is replaced by just a black background. I have been working on this issue of rendering/resizing an image for months and I am just getting frustrated that I can 't seem to find out the problem.
    Here is my code:
    public static byte[] getResizedImage(byte[] imageData, int thumbWidth, int thumbHeight, int quality) throws IOException{
    //create instance of Image from byte array
    Image image = Toolkit.getDefaultToolkit().createImage(imageData);
    // determine thumbnail size from WIDTH and HEIGHT
    double thumbRatio = (double)thumbWidth / (double)thumbHeight;
    int imageWidth = image.getWidth(null);
    int imageHeight = image.getHeight(null);
    double imageRatio = (double)imageWidth / (double)imageHeight;
    if (thumbRatio < imageRatio) {
    thumbHeight = (int)(thumbWidth / imageRatio);
    } else {
    thumbWidth = (int)(thumbHeight * imageRatio);
    // draw original image to thumbnail image object and
    // scale it to the new size on-the-fly
    BufferedImage thumbImage = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D graphics2D = thumbImage.createGraphics();
    graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);
    // set quality of thumbnail and doing resizing
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
    JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(thumbImage);
    quality = Math.max(0, Math.min(quality, 100));
    param.setQuality((float)quality / 100.0f, false);
    encoder.setJPEGEncodeParam(param);
    encoder.encode(thumbImage);
    //return byte array
    return os.toByteArray();
    }

    MediaTracker mt = new MediaTracker(new Label());You say this is a servlet; this code is running within a J2EE app server, not where a user can see any GUI components. So the question in the first place is, why are you creating a Label GUI object in this code?
    Don't do that.

  • Weird problem with java.awt.Color

    I have a Compiled C program that launches a Java program. This java program always throws an UnsatisfiedLinkError when I attempt to construct a new Color object, unless the owner of the C program is one particular user and the group is admin. No other combination works.
    Any ideas?

    in nt & 2000, each user can have his/her own classpath - i assume that this is the same of unix. have you looked at whether the various users have the appropriate classpath settings?
    D

  • Can I build a GUI application with SWING only without [import java.awt.*;]

    I have seen several threads (in forums), books and tutorials about SWING and I see that they all mix SWING with AWT (I mean they import both Swing and AWT in their code).
    The conclusion that comes out is:
    It is good to learn about SWING and forget AWT as it won't be supported later. I have decided to do so, and I never include <<import java.awt.*;>> in my code.
    But I see that you cannot do much without <<import java.awt.*;>>. For example this line which changes the background color:
    <<frame.getContentPane().setBackground(Color.red)>>
    works only with <<import java.awt.*;>>. I have seen that codes in this and other forums import awt to change the background. Why is that?
    After all, I wonder, what can I do;
    My question is, can I change the background (and of course do all other things listener, buttons etc) without using <<import java.awt.*;>>.
    I would like to avoid using <<import java.awt.*;>> and using awt since my program will not work later.
    In addition, I believe there is no point to learn awt, which later will not exist.
    I know, I must have misunderstood something. I would appreceate it very much, if anyone could give me even a short answer.
    Thank you in advance,
    JMelsi

    Since swing is a layer on top of awt, AWT will exist for as long as swing does.
    If sun does ever remove AWT they will have to replace it something else swing can layer on to and you will probably only have to replace your import statements.
    The main difference is the way there drawn to the screen.
    You can do custom drawing on swing components but you can't on AWT.
    If your using a desktop PC system it's probably best to use swing just in case you wish to do some custom drawing.
    awt uses less memory than swing and is faster but swing can be extended. awt comes only as standard.
    Say for example you wish to implement a JButton with a ProgressBar below the button text, this can be done with swing!

  • Problem with Horizontal Scroll on java.awt.List

    I use the same code for a General Application as a CDC Application.
    I have no problem at all with the General Application but on the CDC I can't scroll to the right (horizontal).
    Why do I get this problem on the CDC application and not on a regular application?
    I use the PP-1.0 Profile for the CDC application. Does it not support horizontal scroll on java.awt.List?
    This is the code:
    * Main.java
    * Created on den 22 augusti 2007, 10:52
    package cdcapplication6;
    * @author  Erik Rothman
    public class Main extends java.awt.Frame {
        /** Creates new form Main */
        public Main() {
            initComponents();
              for (int i = 0; i < 10; i++) {
                   list1.add("Short text");
                   list1.add("Some very long text indeed. Some very long text indeed.");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            list1 = new java.awt.List();
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            add(list1, java.awt.BorderLayout.CENTER);
            pack();
        }// </editor-fold>                       
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {                         
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
        // Variables declaration - do not modify                    
        private java.awt.List list1;
        // End of variables declaration                  
    }

    I use the same code for a General Application as a CDC Application.
    I have no problem at all with the General Application but on the CDC I can't scroll to the right (horizontal).
    Why do I get this problem on the CDC application and not on a regular application?
    I use the PP-1.0 Profile for the CDC application. Does it not support horizontal scroll on java.awt.List?
    This is the code:
    * Main.java
    * Created on den 22 augusti 2007, 10:52
    package cdcapplication6;
    * @author  Erik Rothman
    public class Main extends java.awt.Frame {
        /** Creates new form Main */
        public Main() {
            initComponents();
              for (int i = 0; i < 10; i++) {
                   list1.add("Short text");
                   list1.add("Some very long text indeed. Some very long text indeed.");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            list1 = new java.awt.List();
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            add(list1, java.awt.BorderLayout.CENTER);
            pack();
        }// </editor-fold>                       
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {                         
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
        // Variables declaration - do not modify                    
        private java.awt.List list1;
        // End of variables declaration                  
    }

  • Problem with Java Print API ( awt ) : Migrated from 1.1 to 1.4

    We had migrated an application ( applet based) from Java 1.1.8 to java 1.4.
    We use the java.awt.print apis for printing data from our applications.
    There is difference in print quality after the migration. For e.g. if the data frame had a scroll bar when taken print out, the scroll bar was not visible in java1.1 version application but is being printed with java1.4 version.
    We are unable to find the cause of this problem. Any help in this regard would be of great help.
    Thanks in advance.

    Hi,
    thanks, this solved the problem.
    Thank you.
    Best regards,
    Peter

  • Web Service Wizards crash with java.lang.StackOverflowError

    Hi there!
    I'm desperately trying to integrate some Web Services into our Java project developed with NWDS 2.0.7 / WebAS 6.40. Unfortunately every time I try to create Virtual Interfaces or a Web Service within the Web Service Perspective, nothing happens.
    When I use File/New/Other/Web Service (New VI and WSD) the whole Developer Studio simply crashes with a java.lang.StackOverflowError.
    I restarted from scratch with a new project in a different workspace and everything went fine. So I think it's not a problem with my installation but with the project's configuration I want to create the Web Services in. Perhaps it's something to do with the .classpath or the such?
    Do you have any idea where I can start looking into for getting any hints, what's going wrong here?
    I've added a Configuration Details output for reference below. Any help is greatfully appreciated!
    Best regards,
       Frank
    *** Date: 15.02.05 09:29
    System properties:
    JDK1.3.1_HOME=C:ProgrammeJavaj2sdk1.4.2_04
    JDK1.4_HOME=C:ProgrammeJavaj2sdk1.4.2_04
    allUserDir=C:Dokumente und EinstellungenAll UsersAnwendungsdaten
    awt.toolkit=sun.awt.windows.WToolkit
    file.encoding=UTF-8
    file.encoding.pkg=sun.io
    file.separator=
    http.nonProxyHosts=
    java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob=sun.awt.windows.WPrinterJob
    java.class.path=C:ProgrammeSAPJDTeclipseSapStartup.jar
    java.class.version=48.0
    java.endorsed.dirs=C:ProgrammeJavaj2sdk1.4.2_04jrelibendorsed
    java.ext.dirs=C:ProgrammeJavaj2sdk1.4.2_04jrelibext
    java.home=C:ProgrammeJavaj2sdk1.4.2_04jre
    java.io.tmpdir=C:DOKUME1F2267LOKALE1Temp
    java.library.path=C:ProgrammeJavaj2sdk1.4.2_04 in;.;C:WINDOWSSystem32;C:WINDOWS;C:ProgrammeSAPJDTeclipse;c:sapdbprograms in;c:sapdbprogramspgm;C:PROGRA1RATIONALRATION1NUTCROOT in;C:PROGRA1RATIONALRATION1NUTCROOT inx11;C:PROGRA1RATIONALRATION1NUTCROOTmksnt;c:programmePVCSVMwin32 in;C:ProgrammeOracle.817 in;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:PROGRAMMESGEASY;C:cygwin in;C:ProgrammeRationalcommon;C:ProgrammeRationalClearQuest;C:ProgrammeRationalRoseTopLink;C:ProgrammeRationalRational Test;C:TIBCOTIBRVBIN;C:ProgrammeUltraEdit
    java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
    java.runtime.version=1.4.2_04-b05
    java.specification.name=Java Platform API Specification
    java.specification.vendor=Sun Microsystems Inc.
    java.specification.version=1.4
    java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory
    java.vendor=Sun Microsystems Inc.
    java.vendor.url=http://java.sun.com/
    java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
    java.version=1.4.2_04
    java.vm.info=mixed mode
    java.vm.name=Java HotSpot(TM) Client VM
    java.vm.specification.name=Java Virtual Machine Specification
    java.vm.specification.vendor=Sun Microsystems Inc.
    java.vm.specification.version=1.0
    java.vm.vendor=Sun Microsystems Inc.
    java.vm.version=1.4.2_04-b05
    line.separator=
    os.arch=x86
    os.name=Windows XP
    os.version=5.1
    path.separator=;
    proxyHost=http://http-proxy.hannover.is-energy.de
    proxyPort=8080
    proxySet=true
    sun.arch.data.model=32
    sun.boot.class.path=C:ProgrammeJavaj2sdk1.4.2_04jrelib
    t.jar;C:ProgrammeJavaj2sdk1.4.2_04jrelibi18n.jar;C:ProgrammeJavaj2sdk1.4.2_04jrelibsunrsasign.jar;C:ProgrammeJavaj2sdk1.4.2_04jrelibjsse.jar;C:ProgrammeJavaj2sdk1.4.2_04jrelibjce.jar;C:ProgrammeJavaj2sdk1.4.2_04jrelibcharsets.jar;C:ProgrammeJavaj2sdk1.4.2_04jreclasses
    sun.boot.library.path=C:ProgrammeJavaj2sdk1.4.2_04jre in
    sun.cpu.endian=little
    sun.cpu.isalist=pentium i486 i386
    sun.io.unicode.encoding=UnicodeLittle
    sun.java2d.fontpath=
    sun.os.patch.level=Service Pack 1
    user.country=DE
    user.dir=C:ProgrammeSAPJDTEclipse
    user.home=C:Dokumente und EinstellungenF2267
    user.language=de
    user.name=f2267
    user.timezone=Europe/Berlin
    user.variant=
    user.workspace=C:ProgrammeSAPJDTeclipse
    Features:
    com.sap.ip.me.mdk.developmentTools (2.5.1.1) "com.sap.ip.me.mdk.developmentTools"
    com.sap.java.ide (2.0.7) "com.sap.java.ide"
    com.togethersoft.togethersap (6.1.0) "com.togethersoft.togethersap"
    org.eclipse.gef (2.0.0) "org.eclipse.gef"
    org.eclipse.gef.source (2.0.0) "org.eclipse.gef.source"
    org.eclipse.jdt (2.1.2) "org.eclipse.jdt"
    org.eclipse.jdt.source (2.1.2) "org.eclipse.jdt.source"
    org.eclipse.pde (2.1.2) "org.eclipse.pde"
    org.eclipse.platform (2.1.2) "org.eclipse.platform"
    org.eclipse.platform.source (2.1.2) "org.eclipse.platform.source"
    org.eclipse.platform.win32 (2.1.2) "org.eclipse.platform.win32"
    org.eclipse.platform.win32.source (2.1.2) "org.eclipse.platform.win32.source"
    org.eclipse.sdk.win32 (2.1.2) "org.eclipse.sdk.win32"
    Plug-in Registry:
    com.sap.bc.proj.jstartup (2.0.0) "J2EE Jstartup"
    com.sap.cms.client (2.0.0) "Infrastructure CMS Client"
    com.sap.cms.organizer (1.0.0) "Infrastructure CMS Transport Organizer"
    com.sap.cms.tcs (2.0.0) "Infrastructure TCS Deploy Servlet"
    com.sap.devmanual.doc.user (2.0.0) "Documentation Development Manual"
    com.sap.dictionary.database (2.0.0) "Dictionary Database"
    com.sap.dictionary.designtime (1.0.0) "Dictionary Types Designtime"
    com.sap.dictionary.projectbrowser (2.0.0) "Dictionary Project Browser"
    com.sap.dictionary.runtime (2.0.0) "Dictionary Types Runtime"
    com.sap.dictionary.runtime.javadoc (2.0.0) "Documentation Dictionary Types Runtime"
    com.sap.dictionary.services (2.0.0) "Dictionary Types Services"
    com.sap.dictionary.tools.archivebuilder (2.0.0) "Dictionary Archive Builder"
    com.sap.dictionary.tools.generation (2.0.0) "Dictionary Generation"
    com.sap.dictionary.tools.nameserver (2.0.0) "Dictionary Nameserver"
    com.sap.dictionary.tools.simpletype (2.0.0) "Dictionary Simple Type Editor"
    com.sap.dictionary.tools.sqlj (2.0.0) "Persistence SQLJ"
    com.sap.dictionary.tools.structureeditor (2.0.0) "Dictionary Structure Editor"
    com.sap.dictionary.tools.tablebrowser (2.0.0) "Dictionary Table Browser"
    com.sap.dictionary.tools.tableeditor (2.0.0) "Dictionary Table Editor"
    com.sap.dictionary.tools.tsmodel.dictionary (2.0.0) "Dictionary TS Model"
    com.sap.dictionary.tools.ui (2.0.0) "Dictionary User Interface"
    com.sap.dictionary.types.mdi2metamodel (2.0.0) "Dictionary MDI Metamodel"
    com.sap.engine.javadoc (2.0.0) "Documentation J2EE Engine"
    com.sap.engine.webservices (2.0.0) "Web Service Runtime Libs"
    com.sap.ep.applicationDevelopment (6.3.20040727) "Enterprise Portal Application Development"
    com.sap.ep.configurationManager (6.3.20040727) "Enterprise Portal Configuration Manager"
    com.sap.ep.connectionManager (6.3.20040727) "Enterprise Portal Connection Manager"
    com.sap.ep.documentation (6.3.20040727) "Enterprise Portal Documentation"
    com.sap.ep.documentation.api (6.3.20040727) "Enterprise Portal Java API Documentation"
    com.sap.ep.unitTest (6.3.20040727) "Enterprise Portal Unit Test"
    com.sap.ep.webServices (6.3.20040116) "Enterprise Portal Web Services"
    com.sap.exception (2.0.0) "Core Exceptions"
    com.sap.ext.libs.webservices (2.0.0) "Web Service External Libs"
    com.sap.ide.eclipse.cbs.activation (2.0.0) "Infrastructure CBS Activation"
    com.sap.ide.eclipse.component.provider (2.0.0) "Infrastructure Component Provider"
    com.sap.ide.eclipse.debugExtensionPlugin (2.0.0) "Core Debug Extension"
    com.sap.ide.eclipse.dii (2.0.0) "Infrastructure DII"
    com.sap.ide.eclipse.ext.libs.iaik (2.0.0) "Infrastructure SSL Support External Libs"
    com.sap.ide.eclipse.ext.libs.jdo (2.0.0) "Persistence JDO Libs"
    com.sap.ide.eclipse.import.iaik (2.0.0) "Infrastructure SSL Support Import Wizard"
    com.sap.ide.eclipse.j2ee.engine (2.0.0) "J2EE Engine Utilities"
    com.sap.ide.eclipse.j2ee.model.ui (2.0.0) "J2EE Model Extensions UI"
    com.sap.ide.eclipse.jarsap (2.0.0) "Infrastructure JarSap"
    com.sap.ide.eclipse.login (2.0.0) "Infrastructure Login"
    com.sap.ide.eclipse.s2x.editor (2.0.0) "I18N S2X Editor"
    com.sap.ide.eclipse.sdm (1.0.0) "Infrastructure SDM"
    com.sap.ide.eclipse.wizards.jpx.ui (2.0.0) "Core JPX Import Wizard"
    com.sap.ide.generationfwk (2.0.0) "Generation Framework"
    com.sap.ide.jcb.core (2.0.0) "Connectivity Builder Core"
    com.sap.ide.jcb.ui (2.0.0) "Connectivity Enterprise Connector User Interface"
    com.sap.ide.metamodel.common (2.0.0) "Metamodel Common"
    com.sap.ide.metamodel.common.libs (2.0.0) "Metamodel Common Libs"
    com.sap.ide.metamodel.core (2.0.0) "Metamodel Core"
    com.sap.ide.metamodel.core.libs (2.0.0) "Metamodel Core Libs"
    com.sap.ide.metamodel.dictionary (2.0.0) "Dictionary Metamodel"
    com.sap.ide.metamodel.dictionary.libs (2.0.0) "Dictionary Metamodel Libs"
    com.sap.ide.metamodel.merger (2.0.0) "Metamodel Merger"
    com.sap.ide.metamodel.vi (2.0.0) "Web Service Virtual Interface Metamodel"
    com.sap.ide.metamodel.vi.check.libs (2.0.0) "Web Service Virtual Interface Check Metamodel Libs"
    com.sap.ide.metamodel.vi.libs (2.0.0) "Web Service Virtual Interface Metamodel Libs"
    com.sap.ide.metamodel.webdynpro (2.0.0) "Web Dynpro Metamodel"
    com.sap.ide.metamodel.webdynpro.libs (2.0.0) "Web Dynpro Metamodel Libs"
    com.sap.ide.metamodel.ws (2.0.0) "Web Service Metamodel"
    com.sap.ide.metamodel.ws.libs (2.0.0) "Web Service Metamodel Libs"
    com.sap.ide.metamodel.wsproxy (2.0.0) "Web Service Proxy Metamodel"
    com.sap.ide.metamodel.wsproxy.libs (2.0.0) "Web Service Proxy Metamodel Libs"
    com.sap.ide.metamodelsupplement.webdynpro (2.0.0) "Web Dynpro Metamodel Supplement"
    com.sap.ide.services.metamodel.webdynpro (2.0.0) "Metamodel Web Dynpro Services"
    com.sap.ide.tools.core.patternfwk (2.0.0) "Core Tools Pattern Framework"
    com.sap.ide.tools.core.template (2.0.0) "Core Tools Template"
    com.sap.ide.tools.core.template.service (2.0.0) "Core Tools Template Service"
    com.sap.ide.tools.core.treemappingcomponent (2.0.0) "Core Tools Tree Mapping"
    com.sap.ide.vi (2.0.0) "Web Service Virtual Interface"
    com.sap.ide.vi.check (2.0.0) "Web Service Virtual Interface Check"
    com.sap.ide.virtualInterface.tsmodel (2.0.0) "Web Service Virtual Interface TS Model"
    com.sap.ide.webdynpro.adobetemplatedesigner (2.0.0) "Web Dynpro Adobe Template Designer"
    com.sap.ide.webdynpro.applicationeditor (2.0.0) "Web Dynpro Application Editor"
    com.sap.ide.webdynpro.archivebuilder (2.0.0) "Web Dynpro Archive Builder"
    com.sap.ide.webdynpro.chartdesigner (2.0.0) "Web Dynpro Chart Designer"
    com.sap.ide.webdynpro.checklayer (2.0.0) "Web Dynpro Checklayer"
    com.sap.ide.webdynpro.controllereditor (2.0.0) "Web Dynpro Controller Editor"
    com.sap.ide.webdynpro.controllereditor.methodextraction (2.0.0) "Web Dynpro Method Extraction"
    com.sap.ide.webdynpro.ecatt (2.0.0) "Web Dynpro Ecatt"
    com.sap.ide.webdynpro.generation (2.0.0) "Web Dynpro Generation"
    com.sap.ide.webdynpro.messageeditor (2.0.0) "Web Dynpro Message Editor"
    com.sap.ide.webdynpro.modeleditor (2.0.0) "Web Dynpro Model Editor"
    com.sap.ide.webdynpro.projectbrowser (2.0.0) "Web Dynpro Project Browser"
    com.sap.ide.webdynpro.rendering (2.0.0) "Web Dynpro Rendering"
    com.sap.ide.webdynpro.service.applicationeditor (2.0.0) "Web Dynpro Application Editor Services"
    com.sap.ide.webdynpro.service.applicationmodeler (2.0.0) "Web Dynpro Application Modeler Services"
    com.sap.ide.webdynpro.service.controllereditor (2.0.0) "Web Dynpro Controller Editor Services"
    com.sap.ide.webdynpro.service.core (2.0.0) "Web Dynpro Core Services"
    com.sap.ide.webdynpro.service.modeleditor (2.0.0) "Web Dynpro Model Editor Services"
    com.sap.ide.webdynpro.service.viewdesigner (2.0.0) "Web Dynpro View Designer Services"
    com.sap.ide.webdynpro.template.contextcopy (2.0.0) "Web Dynpro context copy template"
    com.sap.ide.webdynpro.template.generation (2.0.0) "Web Dynpro Template Generation"
    com.sap.ide.webdynpro.template.portaleventing (2.0.0) "Web Dynpro Portal Eventing Template"
    com.sap.ide.webdynpro.template.simplescenario (2.0.0) "WebDynpro Declarative Template Wizards"
    com.sap.ide.webdynpro.template.simplescenario.generation (2.0.0) "WebDynpro Declarative Template Wizards Generation"
    com.sap.ide.webdynpro.template.wizards (2.0.0) "Web Dynpro Template Wizards"
    com.sap.ide.webdynpro.template.wizards.generation (2.0.0) "Web Dynpro Template Wizards Generation"
    com.sap.ide.webdynpro.tsmodel.application (2.0.0) "Web Dynpro TS Model"
    com.sap.ide.webdynpro.ui (2.0.0) "Web Dynpro User Interface"
    com.sap.ide.webdynpro.viewdesigner (2.0.0) "Web Dynpro View Designer"
    com.sap.ide.webservices.tsmodel (2.0.0) "Web Service TS Model"
    com.sap.ide.ws (2.0.0) "Web Service Tools"
    com.sap.ide.ws.core (2.0.0) "Web Service Core"
    com.sap.ide.ws.model (2.0.0) "Web Service Model"
    com.sap.ide.ws.navigator (2.0.0) "Web Service Navigator"
    com.sap.ide.ws.perspective (2.0.0) "Web Service Perspective"
    com.sap.ide.ws.portalintegration (1.0.0) "Portal Web Service Endpoint View"
    com.sap.ide.ws.portalintegration.soapapp (1.0.0) "Portal Web Service Soap Application"
    com.sap.ide.ws.proxygenerator (2.0.0) "Web Service Proxy Generator"
    com.sap.ide.ws.soapapp (2.0.0) "Web Service SOAP Application"
    com.sap.ide.wsproxy (2.0.0) "Web Service Proxy Tools"
    com.sap.ip.bi.sdk.doc (3.5.0) "BI Java SDK Documentation"
    com.sap.ip.me.mdk.developmentTools (2.5.1.1) "Mobile Development Kit Tools"
    com.sap.java.ide (2.0.7) "SAP NetWeaver Developer Studio"
    com.sap.jdo.api (2.0.0) "Persistence JDO API"
    com.sap.jdo.utils (2.0.0) "Persistence JDO Util"
    com.sap.jrfc (2.0.0) "Connectivity JFRC Libs"
    com.sap.km.rfwizard (7.1.5) "Knowledge Management RF Wizard"
    com.sap.km.rfwizard.pdk (7.1.5) "Knowledge Management RF PDK Wizard"
    com.sap.mdi (2.0.0) "Dictionary MDI"
    com.sap.mw.jco (2.0.0) "Connectivity JCO Libs"
    com.sap.mw.jco.javadoc (2.0.0) "Documentation JCO"
    com.sap.mw.jra.javadoc (2.0.0) "Documentation Java Resource Adapter"
    com.sap.netweaver.kmc.doc (1.0.0) "Knowledgemanagement and Collaboration"
    com.sap.opensql (2.0.0) "Core OpenSQL"
    com.sap.opensql.javadoc (2.0.0) "Documentation OpenSQL"
    com.sap.s2x (2.0.0) "I18N S2X"
    com.sap.sdm.api (2.0.0) "Infrastructure SDM API"
    com.sap.security (2.0.0) "Infrastructure Security APIs"
    com.sap.security.https.javadoc (2.0.0) "Documentation SSL/HTTPS Client Connections"
    com.sap.security.javadoc (2.0.0) "Documentation Security"
    com.sap.security.securestorage.javadoc (2.0.0) "Documentation Secure Storage"
    com.sap.sld.client (2.0.0) "Infrastructure SLD Client"
    com.sap.sld.namealloc (2.0.0) "Infrastructure SLD Name Allocation"
    com.sap.sqlj (2.0.0) "Persistence SQLJ Libs"
    com.sap.tc.ap (2.0.0) "Infrastructure Archive Pool"
    com.sap.tc.build (2.0.0) "Infrastructure Build"
    com.sap.tc.cmi (1.0.0) "Common Model Interface"
    com.sap.tc.cmi.javadoc (2.0.0) "Documentation Common Model Interface"
    com.sap.tc.col (2.0.0) "Enterprise Service Framework"
    com.sap.tc.complib (2.0.0) "Infrastructure Component Library"
    com.sap.tc.jarm (2.0.0) "Core Java Application Responsetime Measurement"
    com.sap.tc.jtools.jlin.core (2.0.0) "JLin core"
    com.sap.tc.jtools.jlin.devel (2.0.0) "JLin Test Developer Plugin"
    com.sap.tc.jtools.jlin.java (2.0.0) "JLin Java Module"
    com.sap.tc.jtools.jlin.ui (2.0.0) "Java LINt tool"
    com.sap.tc.jtools.jver.core (2.0.0) "JTools JVer Core"
    com.sap.tc.jtools.source (2.0.0) "Jtools Plugin Developer Resources"
    com.sap.tc.jtools.util (2.0.0) "Jtools Utilities"
    com.sap.tc.security (2.0.0) "Infrastructure Security"
    com.sap.tc.security.https (2.0.0) "Infrastructure Security HTTPS"
    com.sap.tc.webdynpro.runtime (2.0.0) "Web Dynpro Runtime"
    com.sap.tc.webdynpro.runtime.javadoc (2.0.0) "Documentation Web Dynpro Runtime"
    com.sap.ume.javadoc (2.0.0) "Documentation User Management Engine"
    com.togethersoft.sapient.audit (0.9.0) "Sapient Audits"
    com.togethersoft.sapient.core (0.9.0) "Sapient Core"
    com.togethersoft.sapient.depend (0.9.0) "Sapient Dependency Analyzer"
    com.togethersoft.sapient.detect (0.9.0) "Sapient Detection Strategies"
    com.togethersoft.sapient.metric (0.9.0) "Sapient Metrics"
    com.togethersoft.sapient.report (0.9.0) "Sapient Reports"
    com.togethersoft.selena.cmf (0.9.0) "Selena Patterns and Templates Support"
    com.togethersoft.selena.examples (0.9.0) "Together Examples"
    com.togethersoft.selena.gde.printing (0.9.0) "Diagram Printing"
    com.togethersoft.selena.gde.svgexport (0.9.0) "Diagram to SVG Export"
    com.togethersoft.selena.gendoc (0.9.0) "Documentation generator"
    com.togethersoft.selena.launcher (0.9.0) "Launcher Plugin"
    com.togethersoft.selena.license.sanctuary (0.9.0) "Sanctuary Plug-in"
    com.togethersoft.selena.model.navigation (0.9.0) "Model Navigation"
    com.togethersoft.selena.model.providers.patterns (0.9.0) "Patterns Providers"
    com.togethersoft.selena.model.ui.actions.java (0.9.0) "Java Actions Plugin"
    com.togethersoft.selena.model.ui.actions.patterns (0.9.0) "Pattern Actions on Model Elements"
    com.togethersoft.selena.patterns (0.9.0) "Patterns Generation"
    com.togethersoft.selena.patterns.gof (0.9.0) "GoF Patterns"
    com.togethersoft.selena.patterns.java (0.9.0) "Java Patterns"
    com.togethersoft.selena.patterns.sapient (0.9.0) "Sapient Based Pattern Recognition"
    com.togethersoft.selena.profiles (0.9.0) "Selena Profiles Support"
    com.togethersoft.selena.profiles.businessModeling (0.9.0) "UML Profile for Business Modeling"
    com.togethersoft.selena.profiles.ep (0.9.0) "Eriksson-Penker Business Extensions Profile"
    com.togethersoft.selena.profiles.incolor (0.9.0) "UML Modeling in Color Profile Plugin"
    com.togethersoft.selena.profiles.sap (0.9.0) "Web Dynpro Modeling Profile"
    com.togethersoft.selena.profiles.sdp (0.9.0) "UML Profile for Software Development Processes"
    com.togethersoft.selena.sapient (0.9.0) "Sapient Plugin"
    com.togethersoft.selena.sapient.ui (0.9.0) "QA Actions for the Model Entities"
    com.togethersoft.selena.selector (0.9.0) "Selector"
    com.togethersoft.selena.selector.model (0.9.0) "Model Selector"
    com.togethersoft.selena.viewmanagement (0.9.0) "Together View Management"
    com.togethersoft.selena.viewmaps (0.9.0) "Together Viewmaps"
    com.togethersoft.selena.xmi (0.9.0) "XMI Import/Export Plugin"
    com.togethersoft.togethersap (6.1.9) "Borland® Together® Edition for SAP NetWeaver(TM) Developer Studio"
    com.togethersoft.togethersap.presentation (1.0.0) "com.togethersoft.togethersap.presentation"
    com.togethersoft.togetherxj.doc.user (0.9.0) "Borland® Together® Edition for SAP NETWEAVER(TM) DEVELOPER STUDIO User Guide"
    com.togethersoft.togetherxj.gsd.code (0.9.0) "com.togethersoft.togetherxj.gsd.code"
    com.togethersoft.togetherxj.gsd.core (0.9.0) "Gsd Core Plug-in"
    com.togethersoft.togetherxj.gsd.ui (0.9.0) "GsdUIPlugin"
    com.togethersoft.togetherxj.java.explorer (0.9.0) "Together Java Explorer"
    com.togethersoft.togetherxj.java.properties (0.9.0) "Java Properties Plug-in"
    com.togethersoft.togetherxj.model.ui.addlinked (0.9.0) "com.togethersoft.togetherxj.model.ui.addlinked"
    com.togethersoft.togetherxj.sap.integration (0.9.0) "SAP NetWeaver(tm) Developer Studio Integration"
    com.togethersoft.togetherxj.uml (0.9.0) "Generic UML Modeling"
    com.togethersoft.togetherxj.uml.cdl (0.9.0) "CDL Plug-in"
    com.togethersoft.togetherxj.uml.interaction (0.9.0) "Interaction Diagrams Plug-in"
    com.togethersoft.togetherxj.uml.uml20 (0.9.0) "UML 2.0 Support"
    com.togethersoft.togetherxj.uml.uml20.actions (0.9.0) "UML 2.0 Actions Fragment"
    com.togethersoft.togetherxj.uml.uml20.providers (0.9.0) "UML 2.0 Providers Fragment"
    com.togethersoft.togetherxj.uml.uml20.viewmaps (0.9.0) "UML 2.0 Viewmaps Fragment"
    com.tssap.config (1.0.0) "Core Startup Configuration"
    com.tssap.dii (2.0.0) "Infrastructure DII"
    com.tssap.dtr.client.eclipse (2.0.0) "Infrastructure DTR UI"
    com.tssap.dtr.client.vfs (2.0.0) "Infrastructure DTR Client Library (VFS)"
    com.tssap.editors (2.0.0) "Core Editors"
    com.tssap.ext.libs.j2ee (2.0.0) "J2EE External Libs"
    com.tssap.j2ee.core.descriptor (2.0.0) "J2EE Descriptor Support"
    com.tssap.j2ee.core.ear (2.0.0) "J2EE Ear Model"
    com.tssap.j2ee.core.ear.impl (2.0.0) "J2EE Ear Model Implementation"
    com.tssap.j2ee.core.ejb (2.0.0) "J2EE Ejb Model"
    com.tssap.j2ee.core.ejb.impl (1.0.0) "J2EE Ejb Model Implementation"
    com.tssap.j2ee.core.ejbjar (2.0.0) "J2EE Ejb Jar Model"
    com.tssap.j2ee.core.ejbjar.impl (2.0.0) "J2EE Ejb Jar Model Implementation"
    com.tssap.j2ee.core.inheritance (1.0.0) "J2EE Ejb Inheritance"
    com.tssap.j2ee.core.inheritance.impl (1.0.0) "J2EE Ejb Inheritance Implementation"
    com.tssap.j2ee.core.providers.dtr (2.0.0) "J2EE DTR Providers"
    com.tssap.j2ee.core.providers.ear (2.0.0) "J2EE Ear Providers"
    com.tssap.j2ee.core.providers.ejb (2.0.0) "J2EE Ejb Providers"
    com.tssap.j2ee.core.providers.ejbjar (2.0.0) "J2EE Ejb Jar Providers"
    com.tssap.j2ee.core.providers.vi (2.0.0) "J2EE Web Service Virtual Interface Providers"
    com.tssap.j2ee.core.providers.web (2.0.0) "J2EE Web Providers"
    com.tssap.j2ee.core.providers.webapp (2.0.0) "J2EE Web App Providers"
    com.tssap.j2ee.core.providers.ws (2.0.0) "J2EE Web Service Providers"
    com.tssap.j2ee.core.utils (2.0.0) "J2EE Utils Plug-in"
    com.tssap.j2ee.core.web (2.0.0) "J2EE Web Model"
    com.tssap.j2ee.core.web.impl (2.0.0) "J2EE Web Model Implementation"
    com.tssap.j2ee.core.webapp (2.0.0) "J2EE Web App Model"
    com.tssap.j2ee.core.webapp.impl (2.0.0) "J2EE Web App Model Implementation"
    com.tssap.j2ee.doc.user_1.3 (2.0.0) "Documentation J2EE 1.3"
    com.tssap.j2ee.external (2.0.0) "J2EE External"
    com.tssap.j2ee.library (2.0.0) "J2EE Library"
    com.tssap.j2ee.model (2.0.0) "J2EE Model"
    com.tssap.j2ee.model.ext (2.0.0) "J2EE Model Extensions"
    com.tssap.j2ee.ui (2.0.0) "J2EE UI core"
    com.tssap.j2ee.ui.ear (2.0.0) "J2EE UI ear"
    com.tssap.j2ee.ui.ejb (2.0.0) "J2EE UI ejb"
    com.tssap.j2ee.ui.ejbjar (2.0.0) "J2EE UI ejb-jar"
    com.tssap.j2ee.ui.perspective (2.0.0) "J2EE UI perspective/views"
    com.tssap.j2ee.ui.web (2.0.0) "J2EE UI web"
    com.tssap.j2ee.util (2.0.0) "J2EE Core Utilities"
    com.tssap.j2ee.viewmaps (2.0.0) "J2EE Viewmaps"
    com.tssap.j2ee.viewmaps.java (2.0.0) "J2EE Simple Java Viewmaps"
    com.tssap.j2se.doc.user_1.3.1 (2.0.0) "Documentation J2SE 1.3.1"
    com.tssap.j2se.doc.user_1.4.2 (2.0.0) "Documentation J2SE 1.4.2"
    com.tssap.sap.libs.ejbql (2.0.0) "J2EE EJBQL"
    com.tssap.sap.libs.logging (2.0.0) "Core Logging"
    com.tssap.sap.libs.xmltoolkit (2.0.0) "Core XML Toolkit"
    com.tssap.selena.cmf (2.0.0) "Core Selena Patterns and Templates"
    com.tssap.selena.dom (1.0.0) "Core Selena DOM"
    com.tssap.selena.draw2d (2.0.0) "Core Selena Draw2D Extensions"
    com.tssap.selena.gde (2.0.0) "Core Selena GDE Extensions"
    com.tssap.selena.java.comment (2.0.0) "Core Selena Java Comment Parser"
    com.tssap.selena.layout (1.0.0) "Core Selena Layout"
    com.tssap.selena.license (2.0.0) "Core Selena Common License"
    com.tssap.selena.license.unlimited (2.0.0) "Core Selena Common License Unlimited"
    com.tssap.selena.model (2.0.0) "Core Selena Model"
    com.tssap.selena.model.extension (2.0.0) "Core Selena Model Extensions"
    com.tssap.selena.model.platform.eclipse (1.0.0) "Core Selena Model Platform"
    com.tssap.selena.model.preferences (1.0.0) "Core Selena Model Preference Store"
    com.tssap.selena.model.providers.design (0.9.0) "Design Plugin"
    com.tssap.selena.model.providers.java (2.0.0) "Core Selena Model Java Providers"
    com.tssap.selena.model.providers.proxy (2.0.0) "Core Selena Model Proxy Providers"
    com.tssap.selena.model.providers.rc (1.0.0) "Core Selena Model Reference Collections Support"
    com.tssap.selena.model.providers.resources (2.0.0) "Core Selena Model Resources Providers"
    com.tssap.selena.model.ui (2.0.0) "Core Selena Model UI"
    com.tssap.selena.model.ui.navigator (2.0.0) "Core Selena Model UI Navigator"
    com.tssap.selena.model.undo (2.0.0) "Core Selena Model Undo Support"
    com.tssap.selena.model.update (2.0.0) "Core Selena Model Graphical Diagram Editor Updater"
    com.tssap.selena.properties (2.0.0) "Core Selena Properties"
    com.tssap.selena.ui (2.0.0) "Core Selena UI"
    com.tssap.selena.viewmanagement (2.0.0) "Core Selena View Management"
    com.tssap.selena.viewmaps.figures (2.0.0) "Core Selena Viewmap Figures"
    com.tssap.tools (2.0.0) "Core Tools"
    com.tssap.tools.ui (2.0.0) "Core Tools UI"
    com.tssap.util (2.0.0) "Core Utilities"
    com.tssap.util.xml (2.0.0) "Core XML Utilities"
    org.antlr (2.0.0) "Core Antlr"
    org.apache.ant (1.5.3) "Apache Ant"
    org.apache.batik (1.5.0) "Apache Batik"
    org.apache.lucene (1.2.1) "Apache Lucene"
    org.apache.regexp (1.1.9) "Apache Regular Expression package"
    org.apache.velocity (0.9.0) "org.apache.velocity"
    org.apache.xerces (4.0.13) "Xerces Based XML Parser"
    org.eclipse.ant.core (2.1.1) "Ant Build Tool Core"
    org.eclipse.compare (2.1.0) "Compare Support"
    org.eclipse.core.boot (2.1.2) "Core Boot"
    org.eclipse.core.resources (2.1.1) "Core Resource Management"
         org.eclipse.core.resources.win32 (2.1.0) "%win32FragmentName"
    org.eclipse.core.runtime (2.1.1) "Core Runtime"
    org.eclipse.debug.core (2.1.2) "Debug Core"
    org.eclipse.debug.ui (2.1.1) "Debug UI"
    org.eclipse.draw2d (2.0.0) "Draw2d"
    org.eclipse.draw2d.doc.isv (2.0.0) "Draw2d Documentation"
    org.eclipse.gef (2.0.0) "Graphical Editor Framework"
    org.eclipse.gef.doc.isv (2.0.0) "GEF Documentation"
    org.eclipse.gef.examples.logicdesigner (2.0.0) "Logic GEF Example"
    org.eclipse.help (2.1.2) "Help System Core"
    org.eclipse.help.appserver (2.1.0) "Help Application Server"
    org.eclipse.help.ui (2.1.1) "Help System UI"
         org.eclipse.help.ui.win32 (2.1.0) "%help_system_plugin_name_win32"
    org.eclipse.help.webapp (2.1.2) "Help System Webapp"
    org.eclipse.jdt (2.1.2) "Eclipse Java Development Tools"
    org.eclipse.jdt.core (2.1.2) "Java Development Tools Core"
    org.eclipse.jdt.debug (2.1.2) "JDI Debug Model"
    org.eclipse.jdt.debug.ui (2.1.1) "JDI Debug UI"
    org.eclipse.jdt.doc.isv (2.1.0) "Eclipse JDT Plug-in Developer Guide"
    org.eclipse.jdt.doc.user (2.1.0) "Eclipse Java Development User Guide"
    org.eclipse.jdt.junit (2.1.1) "Java Development Tools JUnit support"
    org.eclipse.jdt.launching (2.1.1) "Java Development Tools Launching Support"
    org.eclipse.jdt.source (2.1.2) "Eclipse Java Development Tools SDK"
    org.eclipse.jdt.ui (2.1.2) "Java Development Tools UI"
    org.eclipse.jface (2.1.1) "JFace"
    org.eclipse.jface.text (2.1.0) "JFace Text"
    org.eclipse.pde (2.1.0) "Eclipse Plug-in Development Environment"
    org.eclipse.pde.build (2.1.0) "Plug-in Development Environment Build Support"
    org.eclipse.pde.core (2.1.2) "Plug-in Development Core"
    org.eclipse.pde.doc.user (2.1.0) "Eclipse Plug-in Development User Guide"
    org.eclipse.pde.runtime (2.1.0) "Plug-in Development Environment Runtime"
    org.eclipse.pde.source (2.1.2) "Eclipse Plug-in Development Environment Source Code"
    org.eclipse.pde.ui (2.1.2) "Plug-in Development UI"
    org.eclipse.platform (2.1.2) "Eclipse Platform"
    org.eclipse.platform.doc.isv (2.1.0) "Eclipse Platform Plug-in Developer Guide"
    org.eclipse.platform.doc.user (2.1.1) "Eclipse Workbench User Guide"
    org.eclipse.platform.source (2.1.2) "Eclipse Platform Plug-in Developer Resources"
    org.eclipse.platform.win32 (2.1.2) "Eclipse Platform (Windows)"
    org.eclipse.platform.win32.source (2.1.2) "Eclipse Platform Plug-in Developer Resources (Windows)"
    org.eclipse.sdk.win32 (2.1.2) "Eclipse Project SDK (Windows)"
    org.eclipse.search (2.1.1) "Search Support"
    org.eclipse.swt (2.1.2) "Standard Widget Toolkit"
         org.eclipse.swt.win32 (2.1.2) "%fragmentName"
    org.eclipse.team.core (2.1.1) "Team Support Core"
    org.eclipse.team.ui (2.1.0) "Team Support UI"
    org.eclipse.text (2.1.0) "Text"
    org.eclipse.tomcat (4.0.6.2) "Tomcat Wrapper"
    org.eclipse.ui (2.1.1) "Eclipse UI"
    org.eclipse.ui.editors (2.1.0) "Default Text Editor"
    org.eclipse.ui.externaltools (2.1.1) "External Tools"
    org.eclipse.ui.versioncheck (2.1.1) "Eclipse Version Check"
    org.eclipse.ui.views (2.1.0) "Views"
    org.eclipse.ui.workbench (2.1.1) "Workbench"
         org.eclipse.ui.win32 (2.1.0) "%Win32Fragment.fragmentName"
    org.eclipse.ui.workbench.texteditor (2.1.0) "Text Editor Framework"
    org.eclipse.update.core (2.1.0) "Install/Update Core"
         org.eclipse.update.core.win32 (2.1.0) "%fragmentNameWin"
    org.eclipse.update.ui.forms (2.1.0) "Install/Update Forms"
    org.junit (3.8.1) "JUnit Testing Framework"
    User Preferences:
    #Tue Feb 15 09:29:55 CET 2005
    org.eclipse.jdt.core/org.eclipse.jdt.core.classpathContainer.PegasusLoginModuleLibrary|org.eclipse.jdt.launching.JRE_CONTAINER=
    org.eclipse.jdt.ui/_patternFilterId_.txv=true
    org.eclipse.jdt.core/org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled
    org.eclipse.jdt.core/org.eclipse.jdt.core.classpathContainer.PegasusBusinessComponent|org.eclipse.jdt.launching.JRE_CONTAINER=
    org.eclipse.jdt.ui/_patternFilterId_.txa=true
    org.eclipse.ui.workbench/perspectives=org.eclipse.debug.ui.DebugPerspective
    org.eclipse.jdt.ui/org.eclipse.jface.textfont=1|Courier New|10|0|WINDOWS|1|0|0|0|0|0|0|0|0|1|0|0|0|0|Courier New;1|Courier|10|0|WINDOWS|1|0|0|0|0|0|0|0|0|1|0|0|0|0|Courier;1|Lucida Console|9|0|WINDOWS|1|0|0|0|0|0|0|0|0|1|0|0|0|0|Lucida Console;
    org.eclipse.ui.workbench/editors=
    org.eclipse.ui.workbench=2.1.1
    com.sap.ide.eclipse.j2ee.engine/ScsProfile=
    E11000061497
    sapmnt
    J2E
    SYS
    profile
    J2E_SCS01_e11000061497
    com.tssap.dtr.client.eclipse=2.0.0
    org.eclipse.jdt.ui/org.eclipse.jdt.ui.PackageExplorer_patternFilterId_$.class=true
    org.eclipse.ui.workbench/inner_interface_name_template=InnerInterface
    com.tssap.selena.gde=2.0.0
    org.eclipse.jdt.core/org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
    com.sap.ide.eclipse.j2ee.engine/SystemId=J2E
    org.eclipse.ui.workbench/recognize_properties=true
    org.eclipse.jdt.core/org.eclipse.jdt.core.classpathContainer.LocalDevelopmentpegasuswebservicesde.isenergy|org.eclipse.jdt.launching.JRE_CONTAINER=<info extension="dtdbtable" name=""><editor id="com.sap.dictionary.tools.tableeditor.TableEditor"/></info><info extension="jpage" name=""><info extension="wdapplication" name=""><editor id="editor.MetaModelEditor"/><editor id="com.sap.ide.webdynpro.editors.application"/></info><info extension="dtsimpletype" name=""><info extension="jardesc" name=""><editor id="org.eclipse.jdt.ui.JARDescEditor"/></info><info extension="sqlj" name=""><info extension="java" name=""><editor id="org.eclipse.jdt.ui.CompilationUnitEditor"/></info><info extension="xml" name="provider"><editor id="com.sap.ide.eclipse.j2ee.model.ui.saplibrary.saplibraryeditor"/></info><info extension="wdcomponent" name=""><info extension="wdmodel" name=""><editor id="editor.MetaModelEditor"/></info><info extension="class" name=""><info extension="mxsd" name=""><editor id="org.eclipse.pde.ui.schemaEditor"/></info><info extension="html" name=""><info extension="dtstructure" name=""><editor id="com.sap.dictionary.tools.structureeditor.StructureEditor"/><editor id="editor.MetaModelEditor"/></info><info extension="xml" name="plugin"><editor id="org.eclipse.pde.ui.manifestEditor"/></info><info extension="htm" name=""><info extension="wsdef" name=""><editor id="editor.MetaModelEditor"/><editor id="com.sap.ide.ws.editors.wsd.WSDEditor"/></info><info extension="xml" name="build"><editor id="org.eclipse.ui.externaltools.internal.ant.editor.AntEditor"/></info><info extension="xml" name="site"><editor id="org.eclipse.pde.ui.siteEditor"/></info><info extension="xml" name="service-provider"><editor id="com.sap.ide.eclipse.j2ee.model.ui.sapservice.sapserviceeditor"/></info><info extension="txt" name=""><info extension="wdview" name=""><editor id="com.sap.ide.webdynpro.editors.controller"/></info><info extension="xml" name="fragment"><editor id="org.eclipse.pde.ui.fragmentEditor"/></info><info extension="xml" name=""><info extension="xlf" name=""><editor id="com.sap.ide.eclipse.s2x.editor.editors.S2XMultiPageEditor"/></info><info extension="xml.old" name="web"><editor id="com.tssap.j2ee.ui.editor.webeditorold"/></info><info extension="wdbusiness" name=""><info extension="wdcompinterfacedef" name=""><editor id="com.sap.ide.webdynpro.editors.controller"/></info><info extension="xsd" name=""><info extension="metamodel" name=""><editor id="com.sap.ide.metamodel.core.metamodel"/></info><info extension="testscript" name=""><info extension="wdcontroller" name=""><editor id="com.sap.ide.webdynpro.editors.controller"/><editor id="editor.MetaModelEditor"/></info><info extension="xml" name="data-source-aliases"><editor id="com.sap.ide.eclipse.j2ee.model.ui.sapdsaliases.sapdsaliaseseditor"/></info><info extension="properties" name="build"><editor id="org.eclipse.pde.ui.buildEditor"/></info><info extension="lp" name=""><info extension="xxx" name=""><editor id="com.sap.ide.webdynpro.editors.implementation"/><editor id="com.sap.ide.webdynpro.editors.componentControllerUsage"/></info><info extension="xml" name="ejb-j2ee-engine"><editor id="com.sap.ide.eclipse.j2ee.model.ui.sapejbjar.sapejbjardescriptioneditor"/></info><info extension="xml" name="feature"><editor id="org.eclipse.pde.ui.featureEditor"/></info><info extension="wdwindow" name=""><info extension="exsd" name=""><editor id="org.eclipse.pde.ui.schemaEditor"/></info><info extension="xml" name="portalapp"><editor id="com.sap.portal.developmenttools.PortalappXmlEditor"/></info><info extension="testresult" name=""><info extension="logic" name=""><editor id="Logic Graphical Editor"/></info><info extension="videf" name=""><info extension="jsp" name=""><editor id="com.tssap.editors.jspeditor"/></info><info extension="wdcomponentinterface" name=""><info extension="wdnavigation" name=""><editor id="com.sap.ide.webdynpro.tsmodel.application.window"/></info><info extension="properties" name=""><info extension="wdinterfaceview" name=""><editor id="com.sap.ide.webdynpro.editors.controller"/><editor id="editor.MetaModelEditor"/></info><info extension="wdmodelclass" name=""><info extension="wsprxdef" name=""><editor id="com.sap.ide.wsproxy.wsproxyeditor"/></info><info extension="xml" name="application-j2ee-engine"><editor id="com.sap.ide.eclipse.j2ee.model.ui.sapear.sapeareditor"/></info><info extension="xml" name="ejb-jar"><editor id="com.tssap.j2ee.ui.ejbjar.editor.ejbjareditor"/></info><info extension="tag" name="">
    org.eclipse.jdt.junit/org.eclipse.jdt.junit.active_filters=org.eclipse.jdt.internal.junit.runner.,org.eclipse.jdt.internal.junit.ui.,junit.framework.TestCase,junit.framework.TestResult,junit.framework.TestSuite,junit.framework.Assert,java.lang.reflect.Method.invoke
    Update Manager Log:
    Configuration=02.02.2005 19:33:56
    Is current configuration=true
    Date=02.02.05 19:33
    Activities=file:C:/Programme/SAP/JDT/eclipse/
    Action=Site installed
    Status=Success
    Date=02.02.05 19:33
    Activities=file:C:/Programme/SAP/JDT/eclipse/.metadata/.config/platform.cfg.metadata/v2LocalSite.xml
    Action=Reconcile
    Status=Success
    Error Log:
    !SESSION Feb 08, 2005 12:56:13.421 -
    java.version=1.4.2_04
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
    Command-line arguments: -os win32 -ws win32 -arch x86 -feature com.sap.java.ide -data C:ProgrammeSAPJDTeclipse -install file:C:/Programme/SAP/JDT/eclipse/
    !ENTRY Startup 1 0 Feb 08, 2005 12:56:13.421
    !MESSAGE Sap NetWeaver Developer Studio - Build: 200407270250
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:26.818
    !MESSAGE Updating metamodel archives from classpath for project JFreeChart
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:27.329
    !MESSAGE Updating metamodel archives from classpath for project PegasusBusinessComponent
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:27.369
    !MESSAGE Updating metamodel archives from classpath for project PegasusClient
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:27.379
    !MESSAGE Updating metamodel archives from classpath for project PegasusClientStubs
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:27.399
    !MESSAGE Updating metamodel archives from classpath for project PegasusCuf
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:27.409
    !MESSAGE Updating metamodel archives from classpath for project PegasusDev
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:27.419
    !MESSAGE Updating metamodel archives from classpath for project PegasusLoginModuleLibrary
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:27.439
    !MESSAGE Updating metamodel archives from classpath for project PegasusLoginModuleProject
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:27.690
    !MESSAGE Updating metamodel archives from classpath for project PegasusServer
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:27.960
    !MESSAGE Updating metamodel archives from classpath for project PegasusServlet
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 12:56:28.120
    !MESSAGE Updating metamodel archives from classpath for project PegasusTest
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 13:52:57.427
    !MESSAGE Updating metamodel archives from classpath for project LocalDevelopmentpegasuswebservicesde.isenergy
    !ENTRY com.sap.ide.metamodel.core 1 1 Feb 08, 2005 13:53:56.303
    !MESSAGE Removed  Metamodel for project LocalDevelopmentpegasuswebservicesde.isenergy
    !ENTRY com.tssap.util 4 0 Feb 08, 2005 13:56:43.36
    !MESSAGE Feb 8, 2005 1:56:43 PM                com.tssap.util.ui.menu.MenuFactory              Error: Error in performing action
    !STACK 0
    java.lang.StackOverflowError
    /code

    Hi yue42, thanks alot for your rely.
    The error occured before I tried to apply the xsl template to translate the xml data into html page, anyway here is my template. dave
    <?xml version="1.0"?>                                                           
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
    <xsl:output method="html"/>                                                     
    <xsl:include href="global.xsl"/>
    <xsl:template match="/">                                                        
    <html>                                                                          
    <head>News</head>
    <body>
    <table>
    <xsl:for-each select="//NEWS/STORY">
    <xsl:if test="6>position()">
    <tr>
    <td><xsl:value-of select="position()"/></td>
    <td><xsl:value-of select="./HEADLINE"/></td>
    </tr>
    </xsl:if>
    </xsl:for-each>
    </table>
    </body>         
    </html>         
    </xsl:template> 
    </xsl:stylesheet>                                   

  • How to put the background of an java.awt.Label transparent?

    I have a label (java.awt.Label) and I want to put the background transparent, so if i move it over other elements, one can only see the text and not the background.
    How does this work? Can anyone help me?
    Bye
    Sebastian

    how I can get the background color of a cell when mouse clickedAttach a mouseListener to your table. In that listener find the clicked cell through myTable.rowAtPoint(MouseEvent.getPoint()) dto. with column.
    Then myTable.getCellRenderer(int row, int column), and in the renderer you look for the colour.

  • If Statement in java.awt paint

    import java.applet.Applet;  //bring in the applet class
    import java.awt.*;             //bring in the graphics class
    import java.awt.event.*;      //bring in the event class
    import java.text.DecimalFormat;    //bring in the decimal format class
    import java.lang.Float;       //bring in the float class
    public class Bmi extends Applet implements ActionListener {   //begin program and start ActionListener
      Label weight, height;    //define Label variable
      TextField weighttext, heighttext;    //define TextField variables
      Button calculate;     //define button variables
      float index, wt, ht, max, min;    //define float variables
      DecimalFormat fmt2 = new DecimalFormat("#.00"); //set decimal format for reals
    public void init() {    //begin init()
      weight = new Label("Please enter your weight in Kg. (2 decimal places): ");   //define content of Label weight
      weighttext = new TextField(6);            //define size of TextField
      height = new Label("Please enter your height in Metres (2 decimal places): ");   //define content of Label height
      heighttext = new TextField(5);    //define size of TextField
      calculate = new Button("Calculate!!");       //define content of Button
      add(weight);      //add Label weight to the GUI
      add(weighttext);   //add TextField weighttext to the GUI
      add(height);      //add Label height to the GUI
      add(heighttext);     //add TextField heighttext to the GUI
      add(calculate);        //add button calculate to the GUI
      calculate.addActionListener(this);    //wait for button to be returned
      wt = 0;     //reset wt to 0
      index = 0;  //reset index to 0
      ht = 0;      //reset ht to 0
      max = 0;      //reset max to 0
      min = 0;    //reset min to 0
      public void actionPerformed( ActionEvent e ) {   //run upon return of button
      wt = Float.parseFloat(weighttext.getText());  //convert weighttext from String to Float
      ht = Float.parseFloat(heighttext.getText());    //covert heighttext from String to Float
      repaint();     //refresh paint area
      public float indexer()  //begin indexer method
        float ind;    //delare local variable ind
        ind = wt/(ht*ht);      //perform calculation
        return ind;    //make indexer() the value of variable ind
      }  // end of indexer method
      public float maxWeight()  //begin maxWeight method
        float maxwt;    //declare local variable maxwt
        final float UPPER = 25.0f;   //declare variable UPPER as a float with a decimal value of 25.0
        maxwt = UPPER*ht*ht;      //perform calculation
        return maxwt;          //make maxWeight() the value of variable maxwt
      }  // end of maxWeight method
      public float minWeight()   //begin minWeight method
        float minwt;    //declare local variable minwt
        final float LOWER= 20.0f;   //declare variable LOWER as a float with a decimal value of 20.0
        minwt = LOWER*ht*ht;    //perform calculation
        return minwt;      //make minWeight() the value of variable minwt
      }  // end of minWeight method
    public void paint(Graphics g)    //begin paint method, define g as Graphics
        index=indexer();   //covert method indexer() to variable index
        max=maxWeight();      //convert method maxWeight() to variable max
        min=minWeight();     //convert method minWeight() to variable min
        g.setFont(new Font("Verdana", Font.ITALIC, 15));    //define font, weight and size
        g.setColor(new Color(90,90,90));     //set new colour
        g.drawRect(5,100,300,75);      //define size of rectangle
        g.setColor(new Color(255,107,9));   //set new colour
        g.drawString("BMI is " + fmt2.format(index) + " for " + fmt2.format(wt) + "kg",20,120);   //create string in paint, define its on screen position
        g.drawString("Maximum bodyweight is " + fmt2.format(max) + "kg", 20,140);   //create string in paint, define its on screen position
        g.drawString("Minimum bodyweight is " + fmt2.format(min) + "kg", 20,160);     //create string in paint, define its on screen position
      }  // end of paint method
    }    // end of Bmi classI have written the above code to calculate someones BMI (Body Mass Index). Basically as you can see it recieves a weight and height from the user and calculates the rest. But whilst that good I would like to know how I can make it tell the user something to the effect of "Your overweight" or "Your underweight". The if statement runs like this:
    if (wt > max)This forum doesn't quite handle <> properly. The greater and less than symbols. So above you will see > this is the html character code for a greater than symbol so please read it as such.
    And then if wt is greater than max then it will say "Your overweight".
    But I can't figure out how to include it in the above program. Becuase it won't run in paint, atleast it won't the way I have done it previously. So can you think of any other ways?
    Help much appreciated,
    Simon

    Thanks very much that works well.
    Simon
    My code now looks like this: import java.applet.Applet;  //bring in the applet class
    import java.awt.*;             //bring in the graphics class
    import java.awt.event.*;      //bring in the event class
    import java.text.DecimalFormat;    //bring in the decimal format class
    import java.lang.Float;       //bring in the float class
    public class Bmi extends Applet implements ActionListener {   //begin program and start ActionListener
      Label weight, height;    //define Label variable
      TextField weighttext, heighttext;    //define TextField variables
      Button calculate;     //define button variables
      float index, wt, ht, max, min;    //define float variables
      DecimalFormat fmt2 = new DecimalFormat("#.00"); //set decimal format for reals
    public void init() {    //begin init()
      weight = new Label("Please enter your weight in Kg. (2 decimal places): ");   //define content of Label weight
      weighttext = new TextField(6);            //define size of TextField
      height = new Label("Please enter your height in Metres (2 decimal places): ");   //define content of Label height
      heighttext = new TextField(5);    //define size of TextField
      calculate = new Button("Calculate!!");       //define content of Button
      add(weight);      //add Label weight to the GUI
      add(weighttext);   //add TextField weighttext to the GUI
      add(height);      //add Label height to the GUI
      add(heighttext);     //add TextField heighttext to the GUI
      add(calculate);        //add button calculate to the GUI
      calculate.addActionListener(this);    //wait for button to be returned
      wt = 0;     //reset wt to 0
      index = 0;  //reset index to 0
      ht = 0;      //reset ht to 0
      max = 0;      //reset max to 0
      min = 0;    //reset min to 0
      public void actionPerformed( ActionEvent e ) {   //run upon return of button
      wt = Float.parseFloat(weighttext.getText());  //convert weighttext from String to Float
      ht = Float.parseFloat(heighttext.getText());    //covert heighttext from String to Float
      repaint();     //refresh paint area
      public float indexer()  //begin indexer method
        float ind;    //delare local variable ind
        ind = wt/(ht*ht);      //perform calculation
        return ind;    //make indexer() the value of variable ind
      }  // end of indexer method
      public float maxWeight()  //begin maxWeight method
        float maxwt;    //declare local variable maxwt
        final float UPPER = 25.0f;   //declare variable UPPER as a float with a decimal value of 25.0
        maxwt = UPPER*ht*ht;      //perform calculation
        return maxwt;          //make maxWeight() the value of variable maxwt
      }  // end of maxWeight method
      public float minWeight()   //begin minWeight method
        float minwt;    //declare local variable minwt
        final float LOWER= 20.0f;   //declare variable LOWER as a float with a decimal value of 20.0
        minwt = LOWER*ht*ht;    //perform calculation
        return minwt;      //make minWeight() the value of variable minwt
      }  // end of minWeight method
    public void you(Graphics g)
      String statement;
      if(wt > max) statement="You are very fat";
      else if(wt < min) statement="You are very thin";
      else statement="You are in the recommended weight range for your height";
      g.drawString(statement, 20,210);
    public void paint(Graphics g)    //begin paint method, define g as Graphics
        you(g);
        index=indexer();   //covert method indexer() to variable index
        max=maxWeight();      //convert method maxWeight() to variable max
        min=minWeight();     //convert method minWeight() to variable min
        g.setFont(new Font("Verdana", Font.ITALIC, 15));    //define font, weight and size
        g.setColor(new Color(90,90,90));     //set new colour
        g.drawRect(5,100,300,75);      //define size of rectangle
        g.setColor(new Color(255,107,9));   //set new colour
        g.drawString("BMI is " + fmt2.format(index) + " for " + fmt2.format(wt) + "kg",20,120);   //create string in paint, define its on screen position
        g.drawString("Maximum bodyweight is " + fmt2.format(max) + "kg", 20,140);   //create string in paint, define its on screen position
        g.drawString("Minimum bodyweight is " + fmt2.format(min) + "kg", 20,160);     //create string in paint, define its on screen position
      }  // end of paint method
    }    // end of BmiThanks again,
    Simon

  • Using List Class in java.awt / java.util ?

    have a program that:
    import java.util.*;
    List list = new LinkedList();
    list = new ArrayList();
    ... read a file and add elements to array
    use a static setter
    StaticGettersSetters.setArray(list);
    next program:
    import java.awt.*;
    public static java.util.List queryArray =
    StaticGettersSetters.getArray();
    If I don't define queryArray with the package and class, the compiler
    gives an error that the List class in java.awt is invalid for queryArray.
    If I import the util package, import java.util.*; , the compiler
    gives an error that the list class is ambiguous.
    Question:
    If you using a class that exists in multiple packages, is the above declaration of queryArray the only way to declare it ?
    Just curious...
    Thanks for your help,
    YAM-SSM

    So what you have to do is explicitly tell the compiler which one you really want by spelling out the fully-resolved class name:
    import java.awt.*;
    import java.sql.*;
    import java.util.*;
    public class ClashTest
        public static void main(String [] args)
            java.util.Date today    = new java.util.Date();
            java.util.List argsList = Arrays.asList(args);
            System.out.println(today);
            System.out.println(argsList);
    }No problems here. - MOD

  • Custom graphics in java.awt.ScrollPane

    Hi all,
    I have to draw a custom created image in a scroll pane. As the image is very large I want to display it in a scroll pane. As parts of the image may change within seconds, and drawing the whole image is very time consuming (several seconds) I want to draw only the part of the image that is currently visible to the user.
    My idea: creating a new class that extends from java.awt.ScrollPane, overwrite the paint(Graphics) method and do the drawings inside. Unfortunately, it does not work. The background of the scoll pane is blue, but it does not show the red box (the current viewport is not shown in red).
    Below please find the source code that I am using:
    package graphics;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.ScrollPane;
    import java.awt.event.AdjustmentEvent;
    public class CMyComponent extends ScrollPane {
         /** <p>Listener to force a component to repaint when a scroll bar changes its
          * position.</p>
         private final class ScrollBarAdjustmentListener implements java.awt.event.AdjustmentListener {
              /** <p>The component to force to repaint.</p> */
              private final Component m_Target;
              /** <p>Default constructor.</p>
               * @param Target The component to force to repaint.
              private ScrollBarAdjustmentListener(Component Target) { m_Target = Target; }
              /** <p>Forces to component to repaint upon adjustment of the scroll bar.</p>
               *  @see java.awt.event.AdjustmentListener#adjustmentValueChanged(java.awt.event.AdjustmentEvent)
              public void adjustmentValueChanged(AdjustmentEvent e) { m_Target.paint(m_Target.getGraphics()); }
         public CMyComponent() {
              // Ensure that the component repaints upon changing of the scroll bars
              ScrollBarAdjustmentListener sbal = new ScrollBarAdjustmentListener(this);
              getHAdjustable().addAdjustmentListener(sbal);
              getVAdjustable().addAdjustmentListener(sbal);
         public void paint(Graphics g) {
              setBackground(Color.BLUE);
              g.setColor(Color.RED);
              g.fillRect(getScrollPosition().x, getScrollPosition().y, getViewportSize().width, getViewportSize().height);
         public final static void main(String[] args) {
              java.awt.Frame f = new java.awt.Frame();
              f.add(new CMyComponent());
              f.pack();
              f.setVisible(true);
    }

    Dear all,
    I used the last days and tried several things. I think now I have a quite good working solution (just one bug remains) and it is very performant. To give others a chance to see what I have done I post the source code of the main class (a canvas drawing and implementing scrolling) here. As soon as the sourceforge project is accepted, I will publish the whole sources at there. Enjoy. And if you have some idea for my last bug in getElementAtPixel(Point), then please tell me.
    package internetrail.graphics.hexgrid;
    import java.awt.Canvas;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Point;
    import java.awt.Polygon;
    import java.awt.event.ComponentEvent;
    import java.awt.event.ComponentListener;
    import java.awt.geom.Area;
    import java.awt.image.BufferedImage;
    import java.util.WeakHashMap;
    import java.util.Map;
    /** <p>Hex grid view.</p>
    * <p>Visualizes a {@link IHexGridModel}.</p>
    * @version 0.1, 03.06.2006
    * @author Bjoern Wuest, Germany
    public final class CHexGridView extends Canvas implements ComponentListener, IHexGridElementListener {
         /** <p>Serial version unique identifier.</p> */
         private static final long serialVersionUID = -965902826101261530L;
         /** <p>Instance-constant parameter for the width of a hex grid element.</p> */
         public final int CONST_Width;
         /** <p>Instance-constant parameter for 1/4 of the width of a hex grid element.</p> */
         public final int CONST_Width1fourth;
         /** <p>Instance-constant parameter for 3/4 of the width of a hex grid element.</p> */
         public final int CONST_Width3fourth;
         /** <p>Instance-constant parameter for 1.5 times of the width of a hex grid element.</p> */
         public final int CONST_Width1dot5;
         /** <p>Instance-constant parameter for 4 times of the width of a hex grid element.</p> */
         public final int CONST_Widthquad;
         /** <p>Instance-constant parameter for the height of a hex grid element.</p> */
         public final int CONST_Height;
         /** <p>Instance-constant parameter for 1/2 of the height of a hex grid element.</p> */
         public final int CONST_Heighthalf;
         /** <p>Instance-constant parameter for the double height of a hex grid element.</p> */
         public final int CONST_Heightdouble;
         /** <p>The steepness of a side of the hex grid element (calculated for the upper left arc).</p> */
         public final double CONST_Steepness;
         /** <p>The model of this hex grid </p> */
         private final IHexGridModel m_Model;
         /** <p>A cache for already created images of the hex map.</p> */
         private final Map<Point, Image> m_Cache = new WeakHashMap<Point, Image>();
         /** <p>The graphical area to draw the selection ring around a hex element.</p> */
         private final Area m_SelectionRing;
         /** <p>The image of the selection ring around a hex element.</p> */
         private final BufferedImage m_SelectionRingImage;
         /** <p>The current position of the hex grid in pixels (top left visible corner).</p> */
         private Point m_ScrollPosition = new Point(0, 0);
         /** <p>Flag to define if a grid is shown ({@code true}) or not ({@code false}).</p> */
         private boolean m_ShowGrid = true;
         /** <p>Flag to define if the selected hex grid element should be highlighted ({@code true}) or not ({@code false}).</p> */
         private boolean m_ShowSelected = true;
         /** <p>The offset of hex grid elements shown on the screen, measured in hex grid elements.</p> */
         private Point m_CurrentOffset = new Point(0, 0);
         /** <p>The offset of the image shown on the screen, measured in pixels.</p> */
         private Point m_PixelOffset = new Point(0, 0);
         /** <p>The index of the currently selected hex grid element.</p> */
         private Point m_CurrentSelected = new Point(0, 0);
         /** <p>The width of a buffered pre-calculated image in pixel.</p> */
         private int m_ImageWidth;
         /** <p>The height of a buffered pre-calculated image in pixel.</p> */
         private int m_ImageHeight;
         /** <p>The maximum number of columns of hex grid elements to be shown at once on the screen.</p> */
         private int m_MaxColumn;
         /** <p>The maximum number of rows of hex grid elements to be shown at once on the screen.</p> */
         private int m_MaxRow;
         /** <p>Create a new hex grid view.</p>
          * <p>The hex grid view is bound to a {@link IHexGridModel} and registers at
          * that model to listen for {@link IHexGridElement} updates.</p>
          * @param Model The model backing this view.
         public CHexGridView(IHexGridModel Model) {
              // Set the model
              m_Model = Model;
              CONST_Width = m_Model.getElementsWidth();
              CONST_Height = m_Model.getElementsHeight();
              CONST_Width1fourth = CONST_Width/4;
              CONST_Width3fourth = CONST_Width*3/4;
              CONST_Width1dot5 = CONST_Width*3/2;
              CONST_Heighthalf = CONST_Height/2;
              CONST_Widthquad = CONST_Width*4;
              CONST_Heightdouble = CONST_Height*2;
              CONST_Steepness = (double)CONST_Heighthalf / CONST_Width1fourth;
              m_ImageWidth = getSize().width+CONST_Widthquad;
              m_ImageHeight = getSize().height+CONST_Heightdouble;
              m_MaxColumn = m_ImageWidth / CONST_Width3fourth;
              m_MaxRow = m_ImageHeight / CONST_Height;
              // Register this canvas for various notifications
              m_Model.addElementListener(this);
              addComponentListener(this);
              // Create the selection ring to highlight hex grid elements
              m_SelectionRing = new Area(new Polygon(new int[]{-1, CONST_Width1fourth-1, CONST_Width3fourth+1, CONST_Width+1, CONST_Width3fourth+1, CONST_Width1fourth-1}, new int[]{CONST_Heighthalf, -1, -1, CONST_Heighthalf, CONST_Height+1, CONST_Height+1}, 6));
              m_SelectionRing.subtract(new Area(new Polygon(new int[]{2, CONST_Width1fourth+2, CONST_Width3fourth-2, CONST_Width-2, CONST_Width3fourth-2, CONST_Width1fourth+2}, new int[]{CONST_Heighthalf, 2, 2, CONST_Heighthalf, CONST_Height-2, CONST_Height-2}, 6)));
              m_SelectionRingImage = new BufferedImage(CONST_Width, CONST_Height, BufferedImage.TYPE_INT_ARGB);
              Graphics2D g = m_SelectionRingImage.createGraphics();
              g.setColor(Color.WHITE);
              g.fill(m_SelectionRing);
         @Override public synchronized void paint(Graphics g2) {
              // Caculate the offset of indexes to show
              int offsetX = 2 * (m_ScrollPosition.x / CONST_Width1dot5) - 2;
              int offsetY = (int)(Math.ceil(m_ScrollPosition.y / CONST_Height) - 1);
              m_CurrentOffset = new Point(offsetX, offsetY);
              // Check if the image is in the cache
              Image drawing = m_Cache.get(m_CurrentOffset);
              if (drawing == null) {
                   // The image is not cached, so draw it
                   drawing = new BufferedImage(m_ImageWidth, m_ImageHeight, BufferedImage.TYPE_INT_ARGB);
                   Graphics2D g = ((BufferedImage)drawing).createGraphics();
                   // Draw background
                   g.setColor(Color.BLACK);
                   g.fillRect(0, 0, m_ImageWidth, m_ImageHeight);
                   // Draw the hex grid
                   for (int column = 0; column <= m_MaxColumn; column += 2) {
                        for (int row = 0; row <= m_MaxRow; row++) {
                             // Draw even column
                             IHexGridElement element = m_Model.getElementAt(offsetX + column, offsetY + row);
                             if (element != null) { g.drawImage(element.getImage(m_ShowGrid), (int)(column*(CONST_Width3fourth-0.5)), CONST_Height*row, null); }
                             // Draw odd column
                             element = m_Model.getElementAt(offsetX + column+1, offsetY + row);
                             if (element!= null) { g.drawImage(element.getImage(m_ShowGrid), (int)(column*(CONST_Width3fourth-0.5)+CONST_Width3fourth), CONST_Heighthalf*(row*2+1), null); }
                   // Put the image into the cache
                   m_Cache.put(m_CurrentOffset, drawing);
              // Calculate the position of the image to show
              offsetX = CONST_Width1dot5 + (m_ScrollPosition.x % CONST_Width1dot5);
              offsetY = CONST_Height + (m_ScrollPosition.y % CONST_Height);
              m_PixelOffset = new Point(offsetX, offsetY);
              g2.drawImage(drawing, -offsetX, -offsetY, null);
              // If the selected element should he highlighted, then do so
              if (m_ShowSelected) {
                   // Check if the selected element is on screen
                   if (isElementOnScreen(m_CurrentSelected)) {
                        // Correct vertical offset for odd columns
                        if ((m_CurrentSelected.x % 2 == 1)) { offsetY -= CONST_Heighthalf; }
                        // Draw the selection circle
                        g2.drawImage(m_SelectionRingImage, (m_CurrentSelected.x - m_CurrentOffset.x) * CONST_Width3fourth - offsetX - ((m_CurrentSelected.x + 1) / 2), (m_CurrentSelected.y - m_CurrentOffset.y) * CONST_Height - offsetY, null);
         @Override public synchronized void update(Graphics g) { paint(g); }
         public synchronized void componentResized(ComponentEvent e) {
              // Upon resizing of the component, adjust several pre-calculated values
              m_ImageWidth = getSize().width+CONST_Widthquad;
              m_ImageHeight = getSize().height+CONST_Heightdouble;
              m_MaxColumn = m_ImageWidth / CONST_Width3fourth;
              m_MaxRow = m_ImageHeight / CONST_Height;
              // And flush the cache
              m_Cache.clear();
         public void componentMoved(ComponentEvent e) { /* do nothing */ }
         public void componentShown(ComponentEvent e) { /* do nothing */ }
         public void componentHidden(ComponentEvent e) { /* do nothing */ }
         public synchronized void elementUpdated(IHexGridElement Element) {
              // Clear cache where the element may be contained at
              for (Point p : m_Cache.keySet()) { if (isElementInScope(Element.getIndex(), p, new Point(p.x + m_MaxColumn, p.y + m_MaxRow))) { m_Cache.remove(p); } }
              // Update the currently shown image if the update element is shown, too
              if (isElementOnScreen(Element.getIndex())) { repaint(); }
         /** <p>Returns the model visualized by this grid view.</p>
          * @return The model visualized by this grid view.
         public IHexGridModel getModel() { return m_Model; }
         /** <p>Returns the current selected hex grid element.</p>
          * @return The current selected hex grid element.
         public IHexGridElement getSelected() { return m_Model.getElementAt(m_CurrentSelected.x, m_CurrentSelected.y); }
         /** <p>Sets the current selected hex grid element by its index.</p>
          * <p>If the selected hex grid element should be highlighted and is currently
          * shown on the screen, then this method will {@link #repaint() redraw} this
          * component automatically.</p>
          * @param Index The index of the hex grid element to become the selected one.
          * @throws IllegalArgumentException If the index refers to a non-existing hex
          * grid element.
         public synchronized void setSelected(Point Index) throws IllegalArgumentException {
              // Check that the index is valid
              if ((Index.x < 0) || (Index.y < 0) || (Index.x > m_Model.getXElements()) || (Index.y > m_Model.getYElements())) { throw new IllegalArgumentException("There is no hex grid element with such index."); }
              m_CurrentSelected = Index;
              // If the element is on screen and should be highlighted, then repaint
              if (m_ShowSelected && isElementOnScreen(m_CurrentSelected)) { repaint(); }
         /** <p>Moves the visible elements to the left by the number of pixels.</p>
          * <p>To move the visible elements to the left by one hex grid element, pass
          * {@link #CONST_Width3fourth} as the parameter. The component will
          * automatically {@link #repaint()}.</p>
          * @param Pixels The number of pixels to move to the left.
          * @return The number of pixels moved to the left. This is always between 0
          * and {@code abs(Pixels)}.
         public synchronized int moveLeft(int Pixels) {
              int delta = m_ScrollPosition.x - Math.max(0, m_ScrollPosition.x - Math.max(0, Pixels));
              if (delta != 0) {
                   m_ScrollPosition.x -= delta;
                   repaint();
              return delta;
         /** <p>Moves the visible elements up by the number of pixels.</p>
          * <p>To move the visible elements up by one hex grid element, pass {@link
          * #CONST_Height} as the parameter. The component will automatically {@link
          * #repaint()}.</p>
          * @param Pixels The number of pixels to move up.
          * @return The number of pixels moved up. This is always between 0 and {@code
          * abs(Pixels)}.
         public synchronized int moveUp(int Pixels) {
              int delta = m_ScrollPosition.y - Math.max(0, m_ScrollPosition.y - Math.max(0, Pixels));
              if (delta != 0) {
                   m_ScrollPosition.y -= delta;
                   repaint();
              return delta;
         /** <p>Moves the visible elements to the right by the number of pixels.</p>
          * <p>To move the visible elements to the right by one hex grid element, pass
          * {@link #CONST_Width3fourth} as the parameter. The component will
          * automatically {@link #repaint()}.</p>
          * @param Pixels The number of pixels to move to the right.
          * @return The number of pixels moved to the right. This is always between 0
          * and {@code abs(Pixels)}.
         public synchronized int moveRight(int Pixels) {
              int delta = Math.min(m_Model.getXElements() * CONST_Width3fourth + CONST_Width1fourth - getSize().width, m_ScrollPosition.x + Math.max(0, Pixels)) - m_ScrollPosition.x;
              if (delta != 0) {
                   m_ScrollPosition.x += delta;
                   repaint();
              return delta;
         /** <p>Moves the visible elements down by the number of pixels.</p>
          * <p>To move the visible elements down by one hex grid element, pass {@link
          * #CONST_Height} as the parameter. The component will automatically {@link
          * #repaint()}.</p>
          * @param Pixels The number of pixels to move down.
          * @return The number of pixels moved down. This is always between 0 and
          * {@code abs(Pixels)}.
         public synchronized int moveDown(int Pixels) {
              int delta = Math.min(m_Model.getYElements() * CONST_Height + CONST_Heighthalf - getSize().height, m_ScrollPosition.y + Math.max(0, Pixels)) - m_ScrollPosition.y;
              if (delta != 0) {
                   m_ScrollPosition.y += delta;
                   repaint();
              return delta;
         /** <p>Checks if the hex grid element of the given index is currently
          * displayed on the screen (even just one pixel).</p>
          * <p>The intention of this method is to check if a {@link #repaint()} is
          * necessary or not.</p>
          * @param ElementIndex The index of the element to check.
          * @return {@code true} if the hex grid element of the given index is
          * displayed on the screen, {@code false} if not.
         public synchronized boolean isElementOnScreen(Point ElementIndex) { return isElementInScope(ElementIndex, m_CurrentOffset, new Point(m_CurrentOffset.x + m_MaxColumn, m_CurrentOffset.y + m_MaxRow)); }
         /** <p>Checks if the hex grid element of the given index is within the given
          * indexes.</p>
          * <p>The intention of this method is to check if a {@link #repaint()} is
          * necessary or not.</p>
          * @param ElementIndex The index of the element to check.
          * @param ReferenceIndexLeftTop The left top index of the area to check.
          * @param ReferenceIndexRightBottom The right bottom index of the area to check.
          * @return {@code true} if the hex grid element of the given index is within
          * the given area, {@code false} if not.
         public synchronized boolean isElementInScope(Point ElementIndex, Point ReferenceIndexLeftTop, Point ReferenceIndexRightBottom) { if ((ElementIndex.x >= ReferenceIndexLeftTop.x) && (ElementIndex.x <= ReferenceIndexRightBottom.x) && (ElementIndex.y >= ReferenceIndexLeftTop.y) && (ElementIndex.y <= (ReferenceIndexRightBottom.y))) { return true; } else { return false; } }
         /** <p>Return the {@link IHexGridElement hex grid element} shown at the given
          * pixel on the screen.</p>
          * <p><b>Remark: There seems to be a bug in retrieving the proper element,
          * propably caused by rounding errors and unprecise pixel calculations.</p>
          * @param P The pixel on the screen.
          * @return The {@link IHexGridElement hex grid element} shown at the pixel.
         public synchronized IHexGridElement getElementAtPixel(Point P) {
              // @FIXME Here seems to be some bugs remaining
              int dummy = 0; // Variable for warning to indicate that there is something to do :)
              // Calculate the pixel on the image, not on the screen
              int px = P.x + m_PixelOffset.x;
              int py = P.y + m_PixelOffset.y;
              // Determine the x-index of the column (is maybe decreased by one)
              int x = px / CONST_Width3fourth + m_CurrentOffset.x;
              // If the column is odd, then shift the y-pixel by half element height
              if ((x % 2) == 1) { py -= CONST_Heighthalf; }
              // Determine the y-index of the row (is maybe decreased by one)
              int y = py / CONST_Height + m_CurrentOffset.y;
              // Normative coordinates to a single element
              px -= (x - m_CurrentOffset.x) * CONST_Width3fourth;
              py -= (y - m_CurrentOffset.y) * CONST_Height;
              // Check if the normative pixel is in the first quarter of a column
              if (px < CONST_Width1fourth) {
                   // Adjustments to the index may be necessary
                   if (py < CONST_Heighthalf) {
                        // We are in the upper half of a hex-element
                        double ty = CONST_Heighthalf - CONST_Steepness * px;
                        if (py < ty) { x--; }
                   } else {
                        // We are in the lower half of a hex-element
                        double ty = CONST_Heighthalf + CONST_Steepness * px;
                        if (py > ty) {
                             x--;
                             y++;
              return m_Model.getElementAt(x, y);
    }Ah, just to give you some idea: I use this component to visualize a hex grid map with more than 1 million grid elements. And it works, really fast, and requires less than 10 MByte of memory.

  • Useless code in java.awt.image.SampleModel.java?

    Hey there,
    i just looked up the sourcecode of java.awt.image.SampleModel.java in JDK 6
    I discovered two issues i'd like to discuss.
    1) on lines 736 to 739 this code is stated:
    if (iArray != null)
    pixels = iArray;
    else
    pixels = new int[numBands * w * h];
    I asked myself, why does this code exist? while the getPixels() method is overwritten twice by double[] getPixels() and float[] getPixels, it is impossible to reach the part of the java code that initializes the pixels-array. One could only step into that line if "null" is given for the i/d/fArray-parameter. but if one would do so, the Java parser couldn't determine, which method is to use. so this part of code is just useless IMHO.
    the java developers could get a little more performance out of this method if the if statement would be cut out - especially when reading a lot of very small rasters
    or, on the other hand, they could replace this piece of code by an explicit bounds check.
    When somebody touches this code, i would appreciate it if the errormessage "index out of bounds!" could be rewritten to be a little more verbose, like: Index out of bounds(x=123; y=456, maxX=100, maxY=400)!(numbers are just examples)
    I hope i didn't miss something very basic and could help improving this class a little bit.
    2) the local variable Offset(line 734) is coded against code conventions which say, variables shall start with a lowercase letter. Offset obviously doesn't fit that convention.
    best regards
    kdot

    One could only step into that line if "null" is given for the i/d/fArray-parameter. but if one would do so, the Java parser couldn't determine, which method is to use. so this part of code is just useless IMHO. You can have
    sampleModel.getPixels(x,y,w,h,(int[]) null, dataBuffer);No ambiguity on which method to use.
    the local variable Offset(line 734) is coded against code conventions which say, variables shall start with a lowercase letter. Offset obviously doesn't fit that convention. You're correct, offset is against coding conventions. So are many other examples scattered throughout the jdk source code. For example, Hashtable should be called HashTable. In some cases the coding conventions might not have been established when the original code was written. In other cases it might have been human error. In yet other cases the conventions were probably ignored. The person who wrote the SampleModel class did so some 10+ years ago (Java 1.2). Who knows what he/she was thinking at the time, and in all honesty - does it really matter in this case?
    Did you know there are some classes that declare unused local variables (ahem ColorConvertOp)? Some also have unused imports ( *** cough *** BufferedImage *** cough *** ). In essence, the jdk source code is not the epidemy of code correctness. But it's still pretty good.

  • OutOfMemory error in java.awt.image.DataBufferInt. init

    We have an applet application that performs Print Preview of the images in the canvas. The images are like a network of entities (it has pictures of the entities involve (let's say Person) and how it links to other entities). We are using IE to launch the applet.
    We set min heap space to 128MB, JVM max heap space to 256MB, java plugin max heap space to 256MB using the Control Panel > Java.
    When the canvas width is about 54860 and height is 1644 and perform Print Preview, it thows an OutOfMemoryError in java.awt.image.DataBufferInt.<int>, hence, the Print Preview page is not shown. The complete stack trace (and logs) is as follows:
    Width: 54860 H: 1644
    Max heap: 254 # using Runtime.getRuntime().maxMemory()
    javaplugin.maxHeapSize: 256M # using System.getProperties("javaplugin.maxHeapSize")
    n page x n page : 1x1
    Exception in thread "AWT-EventQueue-2" java.lang.OutOfMemoryError: Java heap space
         at java.awt.image.DataBufferInt.<init>(Unknown Source)
         at java.awt.image.Raster.createPackedRaster(Unknown Source)
         at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
         at java.awt.image.BufferedImage.<init>(Unknown Source)
         at com.azeus.gdi.chart.GDIChart.preparePreview(GDIChart.java:731)
         at com.azeus.gdi.chart.GDIChart.getPreview(GDIChart.java:893)
         at com.azeus.gdi.ui.GDIUserInterface.printPreviewOp(GDIUserInterface.java:1526)
         at com.azeus.gdi.ui.GDIUserInterface$21.actionPerformed(GDIUserInterface.java:1438)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Drilling down the cause of the problem. The OutOfMemory occurred in the constructor of DataBufferInt when it tried to create an int array:
    public DataBufferInt(int size) {
    super(STABLE, TYPE_INT, size);
    data = new int[size]; # this part produce out of memory error when size = width X height
    bankdata = new int[1][];
    bankdata[0] = data;
    The OutOfMemory error occurred when size is width * height (54860 X 1644) which is 90,189,840 bytes (~86MB).
    I can replicate the OutOfMemory error when initiating an int array using a test class when it uses the default max heap space but if I increase the heap space to 256MB, it cannot be replicated in the test class.
    Using a smaller width and height with product not exceeding 64MB, the applet can perform Print Preview successfully.
    Given this, I think the java applet is not using the value assigned in javaplugin.maxHeapSize to set the max heap space, hence, it still uses the default max heap size and throws OutOfMemory in int array when size exceeds the default max heap space which is 64MB.
    For additional information, below is some of the java properties (when press S in java applet console):
    browser = sun.plugin
    browser.vendor = Sun Microsystems, Inc.
    browser.version = 1.1
    java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob = sun.awt.windows.WPrinterJob
    java.class.path = C:\PROGRA~1\Java\jre6\classes
    java.class.version = 50.0
    java.class.version.applet = true
    java.runtime.name = Java(TM) SE Runtime Environment
    java.runtime.version = 1.6.0_17-b04
    java.specification.version = 1.6
    java.vendor.applet = true
    java.version = 1.6.0_17
    java.version.applet = true
    javaplugin.maxHeapSpace = 256M
    javaplugin.nodotversion = 160_17
    javaplugin.version = 1.6.0_17
    javaplugin.vm.options = -Xms128M -Djavaplugin.maxHeapSpace=256M -Xmx256m -Xms128M
    javawebstart.version = javaws-1.6.0_17
    Kindly advise if this is a bug in JRE or wrong setting. If wrong setting, please advise on the proper way to set the heap space to prevent OutOfMemory in initializing int array.
    Thanks a lot.
    Edited by: rei_xanther on Jun 28, 2010 12:01 AM
    Edited by: rei_xanther on Jun 28, 2010 12:37 AM

    rei_xanther wrote:
    ..But the maximum value of the int data type is 2,147,483,647. That is the maximum positive integer value that can be stored in (the 4 bytes of) a signed int, but..
    ..The value that I passed in the int array size is only 90,189,840...its only connection with RAM is that each int requires 4 bytes of memory to hold it.
    new int[size] -- size is 90,189,840Sure. So the number of bytes required to hold those 90,189,840 ints is 360,759,360.
    I assumed that one element in the int array is 1 byte. ..Your assumption is wrong. How could it be possible to store 32 bits (4 bytes) in 8 bits (1 byte)? (a)
    a) Short of some clever compression algorithm applied to the data.

Maybe you are looking for