You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(116) |
May
(220) |
Jun
(52) |
Jul
(30) |
Aug
(35) |
Sep
(24) |
Oct
(49) |
Nov
(44) |
Dec
(70) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(21) |
Feb
(30) |
Mar
(9) |
Apr
(44) |
May
(2) |
Jun
|
Jul
(10) |
Aug
(20) |
Sep
(25) |
Oct
(12) |
Nov
(16) |
Dec
(4) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(10) |
2006 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(33) |
2007 |
Jan
(4) |
Feb
(57) |
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ma...@us...> - 2003-10-25 05:53:18
|
Update of /cvsroot/jrman/drafts/src/org/jrman/grid In directory sc8-pr-cvs1:/tmp/cvs-serv12135/src/org/jrman/grid Modified Files: BooleanGrid.java Color3fGrid.java FloatGrid.java Point3fGrid.java Vector3fGrid.java Log Message: Started work on type definitions. Index: BooleanGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/BooleanGrid.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BooleanGrid.java 6 May 2003 02:15:11 -0000 1.5 --- BooleanGrid.java 25 Oct 2003 05:46:46 -0000 1.6 *************** *** 26,29 **** --- 26,33 ---- public boolean[] data; + public static BooleanGrid getInstance() { + return new BooleanGrid(); + } + public BooleanGrid() { data = new boolean[maxSize]; Index: Color3fGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Color3fGrid.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Color3fGrid.java 17 Jul 2003 16:35:50 -0000 1.7 --- Color3fGrid.java 25 Oct 2003 05:46:46 -0000 1.8 *************** *** 42,45 **** --- 42,49 ---- } + public static Color3fGrid getInstance() { + return new Color3fGrid(); + } + public Color3fGrid() { data = new Color3f[maxSize]; Index: FloatGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/FloatGrid.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FloatGrid.java 21 Aug 2003 22:53:47 -0000 1.15 --- FloatGrid.java 25 Oct 2003 05:46:46 -0000 1.16 *************** *** 42,45 **** --- 42,49 ---- } + public static FloatGrid getInstance() { + return new FloatGrid(); + } + public FloatGrid() { data = new float[maxSize]; Index: Point3fGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Point3fGrid.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Point3fGrid.java 6 May 2003 02:15:12 -0000 1.4 --- Point3fGrid.java 25 Oct 2003 05:46:47 -0000 1.5 *************** *** 26,29 **** --- 26,33 ---- public class Point3fGrid extends Tuple3fGrid { + public static Point3fGrid getInstance() { + return new Point3fGrid(); + } + public Point3fGrid() { data = new Point3f[maxSize]; Index: Vector3fGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Vector3fGrid.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Vector3fGrid.java 20 May 2003 01:08:38 -0000 1.6 --- Vector3fGrid.java 25 Oct 2003 05:46:47 -0000 1.7 *************** *** 26,29 **** --- 26,33 ---- public class Vector3fGrid extends Tuple3fGrid { + public static Vector3fGrid getInstance() { + return new Vector3fGrid(); + } + public Vector3fGrid() { data = new Vector3f[maxSize]; |
From: <ma...@us...> - 2003-10-25 05:52:07
|
Update of /cvsroot/jrman/drafts/scheme In directory sc8-pr-cvs1:/tmp/cvs-serv12135/scheme Modified Files: design.scm Added Files: sl.scm Log Message: Started work on type definitions. --- NEW FILE: sl.scm --- (define-constant SL-UNIFORM :: <int> #x01) (define-constant SL-TUPLE3 :: <int> #x02) (define-constant SL-TUPLE4 :: <int> #x04) (define-constant SL-TUPLE3-MASK :: <int> #x18) (define-constant SL-TUPLE3-POINT :: <int> #x08) (define-constant SL-TUPLE3-VECTOR :: <int> #x10) (define-constant SL-TUPLE3-COLOR :: <int> #x18) (define-constant SL-STRING :: <int> #x20) (define-constant SL-MATRIX :: <int> #x40) (define-constant SL-BOOLEAN :: <int> #x80) (define (sl-uniform? sl-type) (not (zero? (logand SL-UNIFORM sl-type)))) (define (sl-varying? sl-type) (zero? (logand SL-UNIFORM sl-type))) (define (sl-tuple3? sl-type) (not (zero? (logand SL-TUPLE3 sl-type)))) (define (sl-tuple4? sl-type) (not (zero? (logand SL-TUPLE4 sl-type)))) (define (sl-point? sl-type) (and (sl-tuple3? sl-type) (= (logand SL-TUPLE3-MASK sl-type) SL-TUPLE3-POINT))) (define (sl-vector? sl-type) (and (sl-tuple3? sl-type) (= (logand SL-TUPLE3-MASK sl-type) SL-TUPLE3-VECTOR))) (define (sl-color? sl-type) (and (sl-tuple3? sl-type) (= (logand SL-TUPLE3-MASK sl-type) SL-TUPLE3-COLOR))) (define (sl-string? sl-type) (not (zero? (logand SL-STRING sl-type)))) (define (sl-matrix? sl-type) (not (zero? (logand SL-MATRIX sl-type)))) (define (sl-boolean? sl-type) (not (zero? (logand SL-BOOLEAN sl-type)))) Index: design.scm =================================================================== RCS file: /cvsroot/jrman/drafts/scheme/design.scm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** design.scm 23 Oct 2003 08:14:14 -0000 1.1 --- design.scm 25 Oct 2003 05:46:46 -0000 1.2 *************** *** 1,5 **** (define (constant) ! (set! Oi Os) ! (set! Ci (* Os Cs))) (define (matte #!key --- 1,5 ---- (define (constant) ! ($= Oi Os) ! ($= Ci ($* Os Cs))) (define (matte #!key *************** *** 7,14 **** (Kd (make-uniform-float 1))) (let* ((Nf (faceforward (normalize N) I))) ! (set! Oi Os) ! (set! Ci (* Os Cs ! (+ (* Ka (ambient)) ! (* Kd (diffuse Nf))))))) (define (metal #!key --- 7,14 ---- (Kd (make-uniform-float 1))) (let* ((Nf (faceforward (normalize N) I))) ! ($= Oi Os) ! ($= Ci ($* Os Cs ! ($+ ($* Ka (ambient)) ! ($* Kd (diffuse Nf))))))) (define (metal #!key *************** *** 17,24 **** (roughness (make-uniform-float .25))) (let* ((Nf (faceforward (normalize N) I))) ! (set! Oi Os) ! (set! Ci (* Os Cs ! (+ (* Ka (ambient)) ! (* Ks (specular Nf (_- I) roughness))))))) (define (plastic #!key --- 17,24 ---- (roughness (make-uniform-float .25))) (let* ((Nf (faceforward (normalize N) I))) ! ($= Oi Os) ! ($= Ci ($* Os Cs ! ($+ ($* Ka (ambient)) ! ($* Ks (specular Nf ($- I) roughness))))))) (define (plastic #!key *************** *** 30,40 **** (let* ((Nf (faceforward (normalize N) I)) (V (normalize I))) ! (set! Oi Os) ! (set! Ci (* Os (+ (* Cs ! (+ (* Ka (ambient)) ! (* Kd (diffuse Nf)))) ! (* specularcolor Ks (specular Nf V roughness))))))) ! ! ! ! \ No newline at end of file --- 30,36 ---- (let* ((Nf (faceforward (normalize N) I)) (V (normalize I))) ! ($= Oi Os) ! ($= Ci ($* Os ($+ ($* Cs ! ($+ ($* Ka (ambient)) ! ($* Kd (diffuse Nf)))) ! ($* specularcolor Ks (specular Nf V roughness))))))) \ No newline at end of file |
From: <ma...@us...> - 2003-10-24 01:58:32
|
Update of /cvsroot/jrman/drafts/scheme In directory sc8-pr-cvs1:/tmp/cvs-serv5259/scheme Log Message: Directory /cvsroot/jrman/drafts/scheme added to the repository |
From: <ma...@us...> - 2003-10-23 11:03:17
|
Update of /cvsroot/jrman/drafts/scheme In directory sc8-pr-cvs1:/tmp/cvs-serv6252/scheme Added Files: design.scm Log Message: Design draft for new shaders implementation in Scheme. --- NEW FILE: design.scm --- (define (constant) (set! Oi Os) (set! Ci (* Os Cs))) (define (matte #!key (Ka (make-uniform-float 1)) (Kd (make-uniform-float 1))) (let* ((Nf (faceforward (normalize N) I))) (set! Oi Os) (set! Ci (* Os Cs (+ (* Ka (ambient)) (* Kd (diffuse Nf))))))) (define (metal #!key (Ka (make-uniform-float 1)) (Ks (make-uniform-float 1)) (roughness (make-uniform-float .25))) (let* ((Nf (faceforward (normalize N) I))) (set! Oi Os) (set! Ci (* Os Cs (+ (* Ka (ambient)) (* Ks (specular Nf (_- I) roughness))))))) (define (plastic #!key (Ks (make-uniform-float .5)) (Kd (make-uniform-float .5)) (Ka (make-uniform-float 1)) (roughness (make-uniform-float .1)) (specularcolor (make-uniform-float 1))) (let* ((Nf (faceforward (normalize N) I)) (V (normalize I))) (set! Oi Os) (set! Ci (* Os (+ (* Cs (+ (* Ka (ambient)) (* Kd (diffuse Nf)))) (* specularcolor Ks (specular Nf V roughness))))))) |
From: <ega...@us...> - 2003-10-21 01:59:30
|
Update of /cvsroot/jrman/drafts/src/org/jrman/ui In directory sc8-pr-cvs1:/tmp/cvs-serv17863/src/org/jrman/ui Modified Files: Framebuffer.java Log Message: Fixed JPEG bug when rendering in alpha chanel. Index: Framebuffer.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/ui/Framebuffer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Framebuffer.java 8 Oct 2003 12:49:05 -0000 1.1 --- Framebuffer.java 21 Oct 2003 01:58:40 -0000 1.2 *************** *** 36,41 **** public class Framebuffer extends JFrame { private JImageViewerPanel imagePanel= new JImageViewerPanel(); ! private ImageViewerPanelSaveAction save= ! new ImageViewerPanelSaveAction(imagePanel); private StringBuffer sb= new StringBuffer(); private String name; --- 36,40 ---- public class Framebuffer extends JFrame { private JImageViewerPanel imagePanel= new JImageViewerPanel(); ! private ImageViewerPanelSaveAction save; private StringBuffer sb= new StringBuffer(); private String name; *************** *** 47,51 **** public Framebuffer(String name, BufferedImage image) { super(name); ! this.name= name; save.setEnabled(false); imagePanel.setImage(image); --- 46,51 ---- public Framebuffer(String name, BufferedImage image) { super(name); ! this.name= name; ! save = new ImageViewerPanelSaveAction(imagePanel,image.getType()); save.setEnabled(false); imagePanel.setImage(image); |
From: <ega...@us...> - 2003-10-21 01:59:29
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv17863/src/org/jrman/render Modified Files: RendererHidden.java Log Message: Fixed JPEG bug when rendering in alpha chanel. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** RendererHidden.java 16 Oct 2003 04:35:46 -0000 1.47 --- RendererHidden.java 21 Oct 2003 01:58:40 -0000 1.48 *************** *** 257,260 **** --- 257,261 ---- fb.setVisible(true); } + int gridSize = frame.getGridSize(); ShaderVariables shaderVariables = new ShaderVariables(worldToCamera.getInverse()); *************** *** 372,381 **** if (fb != null) fb.refresh( ! column * bucketWidth ! - (column == 0 ? 0 : hPixelLess) ! + (int) rmin.x, ! row * bucketHeight - (row == 0 ? 0 : vPixelLess) + (int) rmin.y, ! bucketWidth - (column == 0 ? hPixelLess : 0), ! bucketHeight - (row == 0 ? vPixelLess : 0)); } else if (displayMode == Display.Mode.Z) { sampler.getDepths(depths); --- 373,380 ---- if (fb != null) fb.refresh( ! column * bucketWidth - (column == 0 ? 0 : hPixelLess) + (int) rmin.x, ! row * bucketHeight - (row == 0 ? 0 : vPixelLess) + (int) rmin.y, ! bucketWidth - (column == 0 ? hPixelLess : 0), ! bucketHeight - (row == 0 ? vPixelLess : 0)); } else if (displayMode == Display.Mode.Z) { sampler.getDepths(depths); |
From: <ega...@us...> - 2003-10-21 01:59:28
|
Update of /cvsroot/jrman/drafts/src/net/falappa/imageio In directory sc8-pr-cvs1:/tmp/cvs-serv17863/src/net/falappa/imageio Modified Files: ImageViewerPanelSaveAction.java ImageWriterSpiFileFilter.java Log Message: Fixed JPEG bug when rendering in alpha chanel. Index: ImageViewerPanelSaveAction.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/imageio/ImageViewerPanelSaveAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ImageViewerPanelSaveAction.java 8 Oct 2003 12:49:05 -0000 1.1 --- ImageViewerPanelSaveAction.java 21 Oct 2003 01:58:40 -0000 1.2 *************** *** 53,152 **** */ public class ImageViewerPanelSaveAction extends AbstractAction { ! private JImageViewerPanel viewerPanel; ! private static final ResourceBundle messagesBundle= ! ResourceBundle.getBundle( ! ImageViewerPanelSaveAction.class.getPackage().getName() ! + ".res.ImageViewerPanelActions"); ! private JFileChooser fc; ! ! /** ! * Constructs and initializes this object ! * @param viewerPanel the <code>JImageViewerPanel</code> this action is linked to ! */ ! public ImageViewerPanelSaveAction(JImageViewerPanel viewerPanel) { ! super(messagesBundle.getString("ImageViewerPanelSaveAction.Save_1")); //$NON-NLS-1$ ! assert viewerPanel!=null; ! this.viewerPanel= viewerPanel; ! putValue(SHORT_DESCRIPTION, messagesBundle.getString("ImageViewerPanelSaveAction.Save_image_to_file_2")); //$NON-NLS-1$ ! putValue(SMALL_ICON, UIManager.getIcon("FileView.floppyDriveIcon")); //$NON-NLS-1$ ! } ! /* (non-Javadoc) ! * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) ! */ ! public void actionPerformed(ActionEvent e) { ! if (fc == null) { ! fc= new JFileChooser(); ! fc.setAcceptAllFileFilterUsed(false); ! fc.setFileSelectionMode(JFileChooser.FILES_ONLY); ! fc.setMultiSelectionEnabled(false); ! fc.setDialogTitle(messagesBundle.getString("ImageViewerPanelSaveAction.Choose_filename_to_save_4")); //$NON-NLS-1$ ! // prepare file filters ! IIORegistry theRegistry= IIORegistry.getDefaultInstance(); ! Iterator it= ! theRegistry.getServiceProviders(ImageWriterSpi.class, false); ! while (it.hasNext()) { ! ImageWriterSpi writer= (ImageWriterSpi)it.next(); ! ImageWriterSpiFileFilter ff= ! new ImageWriterSpiFileFilter(writer); ! fc.addChoosableFileFilter(ff); ! } ! } ! if (fc.showSaveDialog(viewerPanel) == JFileChooser.APPROVE_OPTION) { ! File selectedFile= fc.getSelectedFile(); ! if (selectedFile != null) { ! String fileName= selectedFile.getAbsolutePath(); ! ImageWriterSpiFileFilter ff= ! (ImageWriterSpiFileFilter)fc.getFileFilter(); ! if (!ff.hasCorrectSuffix(fileName)) ! fileName= ff.addSuffix(fileName); ! selectedFile= new File(fileName); ! if (selectedFile.exists()) { ! String message= MessageFormat.format(messagesBundle.getString("ImageViewerPanelSaveAction.Overwrite_question_5"), //$NON-NLS-1$ ! new String[] { fileName }); ! if (JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog(viewerPanel, message, messagesBundle.getString("ImageViewerPanelSaveAction.Warning_6"), //$NON-NLS-1$ ! JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE)) ! return; ! } ! writeToFile(selectedFile, ff); ! } ! } ! } ! private void writeToFile(File selectedFile, ImageWriterSpiFileFilter ff) { ! try { ! ImageOutputStream ios= ! ImageIO.createImageOutputStream(selectedFile); ! ImageWriter iw= ff.getImageWriterSpi().createWriterInstance(); ! iw.setOutput(ios); ! ImageWriteParam iwp= iw.getDefaultWriteParam(); ! if (iwp.canWriteCompressed()) { ! iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); ! // set maximum image quality ! iwp.setCompressionQuality(1.f); ! } ! Image image= viewerPanel.getImage(); ! BufferedImage bufferedImage; ! if (viewerPanel.getImage() instanceof BufferedImage) ! bufferedImage= (BufferedImage)viewerPanel.getImage(); ! else { ! bufferedImage= ! new BufferedImage( ! image.getWidth(null), ! image.getHeight(null), ! BufferedImage.TYPE_INT_RGB); ! bufferedImage.createGraphics().drawImage(image, 0, 0, null); ! } ! iw.write(null, new IIOImage(bufferedImage, null, null), iwp); ! iw.dispose(); ! ios.close(); ! } ! catch (IOException ioe) { ! JOptionPane.showMessageDialog(viewerPanel, messagesBundle.getString("ImageViewerPanelSaveAction.Error_during_image_saving_message_7"), //$NON-NLS-1$ ! messagesBundle.getString("ImageViewerPanelSaveAction.Error_dialog_title_8"), //$NON-NLS-1$ ! JOptionPane.ERROR_MESSAGE); ! ioe.printStackTrace(); ! } ! } } --- 53,170 ---- */ public class ImageViewerPanelSaveAction extends AbstractAction { ! private JImageViewerPanel viewerPanel; ! private int imageType; ! private static final ResourceBundle messagesBundle= ! ResourceBundle.getBundle(ImageViewerPanelSaveAction.class.getPackage().getName() ! + ".res.ImageViewerPanelActions"); ! private JFileChooser fc; ! /** ! * Constructs and initializes this object ! * @param viewerPanel the <code>JImageViewerPanel</code> this action is linked to ! */ ! public ImageViewerPanelSaveAction(JImageViewerPanel viewerPanel,int imageType){ ! super(messagesBundle.getString("ImageViewerPanelSaveAction.Save_1")); //$NON-NLS-1$ ! assert viewerPanel!=null; ! this.imageType = imageType; ! this.viewerPanel= viewerPanel; ! putValue(SHORT_DESCRIPTION, ! messagesBundle.getString("ImageViewerPanelSaveAction.Save_image_to_file_2")); ! //$NON-NLS-1$ ! putValue(SMALL_ICON, UIManager.getIcon("FileView.floppyDriveIcon")); //$NON-NLS-1$ ! } ! /* (non-Javadoc) ! * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) ! */ ! public void actionPerformed(ActionEvent e) { ! if (fc == null) { ! fc= new JFileChooser(); ! fc.setAcceptAllFileFilterUsed(false); ! fc.setFileSelectionMode(JFileChooser.FILES_ONLY); ! fc.setMultiSelectionEnabled(false); ! fc.setDialogTitle(messagesBundle.getString ! ("ImageViewerPanelSaveAction.Choose_filename_to_save_4")); ! //$NON-NLS-1$ ! ! // prepare file filters ! IIORegistry theRegistry= IIORegistry.getDefaultInstance(); ! Iterator it= ! theRegistry.getServiceProviders(ImageWriterSpi.class, false); ! while (it.hasNext()) { ! ImageWriterSpi writer= (ImageWriterSpi)it.next(); ! if((imageType == BufferedImage.TYPE_INT_ARGB ! || imageType == BufferedImage.TYPE_INT_ARGB_PRE) && ! "JPEG".equals(writer.getFormatNames()[0].toUpperCase())) ! continue; ! ImageWriterSpiFileFilter ff= new ImageWriterSpiFileFilter(writer); ! fc.addChoosableFileFilter(ff); ! } ! } ! if (fc.showSaveDialog(viewerPanel) == JFileChooser.APPROVE_OPTION) { ! File selectedFile= fc.getSelectedFile(); ! if (selectedFile != null) { ! String fileName= selectedFile.getAbsolutePath(); ! ImageWriterSpiFileFilter ff= ! (ImageWriterSpiFileFilter)fc.getFileFilter(); ! if (!ff.hasCorrectSuffix(fileName)) ! fileName= ff.addSuffix(fileName); ! selectedFile= new File(fileName); ! if (selectedFile.exists()) { ! String message = MessageFormat.format ! (messagesBundle ! .getString("ImageViewerPanelSaveAction.Overwrite_question_5"), ! //$NON-NLS-1$ ! new String[] { fileName }); ! if (JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog ! (viewerPanel, message, ! messagesBundle.getString("ImageViewerPanelSaveAction.Warning_6"), ! //$NON-NLS-1$ ! JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE)) ! return; ! } ! writeToFile(selectedFile, ff); ! } ! } ! } + private void writeToFile(File selectedFile, ImageWriterSpiFileFilter ff) { + try { + ImageOutputStream ios= + ImageIO.createImageOutputStream(selectedFile); + ImageWriter iw= ff.getImageWriterSpi().createWriterInstance(); + iw.setOutput(ios); + ImageWriteParam iwp= iw.getDefaultWriteParam(); + if (iwp.canWriteCompressed()) { + iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); + // set maximum image quality + iwp.setCompressionQuality(1.f); + } + Image image= viewerPanel.getImage(); + BufferedImage bufferedImage; + if (viewerPanel.getImage() instanceof BufferedImage) + bufferedImage= (BufferedImage)viewerPanel.getImage(); + else { + bufferedImage= + new BufferedImage( + image.getWidth(null), + image.getHeight(null), + BufferedImage.TYPE_INT_RGB); + bufferedImage.createGraphics().drawImage(image, 0, 0, null); + } + iw.write(null, new IIOImage(bufferedImage, null, null), iwp); + iw.dispose(); + ios.close(); + } + catch (IOException ioe) { + JOptionPane.showMessageDialog + (viewerPanel, messagesBundle.getString + ("ImageViewerPanelSaveAction.Error_during_image_saving_message_7"), + //$NON-NLS-1$ + messagesBundle.getString("ImageViewerPanelSaveAction.Error_dialog_title_8"), + //$NON-NLS-1$ + JOptionPane.ERROR_MESSAGE); + ioe.printStackTrace(); + } + } } Index: ImageWriterSpiFileFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/imageio/ImageWriterSpiFileFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ImageWriterSpiFileFilter.java 8 Oct 2003 12:49:05 -0000 1.1 --- ImageWriterSpiFileFilter.java 21 Oct 2003 01:58:40 -0000 1.2 *************** *** 71,74 **** --- 71,75 ---- return description; } + /** * Tests if a string ends with one of the suffixes accepted by the image writer. |
From: <ega...@us...> - 2003-10-21 01:59:17
|
Update of /cvsroot/jrman/drafts/src/net/falappa/swing/widgets In directory sc8-pr-cvs1:/tmp/cvs-serv17863/src/net/falappa/swing/widgets Modified Files: JImageViewerPanel.java Log Message: Fixed JPEG bug when rendering in alpha chanel. Index: JImageViewerPanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/swing/widgets/JImageViewerPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JImageViewerPanel.java 8 Oct 2003 12:24:08 -0000 1.1 --- JImageViewerPanel.java 21 Oct 2003 01:58:40 -0000 1.2 *************** *** 772,777 **** return maxZoom; } ! ! //override of JComponent method protected void paintComponent(Graphics g) { Graphics2D g2= (Graphics2D)g; --- 772,777 ---- return maxZoom; } ! ! //override of JComponent method protected void paintComponent(Graphics g) { Graphics2D g2= (Graphics2D)g; |
From: <ega...@us...> - 2003-10-17 22:10:05
|
Update of /cvsroot/jrman/drafts In directory sc8-pr-cvs1:/tmp/cvs-serv18814 Modified Files: build.xml Log Message: Added javax.vecmath unofficial implementation. Index: build.xml =================================================================== RCS file: /cvsroot/jrman/drafts/build.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** build.xml 16 Oct 2003 04:44:40 -0000 1.13 --- build.xml 17 Oct 2003 22:05:13 -0000 1.14 *************** *** 3,6 **** --- 3,7 ---- <property file="build.properties"/> <property name="src" location="src"/> + <property name="lib" location="lib"/> <property name="build" location="build"/> <property name="jrman" location="jrMan"/> *************** *** 20,24 **** description="compile the source " > <!-- Compile the java code from ${src} into ${build} --> ! <javac srcdir="${src}" destdir="${build}" source="1.4" debug="on" /> </target> --- 21,26 ---- description="compile the source " > <!-- Compile the java code from ${src} into ${build} --> ! <javac srcdir="${src}" destdir="${build}" source="1.4" debug="on" ! classpath="${lib}/vecmath.jar" /> </target> *************** *** 56,59 **** --- 58,67 ---- </fileset> </copy> + + <copy todir="${dist}/jar" > + <fileset dir="${lib}"> + <include name="**"/> + </fileset> + </copy> <chmod perm="+x" file="${dist}/bin/jrman"/> |
From: <ega...@us...> - 2003-10-17 22:09:37
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv18814/src/org/jrman/parser Modified Files: Parser.java Log Message: Added javax.vecmath unofficial implementation. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Parser.java 30 Sep 2003 23:27:46 -0000 1.64 --- Parser.java 17 Oct 2003 22:05:15 -0000 1.65 *************** *** 286,289 **** --- 286,290 ---- new AxisAngle4f(dx, dy, dz, (float) Math.toRadians(angle)); Matrix4f rotation = new Matrix4f(); + rotation.setIdentity(); rotation.set(axisAngle); concatTransform(rotation); |
From: <ega...@us...> - 2003-10-17 22:09:37
|
Update of /cvsroot/jrman/drafts/jrMan/bin In directory sc8-pr-cvs1:/tmp/cvs-serv18814/jrMan/bin Modified Files: jrman jrman.bat mktxr mktxr.bat Log Message: Added javax.vecmath unofficial implementation. Index: jrman =================================================================== RCS file: /cvsroot/jrman/drafts/jrMan/bin/jrman,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** jrman 12 Jun 2003 18:36:07 -0000 1.2 --- jrman 17 Oct 2003 22:05:13 -0000 1.3 *************** *** 1,3 **** ! export CLASSPATH=$JRMAN_HOME/jar/jrman.jar export MEMORY=160m --- 1,3 ---- ! export CLASSPATH=$JRMAN_HOME/jar/jrman.jar:$JRMAN_HOME/jar/vecmath.jar export MEMORY=160m Index: jrman.bat =================================================================== RCS file: /cvsroot/jrman/drafts/jrMan/bin/jrman.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** jrman.bat 8 Oct 2003 12:49:05 -0000 1.3 --- jrman.bat 17 Oct 2003 22:05:13 -0000 1.4 *************** *** 1,5 **** @echo off ! set CLASSPATH=%JRMAN_HOME%\jar\jrman.jar set MEMORY=160m java -Xms%MEMORY% -Xmx%MEMORY% org.jrman.main.JRMan %* --- 1,5 ---- @echo off ! set CLASSPATH=%JRMAN_HOME%\jar\jrman.jar;%JRMAN_HOME%\jar\vecmath.jar set MEMORY=160m java -Xms%MEMORY% -Xmx%MEMORY% org.jrman.main.JRMan %* Index: mktxr =================================================================== RCS file: /cvsroot/jrman/drafts/jrMan/bin/mktxr,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mktxr 12 Jun 2003 18:36:07 -0000 1.1 --- mktxr 17 Oct 2003 22:05:13 -0000 1.2 *************** *** 1,3 **** ! export CLASSPATH=$JRMAN_HOME/jar/jrman.jar export MEMORY=192m --- 1,3 ---- ! export CLASSPATH=$JRMAN_HOME/jar/jrman.jar:$JRMAN_HOME/jar/vecmath.jar export MEMORY=192m Index: mktxr.bat =================================================================== RCS file: /cvsroot/jrman/drafts/jrMan/bin/mktxr.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mktxr.bat 8 Oct 2003 15:20:19 -0000 1.3 --- mktxr.bat 17 Oct 2003 22:05:13 -0000 1.4 *************** *** 1,5 **** @echo off ! set CLASSPATH=%JRMAN_HOME%\jar\jrman.jar set MEMORY=192m java -Xms%MEMORY% -Xmx%MEMORY% org.jrman.main.MkTxr %* --- 1,5 ---- @echo off ! set CLASSPATH=%JRMAN_HOME%\jar\jrman.jar;%JRMAN_HOME%\jar\vecmath.jar set MEMORY=192m java -Xms%MEMORY% -Xmx%MEMORY% org.jrman.main.MkTxr %* |
From: <ega...@us...> - 2003-10-17 22:09:21
|
Update of /cvsroot/jrman/drafts/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18814/lib Added Files: vecmath.jar Log Message: Added javax.vecmath unofficial implementation. --- NEW FILE: vecmath.jar --- (This appears to be a binary file; contents omitted.) |
From: <ega...@us...> - 2003-10-17 22:02:58
|
Update of /cvsroot/jrman/drafts/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18119/lib Log Message: Directory /cvsroot/jrman/drafts/lib added to the repository |
From: <ega...@us...> - 2003-10-16 04:45:19
|
Update of /cvsroot/jrman/drafts In directory sc8-pr-cvs1:/tmp/cvs-serv630 Modified Files: build.xml Log Message: removed vecmath test import Index: build.xml =================================================================== RCS file: /cvsroot/jrman/drafts/build.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** build.xml 16 Oct 2003 04:35:46 -0000 1.12 --- build.xml 16 Oct 2003 04:44:40 -0000 1.13 *************** *** 40,44 **** basedir="${build}"> <fileset dir="src"> - <include name="javax/**"/> <include name="net/**"/> <include name="org/**"/> --- 40,43 ---- |
From: <ega...@us...> - 2003-10-16 04:36:15
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv31896/src/org/jrman/render Modified Files: RendererHidden.java Log Message: Fixed rendering to a file bug. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** RendererHidden.java 8 Oct 2003 15:20:19 -0000 1.46 --- RendererHidden.java 16 Oct 2003 04:35:46 -0000 1.47 *************** *** 413,419 **** * 3); } ! System.out.println(); ! fb.completed(); ! if (displayType == Display.Type.FILE) try { if (displayMode == Display.Mode.RGB || displayMode == Display.Mode.RGBA) { --- 413,420 ---- * 3); } ! if (displayType == Display.Type.FRAMEBUFFER) { ! System.out.println(); ! fb.completed(); ! }else if (displayType == Display.Type.FILE) try { if (displayMode == Display.Mode.RGB || displayMode == Display.Mode.RGBA) { |
From: <ega...@us...> - 2003-10-16 04:36:09
|
Update of /cvsroot/jrman/drafts In directory sc8-pr-cvs1:/tmp/cvs-serv31896 Modified Files: build.xml Log Message: Fixed rendering to a file bug. Index: build.xml =================================================================== RCS file: /cvsroot/jrman/drafts/build.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** build.xml 8 Oct 2003 15:20:19 -0000 1.11 --- build.xml 16 Oct 2003 04:35:46 -0000 1.12 *************** *** 40,43 **** --- 40,44 ---- basedir="${build}"> <fileset dir="src"> + <include name="javax/**"/> <include name="net/**"/> <include name="org/**"/> |
From: <ega...@us...> - 2003-10-08 15:20:23
|
Update of /cvsroot/jrman/drafts In directory sc8-pr-cvs1:/tmp/cvs-serv12217 Modified Files: build.xml Log Message: More changes for new feature Index: build.xml =================================================================== RCS file: /cvsroot/jrman/drafts/build.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** build.xml 30 Sep 2003 00:35:26 -0000 1.10 --- build.xml 8 Oct 2003 15:20:19 -0000 1.11 *************** *** 40,43 **** --- 40,44 ---- basedir="${build}"> <fileset dir="src"> + <include name="net/**"/> <include name="org/**"/> <include name="*.java"/> |
From: <ega...@us...> - 2003-10-08 15:20:23
|
Update of /cvsroot/jrman/drafts/jrMan/bin In directory sc8-pr-cvs1:/tmp/cvs-serv12217/jrMan/bin Modified Files: mktxr.bat Log Message: More changes for new feature Index: mktxr.bat =================================================================== RCS file: /cvsroot/jrman/drafts/jrMan/bin/mktxr.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mktxr.bat 3 Jul 2003 17:57:52 -0000 1.2 --- mktxr.bat 8 Oct 2003 15:20:19 -0000 1.3 *************** *** 3,5 **** set CLASSPATH=%JRMAN_HOME%\jar\jrman.jar set MEMORY=192m ! java -Xms%MEMORY% -Xmx%MEMORY% org.jrman.main.MkTxr %1 %2 %3 %4 %5 %6 %7 \ No newline at end of file --- 3,5 ---- set CLASSPATH=%JRMAN_HOME%\jar\jrman.jar set MEMORY=192m ! java -Xms%MEMORY% -Xmx%MEMORY% org.jrman.main.MkTxr %* |
From: <ega...@us...> - 2003-10-08 15:20:23
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv12217/src/org/jrman/render Modified Files: RendererHidden.java Log Message: More changes for new feature Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** RendererHidden.java 8 Oct 2003 12:49:05 -0000 1.45 --- RendererHidden.java 8 Oct 2003 15:20:19 -0000 1.46 *************** *** 389,393 **** } int percent = (row * bucketColumns + column + 1) * 100 / buckets.length; ! if (percent > percentComplete && (percent % 10) == 0) { percentComplete = percent; System.out.print( --- 389,393 ---- } int percent = (row * bucketColumns + column + 1) * 100 / buckets.length; ! if (percent > percentComplete) { percentComplete = percent; System.out.print( |
From: <ega...@us...> - 2003-10-08 12:49:10
|
Update of /cvsroot/jrman/drafts/src/org/jrman/ui In directory sc8-pr-cvs1:/tmp/cvs-serv18653/src/org/jrman/ui Added Files: Framebuffer.java Log Message: Added Alessandro Falappa FrameBuffer contribution. --- NEW FILE: Framebuffer.java --- /* Framebuffer.java Copyright (C) 2003 Alessandro Falappa This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.ui; import java.awt.image.BufferedImage; import javax.swing.ImageIcon; import javax.swing.JFrame; import net.falappa.imageio.ImageViewerPanelSaveAction; import net.falappa.swing.widgets.JImageViewerPanel; /** * The window of the framebuffer display. * It shows the image being rendered, when finished allows to save the image to * a file. It allows to scroll and zoom the image. * * @author Alessandro Falappa */ public class Framebuffer extends JFrame { private JImageViewerPanel imagePanel= new JImageViewerPanel(); private ImageViewerPanelSaveAction save= new ImageViewerPanelSaveAction(imagePanel); private StringBuffer sb= new StringBuffer(); private String name; /** * @param display * @param image */ public Framebuffer(String name, BufferedImage image) { super(name); this.name= name; save.setEnabled(false); imagePanel.setImage(image); imagePanel.addToolbarAction(save); if (image.getType() == BufferedImage.TYPE_INT_ARGB || image.getType() == BufferedImage.TYPE_INT_ARGB_PRE) { imagePanel.setShowTransparency(true); } setIconImage( new ImageIcon( getClass().getResource("images/framebuffer_icon.png")) .getImage()); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); getContentPane().add(imagePanel); pack(); } /** * * @param x * @param y * @param w * @param h */ public void refresh(int x, int y, int w, int h) { imagePanel.repaintImage(x, y, w, h); sb.setLength(0); sb.append(name).append(" - bucket["); sb.append(x).append(',').append(y).append(']'); setTitle(sb.toString()); } public void completed() { save.setEnabled(true); setTitle(name); sb=null; } } |
From: <ega...@us...> - 2003-10-08 12:49:10
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv18653/src/org/jrman/render Modified Files: RendererHidden.java Log Message: Added Alessandro Falappa FrameBuffer contribution. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** RendererHidden.java 8 Sep 2003 23:03:29 -0000 1.44 --- RendererHidden.java 8 Oct 2003 12:49:05 -0000 1.45 *************** *** 20,32 **** package org.jrman.render; - import java.awt.event.WindowAdapter; - import java.awt.event.WindowEvent; import java.io.File; import java.util.HashMap; import javax.imageio.ImageIO; - import javax.swing.JFrame; - import javax.swing.JScrollPane; - import javax.swing.ScrollPaneConstants; import javax.vecmath.Color3f; import javax.vecmath.Point2f; --- 20,27 ---- *************** *** 35,44 **** import org.jrman.attributes.Attributes; ! import org.jrman.geom.BoundingVolume; ! import org.jrman.geom.Bounds2f; ! import org.jrman.geom.ClippingVolume; ! import org.jrman.geom.PerspectiveTransform; ! import org.jrman.geom.Plane; ! import org.jrman.geom.Transform; import org.jrman.maps.ShadowMap; import org.jrman.options.CameraProjection; --- 30,34 ---- import org.jrman.attributes.Attributes; ! import org.jrman.geom.*; import org.jrman.maps.ShadowMap; import org.jrman.options.CameraProjection; *************** *** 53,56 **** --- 43,47 ---- import org.jrman.shaders.SurfaceShader; import org.jrman.shaders.VolumeShader; + import org.jrman.ui.Framebuffer; import org.jrman.util.Calc; import org.jrman.util.Format; *************** *** 261,282 **** zStore = new ZStore(frame.getHorizontalResolution(), frame.getVerticalResolution()); ! RenderCanvas rc = null; if (displayType == Display.Type.FRAMEBUFFER) { ! JFrame jf = new JFrame(); ! jf.getRootPane().setDoubleBuffered(false); ! jf.setTitle(frame.getDisplay().getName()); ! rc = new RenderCanvas(imageStore); ! jf.getContentPane().add( ! new JScrollPane( ! rc, ! ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ! ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED)); ! jf.pack(); ! jf.addWindowListener(new WindowAdapter() { ! public void windowClosing(WindowEvent e) { ! System.exit(0); ! } ! }); ! jf.setVisible(true); } int gridSize = frame.getGridSize(); --- 252,259 ---- zStore = new ZStore(frame.getHorizontalResolution(), frame.getVerticalResolution()); ! Framebuffer fb = null; if (displayType == Display.Type.FRAMEBUFFER) { ! fb = new Framebuffer(frame.getDisplay().getName(), imageStore.getImage()); ! fb.setVisible(true); } int gridSize = frame.getGridSize(); *************** *** 305,308 **** --- 282,286 ---- long start = System.currentTimeMillis(); Point2f rmin = rasterWindow.getMin(); + int percentComplete = -1; for (int row = 0; row < bucketRows; row++) { for (int column = 0; column < bucketColumns; column++) { *************** *** 392,397 **** bucketHeight - (row == 0 ? vPixelLess : 0), bucketWidth); ! if (rc != null) ! rc.repaint( column * bucketWidth - (column == 0 ? 0 : hPixelLess) --- 370,375 ---- bucketHeight - (row == 0 ? vPixelLess : 0), bucketWidth); ! if (fb != null) ! fb.refresh( column * bucketWidth - (column == 0 ? 0 : hPixelLess) *************** *** 410,413 **** --- 388,401 ---- bucketWidth); } + int percent = (row * bucketColumns + column + 1) * 100 / buckets.length; + if (percent > percentComplete && (percent % 10) == 0) { + percentComplete = percent; + System.out.print( + "\rRendering frame " + + frame.getFrameNumber() + + ": " + + percentComplete + + "% complete"); + } } System.arraycopy( *************** *** 425,428 **** --- 413,418 ---- * 3); } + System.out.println(); + fb.completed(); if (displayType == Display.Type.FILE) try { |
From: <ega...@us...> - 2003-10-08 12:49:10
|
Update of /cvsroot/jrman/drafts/jrMan/bin In directory sc8-pr-cvs1:/tmp/cvs-serv18653/jrMan/bin Modified Files: jrman.bat Log Message: Added Alessandro Falappa FrameBuffer contribution. Index: jrman.bat =================================================================== RCS file: /cvsroot/jrman/drafts/jrMan/bin/jrman.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** jrman.bat 30 May 2003 02:11:19 -0000 1.2 --- jrman.bat 8 Oct 2003 12:49:05 -0000 1.3 *************** *** 3,5 **** set CLASSPATH=%JRMAN_HOME%\jar\jrman.jar set MEMORY=160m ! java -Xms%MEMORY% -Xmx%MEMORY% org.jrman.main.JRMan %1 \ No newline at end of file --- 3,5 ---- set CLASSPATH=%JRMAN_HOME%\jar\jrman.jar set MEMORY=160m ! java -Xms%MEMORY% -Xmx%MEMORY% org.jrman.main.JRMan %* \ No newline at end of file |
Update of /cvsroot/jrman/drafts/src/net/falappa/imageio In directory sc8-pr-cvs1:/tmp/cvs-serv18653/src/net/falappa/imageio Added Files: ImageReaderSpiFileFilter.java ImageWriterSpiFileFilter.java ImageViewerPanelLoadAction.java ImageViewerPanelSaveAction.java Log Message: Added Alessandro Falappa FrameBuffer contribution. --- NEW FILE: ImageReaderSpiFileFilter.java --- package net.falappa.imageio; import java.io.File; import java.text.MessageFormat; import java.util.ResourceBundle; import javax.imageio.spi.ImageReaderSpi; import javax.swing.filechooser.FileFilter; /** * A file filter based on an <code>ImageReaderSpi</code> object. * The file filter accepts directories and files ending with the suffixes * of the <code>ImageReaderSpi</code> object it is based on. * The file filter description is built according to the pattern below: * <blockquote><code> * <I><FORMAT NAME></I> image files (*.<I><FILE SUFFIX></I>;*.<I><FILE SUFFIX></I>;...) * </code></blockquote> * where <FORMAT NAME> is the first string between those returned by * <code>ImageReaderSpi.getFormatNames()</code> method and the <FILE SUFFIX>es * are those returned by <code>ImageReaderSpi.getFileSuffixes()</code> method. * Typical use is as follows: * <pre> * JFileChooser fc=new JFileChooser(); * IIORegistry theRegistry=IIORegistry.getDefaultInstance(); * Iterator it=theRegistry.getServiceProviders(ImageReaderSpi.class,false); * while(it.hasNext()){ * ImageReaderSpi reader=(ImageReaderSpi)it.next(); * ImageReaderSpiFileFilter ff=new ImageReaderSpiFileFilter(reader); * fc.addChoosableFileFilter(ff); * } * </pre> * The class offers utility methods to test if a string is a valid filename * according to the <code>ImageReaderSpi</code> object and to add such a suffix. * @see javax.imageio.spi.ImageReaderSpi#getFormatNames() * @see javax.imageio.spi.ImageReaderSpi#getFileSuffixes() * @author Alessandro Falappa */ public class ImageReaderSpiFileFilter extends FileFilter { private String description; private String[] suffixes; private ImageReaderSpi reader; private static final ResourceBundle messagesBundle= ResourceBundle.getBundle( ImageViewerPanelSaveAction.class.getPackage().getName() + ".res.ImageSpiFileFilters"); /** * Create a file filter based on an image reader. * @param reader the ImageReaderSpi object the filter is based on */ public ImageReaderSpiFileFilter(ImageReaderSpi reader){ this.reader=reader; StringBuffer sb=new StringBuffer(); String template= messagesBundle.getString("ImageSpiFileFilter.image_files"); //$NON-NLS-1$ sb.append( MessageFormat.format( template, new String[] { reader.getFormatNames()[0].toUpperCase()})); suffixes=reader.getFileSuffixes(); sb.append(" (*.").append(suffixes[0]); //$NON-NLS-1$ for (int i = 1; i < suffixes.length; i++) sb.append(";*.").append(suffixes[i]); //$NON-NLS-1$ sb.append(')'); description=sb.toString(); } // implements the method of the abstract base class public boolean accept(File f) { return f.isDirectory()||hasCorrectSuffix(f.getName()); } // implements the method of the abstract base class public String getDescription() { return description; } /** * Tests if a string ends with one of the suffixes accepted by the image reader. * @param name the string to test * @return true if the string passes the test */ public boolean hasCorrectSuffix(String name){ boolean accepted=false; for (int i = 0; !accepted && i < suffixes.length; i++) accepted=accepted||name.endsWith(suffixes[i]); return accepted; } /** * Appends a suffix accepted by the image reader to the file name passed as argument. * @param fileName the file name to modify * @return a new file name */ public String addSuffix(String fileName){ return fileName+"."+suffixes[0]; //$NON-NLS-1$ } /** * Returns the imagewriter corresponding to the filter * @return a ImageReaderSpi object */ public ImageReaderSpi getImageReaderSpi(){ return reader; } } --- NEW FILE: ImageWriterSpiFileFilter.java --- package net.falappa.imageio; import javax.swing.filechooser.*; import javax.imageio.spi.ImageWriterSpi; import java.io.File; import java.text.MessageFormat; import java.util.ResourceBundle; /** * A file filter based on an <code>ImageWriterSpi</code> object. * The file filter accepts directories and files ending with the suffixes * of the <code>ImageWriterSpi</code> object it is based on. * The file filter description is built according to the pattern below: * <blockquote><code> * <I><FORMAT NAME></I> image files (*.<I><FILE SUFFIX></I>;*.<I><FILE SUFFIX></I>;...) * </code></blockquote> * where <FORMAT NAME> is the first string between those returned by * <code>ImageWriterSpi.getFormatNames()</code> method and the <FILE SUFFIX>es * are those returned by <code>ImageWriterSpi.getFileSuffixes()</code> method. * Typical use is as follows: * <pre> * JFileChooser fc=new JFileChooser(); * IIORegistry theRegistry=IIORegistry.getDefaultInstance(); * Iterator it=theRegistry.getServiceProviders(ImageWriterSpi.class,false); * while(it.hasNext()){ * ImageWriterSpi writer=(ImageWriterSpi)it.next(); * ImageWriterSpiFileFilter ff=new ImageWriterSpiFileFilter(writer); * fc.addChoosableFileFilter(ff); * } * </pre> * The class offers utility methods to test if a string is a valid filename * according to the <code>ImageWriterSpi</code> object and to add such a suffix. * @see javax.imageio.spi.ImageWriterSpi#getFormatNames() * @see javax.imageio.spi.ImageWriterSpi#getFileSuffixes() * @author Alessandro Falappa */ public class ImageWriterSpiFileFilter extends FileFilter { private String description; private String[] suffixes; private ImageWriterSpi writer; private static final ResourceBundle messagesBundle= ResourceBundle.getBundle( ImageViewerPanelSaveAction.class.getPackage().getName() + ".res.ImageSpiFileFilters"); /** * Create a file filter based on an image writer. * @param writer the ImageWriterSpi object the filter is based on */ public ImageWriterSpiFileFilter(ImageWriterSpi writer) { this.writer= writer; StringBuffer sb= new StringBuffer(); String template= messagesBundle.getString("ImageSpiFileFilter.image_files"); //$NON-NLS-1$ sb.append( MessageFormat.format( template, new String[] { writer.getFormatNames()[0].toUpperCase()})); suffixes= writer.getFileSuffixes(); sb.append(" (*.").append(suffixes[0]); //$NON-NLS-1$ for (int i= 1; i < suffixes.length; i++) sb.append(";*.").append(suffixes[i]); //$NON-NLS-1$ sb.append(')'); description= sb.toString(); } // implements the method of the abstract base class public boolean accept(File f) { return f.isDirectory() || hasCorrectSuffix(f.getName()); } // implements the method of the abstract base class public String getDescription() { return description; } /** * Tests if a string ends with one of the suffixes accepted by the image writer. * @param name the string to test * @return true if the string passes the test */ public boolean hasCorrectSuffix(String name) { boolean accepted= false; for (int i= 0; !accepted && i < suffixes.length; i++) accepted= accepted || name.endsWith(suffixes[i]); return accepted; } /** * Appends a suffix accepted by the image writer to the file name passed as argument. * @param fileName the file name to modify * @return a new file name */ public String addSuffix(String fileName) { return fileName + "." + suffixes[0]; //$NON-NLS-1$ } /** * Returns the imagewriter corresponding to the filter * @return a ImageWriterSpi object */ public ImageWriterSpi getImageWriterSpi() { return writer; } } --- NEW FILE: ImageViewerPanelLoadAction.java --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ImageViewerPanelSaveAction.java --- (This appears to be a binary file; contents omitted.) |
From: <ega...@us...> - 2003-10-08 12:49:09
|
Update of /cvsroot/jrman/drafts/src/org/jrman/ui/images In directory sc8-pr-cvs1:/tmp/cvs-serv18653/src/org/jrman/ui/images Added Files: framebuffer_icon.png Log Message: Added Alessandro Falappa FrameBuffer contribution. --- NEW FILE: framebuffer_icon.png --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/jrman/drafts/src/net/falappa/imageio/res In directory sc8-pr-cvs1:/tmp/cvs-serv18653/src/net/falappa/imageio/res Added Files: ImageSpiFileFilters.properties ImageViewerPanelActions.properties ImageSpiFileFilters_it.properties ImageViewerPanelActions_it.properties Log Message: Added Alessandro Falappa FrameBuffer contribution. --- NEW FILE: ImageSpiFileFilters.properties --- #Default english string resource bundle for ImageReaderSpiFileFilter and ImageWriterSpiFileFilter ImageSpiFileFilter.image_files={0} image files --- NEW FILE: ImageViewerPanelActions.properties --- #Default english string resource bundle for ImageViewerPaneSaveAction and ImageViewerPaneLoadAction ImageViewerPanelSaveAction.Save_1=Save ImageViewerPanelSaveAction.Save_image_to_file_2=Save image to file ImageViewerPanelSaveAction.Choose_filename_to_save_4=Choose filename to save ImageViewerPanelSaveAction.Overwrite_question_5=The file {0}\nalready exists. Ok to overwrite? ImageViewerPanelSaveAction.Warning_6=Warning ImageViewerPanelSaveAction.Error_during_image_saving_message_7=An error occurred during image saving\! ImageViewerPanelSaveAction.Error_dialog_title_8=Error ImageViewerPanelLoadAction.Load_2=Load ImageViewerPanelLoadAction.Load_image_from_file_3=Load image from file ImageViewerPanelLoadAction.Choose_filename_to_load_5=Choose filename to load ImageViewerPanelLoadAction.Error_during_image_loading_7=An error occurred during image loading\! ImageViewerPanelLoadAction.Error_8=Error --- NEW FILE: ImageSpiFileFilters_it.properties --- #Italian string resource bundle for ImageReaderSpiFileFilter and ImageWriterSpiFileFilter ImageSpiFileFilter.image_files=File immagine {0} --- NEW FILE: ImageViewerPanelActions_it.properties --- (This appears to be a binary file; contents omitted.) |