public static void set(JLabel comp, ImageData value) {
ActionMgr.addAction(new ImageValue(comp, value));
}
public static ImageData get(JLabel comp){
ImageData ret;
ImageValue action = ActionMgr.getAction(comp, ImageValue.class);
if (action != null) {
ret = action.getValue();
}
// If nobody has set the action, then create a new ImageData. CraigM: 9/5/07.
else {
// TF:27/03/2009:If we're using a PictureGraphic, then we need to return the mapped picture
if (comp instanceof PictureGraphic) {
ret = ((PictureGraphic)comp).getImageValue();
}
else if (comp.getIcon() instanceof ImageIcon) {
ret = new ImageData((ImageIcon)comp.getIcon());
}
else {
UnsupportedOperationException errorVar = new UnsupportedOperationException("Only JLabels with ImageIcons are supported at this stage.");
ErrorMgr.addError(errorVar);
throw errorVar;