Hi, This bug 4625249 - UnsupportedOperationException throws in ImageComponent for some ColorModel
is fixed in the upcoming v1.3 beta2 release. Thanks. - Kelvin --------------- Java 3D Team Sun Microsystems Inc. >Date: Sat, 20 Apr 2002 18:11:53 -0400 >From: Vijayaraghavan Rajagopal <[EMAIL PROTECTED]> >Subject: [JAVA3D] Help with ImageComponent methods >To: [EMAIL PROTECTED] >Content-transfer-encoding: 8bit >Delivered-to: [EMAIL PROTECTED] > >Hi, > >I wrote a while back about having problems with the ImageComponent2D constructor. I am still stuck on this. I was told that a NullPointerException occurred as the ColorModel was set to null for my image. I tried to fix that by setting a ColorModel for the object. I read that the ColorModel should have same transfer type as the sample model of the image. Here is the code fragment I used. This code fragment is used to create a RenderedImage. It uses JAI to decode DICOM images > >sampleModel > = RasterFactory.createPixelInterleavedSampleModel(DataBuffer.TYPE_SHORT, > width, > height, > 1); > > > > //create a ColorModel object > ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY); > int bits[] = new int[] {8}; > colorModel = new ComponentColorModel(cs,bits,false,false,Transparency.OPAQUE,DataBuffer.TYPE_SHOR T); >Now I get an unsupported method error. I am not allowed to use TYPE_SHORT. > >Exception occurred during event dispatching: >java.lang.UnsupportedOperationException: This method has not been implemented for transferType 2 > > at java.awt.image.ComponentColorModel.extractComponent(ComponentColorModel.java:372 ) > at java.awt.image.ComponentColorModel.getRGBComponent(ComponentColorModel.java:315) > at java.awt.image.ComponentColorModel.getRed(ComponentColorModel.java:425) > at javax.media.j3d.ImageComponentRetained.copyImage(ImageComponentRetained.java:371 ) > at javax.media.j3d.ImageComponent2DRetained.set(ImageComponent2DRetained.java:370) > at javax.media.j3d.ImageComponent2D.<init>(ImageComponent2D.java:103) > at BrainGUI.actionPerformed(BrainGUI.java:178) > at java.awt.MenuItem.processActionEvent(MenuItem.java:526) > at java.awt.MenuItem.processEvent(MenuItem.java:490) > at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:266) > at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:256) > at java.awt.EventQueue.dispatchEvent(EventQueue.java:336) > at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:1 26) > at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:93) > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88) > at java.awt.EventDispatchThread.run(EventDispatchThread.java:80) > >Can someone also tell me how I can find out what these exceptions mean, and how I can figure out what I am doing wrong? I am sorry if this problem seems too simple. I am very new to Java. > > >__________________________________________________________________ >Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ > >Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ > >=========================================================================== >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >of the message "signoff JAVA3D-INTEREST". For general help, send email to >[EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".