# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/hmichel/projetos/netbeans/main/image # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: src/org/netbeans/modules/image/Bundle.properties --- src/org/netbeans/modules/image/Bundle.properties Base (BASE) +++ src/org/netbeans/modules/image/Bundle.properties Locally Modified (Based On LOCAL) @@ -48,6 +48,8 @@ # ImageDataObject.ImageNode HINT_Thumbnail=Shows thumbnail. PROP_Thumbnail=Thumbnail +HINT_Image_Size=Shows image size. +PROP_Image_Size=Image Size # Failure to load an image MSG_CouldNotLoad=Could not load the image Index: src/org/netbeans/modules/image/ImageDataObject.java --- src/org/netbeans/modules/image/ImageDataObject.java Base (BASE) +++ src/org/netbeans/modules/image/ImageDataObject.java Locally Modified (Based On LOCAL) @@ -43,6 +43,7 @@ package org.netbeans.modules.image; +import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.Rectangle; @@ -205,6 +206,7 @@ ss = Sheet.createPropertiesSet(); s.put(ss); } + ss.put(new ImageSizeProperty(getDataObject())); ss.put(new ThumbnailProperty(getDataObject())); return s; } @@ -303,6 +305,30 @@ } } // End of class ThumbnailPropertyEditor. } // End of class ThumbnailProperty. + + /** Property representing for image size property in the sheet. */ + private final class ImageSizeProperty extends PropertySupport.ReadOnly { + /** (Image) data object associated with. */ + private final DataObject obj; + + /** Constructs property. */ + public ImageSizeProperty(DataObject obj) { + super("imageSize", Dimension.class, // NOI18N + NbBundle.getMessage(ImageDataObject.class, "PROP_Image_Size"), // NOI18N + NbBundle.getMessage(ImageDataObject.class, "HINT_Image_Size")); // NOI18N + this.obj = obj; + } + + /** Gets value of property. Overrides superclass method. */ + public Object getValue() throws InvocationTargetException { + try { + final Icon icon = new ImageIcon(obj.getPrimaryFile().getURL()); + return new Dimension(icon.getIconWidth(), icon.getIconHeight()); + } catch (FileStateInvalidException fsie) { + throw new InvocationTargetException(fsie); + } + } + } // End of class ImageSizeProperty. } // End of class ImageNode. }