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 |
} |