# 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,10 @@ # ImageDataObject.ImageNode HINT_Thumbnail=Shows thumbnail. PROP_Thumbnail=Thumbnail +HINT_Image_Width=Shows image width (pixels). +PROP_Image_Width=Width +HINT_Image_Height=Shows image height (pixels). +PROP_Image_Height=Height # 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) @@ -205,6 +205,8 @@ ss = Sheet.createPropertiesSet(); s.put(ss); } + ss.put(new ImageWidthProperty()); + ss.put(new ImageHeightProperty()); ss.put(new ThumbnailProperty(getDataObject())); return s; } @@ -303,6 +305,50 @@ } } // End of class ThumbnailPropertyEditor. } // End of class ThumbnailProperty. + + /** Property representing for image width property in the sheet. */ + private final class ImageWidthProperty extends PropertySupport.ReadOnly { + /** Constructs property. */ + public ImageWidthProperty() { + super("width", Integer.class, // NOI18N + NbBundle.getMessage(ImageDataObject.class, "PROP_Image_Width"), // NOI18N + NbBundle.getMessage(ImageDataObject.class, "HINT_Image_Width")); // NOI18N + } + + /** Gets value of property. Overrides superclass method. */ + public Object getValue() throws InvocationTargetException { + try { + final Icon icon = new ImageIcon(getDataObject().getPrimaryFile(). + getURL()); + return Integer.valueOf(icon.getIconWidth()); + } catch (FileStateInvalidException fsie) { + throw new InvocationTargetException(fsie); + } + } + } // End of class ImageWidthProperty. + + /** Property representing for image height property in the sheet. */ + private final class ImageHeightProperty extends PropertySupport.ReadOnly { + /** Constructs property. */ + public ImageHeightProperty() { + super("height", Integer.class, // NOI18N + NbBundle.getMessage(ImageDataObject.class, + "PROP_Image_Height"), // NOI18N + NbBundle.getMessage(ImageDataObject.class, + "HINT_Image_Height")); // NOI18N + } + + /** Gets value of property. Overrides superclass method. */ + public Object getValue() throws InvocationTargetException { + try { + final Icon icon = new ImageIcon(getDataObject().getPrimaryFile(). + getURL()); + return Integer.valueOf(icon.getIconHeight()); + } catch (FileStateInvalidException fsie) { + throw new InvocationTargetException(fsie); + } + } + } // End of class ImageHeightProperty. } // End of class ImageNode. }