This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 19794
Collapse All | Expand All

(-)src/org/netbeans/modules/image/Bundle.properties (+4 lines)
Lines 48-53 Link Here
48
# ImageDataObject.ImageNode
48
# ImageDataObject.ImageNode
49
HINT_Thumbnail=Shows thumbnail.
49
HINT_Thumbnail=Shows thumbnail.
50
PROP_Thumbnail=Thumbnail
50
PROP_Thumbnail=Thumbnail
51
HINT_Image_Width=Shows image width (pixels).
52
PROP_Image_Width=Width
53
HINT_Image_Height=Shows image height (pixels).
54
PROP_Image_Height=Height
51
55
52
# Failure to load an image
56
# Failure to load an image
53
MSG_CouldNotLoad=Could not load the image
57
MSG_CouldNotLoad=Could not load the image
(-)src/org/netbeans/modules/image/ImageDataObject.java (+46 lines)
Lines 205-210 Link Here
205
                ss = Sheet.createPropertiesSet();
205
                ss = Sheet.createPropertiesSet();
206
                s.put(ss);
206
                s.put(ss);
207
            }
207
            }
208
            ss.put(new ImageWidthProperty());
209
            ss.put(new ImageHeightProperty());
208
            ss.put(new ThumbnailProperty(getDataObject()));
210
            ss.put(new ThumbnailProperty(getDataObject()));
209
            return s;
211
            return s;
210
        }
212
        }
Lines 303-308 Link Here
303
                }
305
                }
304
            } // End of class ThumbnailPropertyEditor.
306
            } // End of class ThumbnailPropertyEditor.
305
        } // End of class ThumbnailProperty.
307
        } // End of class ThumbnailProperty.
308
309
       /** Property representing for image width property in the sheet. */
310
       private final class ImageWidthProperty extends PropertySupport.ReadOnly {
311
          /** Constructs property. */
312
          public ImageWidthProperty() {
313
             super("width", Integer.class, // NOI18N
314
                   NbBundle.getMessage(ImageDataObject.class, "PROP_Image_Width"), // NOI18N
315
                   NbBundle.getMessage(ImageDataObject.class, "HINT_Image_Width")); // NOI18N
316
          }
317
318
          /** Gets value of property. Overrides superclass method. */
319
          public Object getValue() throws InvocationTargetException {
320
             try {
321
                final Icon icon = new ImageIcon(getDataObject().getPrimaryFile().
322
                      getURL());
323
                return Integer.valueOf(icon.getIconWidth());
324
             } catch (FileStateInvalidException fsie) {
325
                throw new InvocationTargetException(fsie);
326
             }
327
          }
328
       } // End of class ImageWidthProperty.
329
330
       /** Property representing for image height property in the sheet. */
331
       private final class ImageHeightProperty extends PropertySupport.ReadOnly {
332
          /** Constructs property. */
333
          public ImageHeightProperty() {
334
             super("height", Integer.class, // NOI18N
335
                   NbBundle.getMessage(ImageDataObject.class,
336
                   "PROP_Image_Height"), // NOI18N
337
                   NbBundle.getMessage(ImageDataObject.class,
338
                   "HINT_Image_Height")); // NOI18N
339
          }
340
341
          /** Gets value of property. Overrides superclass method. */
342
          public Object getValue() throws InvocationTargetException {
343
             try {
344
                final Icon icon = new ImageIcon(getDataObject().getPrimaryFile().
345
                      getURL());
346
                return Integer.valueOf(icon.getIconHeight());
347
             } catch (FileStateInvalidException fsie) {
348
                throw new InvocationTargetException(fsie);
349
             }
350
          }
351
       } // End of class ImageHeightProperty.
306
    } // End of class ImageNode.
352
    } // End of class ImageNode.
307
353
308
}
354
}

Return to bug 19794