/** * Creates a draggable image label containing image with source from a given url, using dimensions * of original image * * @param parentObject the object that the label represents * @param url the source of the image * @return the draggable label created * @throws CannotLoadImage */ public DraggableLabel getImageComponent(PhotoSpreadObject parentObject, String url) throws CannotLoadImage { ImageIcon icon; _fileName = url; icon = createImageIcon(url); DraggableLabel imageLabel = new DraggableLabel(parentObject); if (icon != null) { imageLabel.setIcon(icon); } return imageLabel; }
/** * Creates a draggable image label containing image with source from a given url * * @param parentObject the object that the label represents * @param url the source of the image * @param height height of the image * @param width width of the image * @return the draggable label created * @throws CannotLoadImage */ public DraggableLabel getImageComponent( PhotoSpreadObject parentObject, String url, int height, int width) throws CannotLoadImage { ImageIcon icon; _fileName = url; icon = createImageIcon(url); DraggableLabel imageLabel = new DraggableLabel(parentObject, height, width); if (icon != null) { ImageIcon thumbnailIcon = new ImageIcon(Misc.getScaledImage(icon, height, width)); imageLabel.setIcon(thumbnailIcon); } return imageLabel; }