@Override public String toString() { return "Icon(" + getWidth() + "x" + getHeight() + ", MIME: " + getMimeType() + ") " + getUri(); } }
protected Icon findUsableIcon(Device device) { // Needs to be certain format and size for (Object o : device.getIcons()) { Icon icon = (Icon) o; if (icon.getWidth() <= 64 && icon.getHeight() <= 64 && isUsableImageType(icon.getMimeType())) return icon; } return null; }
log.warning("Invalid icon, missing mime type: " + this); if (getWidth() == 0) { log.warning("UPnP specification violation of: " + getDevice()); log.warning("Invalid icon, missing width: " + this);
public Icon deepCopy() { return new Icon( getMimeType(), getWidth(), getHeight(), getDepth(), getUri(), getData() ); }
setText(uri + " (" + nodeIcon.getMimeType() + " " + nodeIcon.getWidth() + "x" + nodeIcon.getHeight() + ")");
protected void generateIconList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement) { if (!deviceModel.hasIcons()) return; Element iconListElement = appendNewElement(descriptor, deviceElement, ELEMENT.iconList); for (Icon icon : deviceModel.getIcons()) { Element iconElement = appendNewElement(descriptor, iconListElement, ELEMENT.icon); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.mimetype, icon.getMimeType()); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.width, icon.getWidth()); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.height, icon.getHeight()); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.depth, icon.getDepth()); if (deviceModel instanceof RemoteDevice) { appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url, icon.getUri()); } else if (deviceModel instanceof LocalDevice) { appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url, namespace.getIconPath(icon)); } } }
@Override public String toString() { return "Icon(" + getWidth() + "x" + getHeight() + ", MIME: " + getMimeType() + ") " + getUri(); } }
log.warning("Invalid icon, missing mime type: " + this); if (getWidth() == 0) { log.warning("UPnP specification violation of: " + getDevice()); log.warning("Invalid icon, missing width: " + this);
public Icon deepCopy() { return new Icon( getMimeType(), getWidth(), getHeight(), getDepth(), getUri(), getData() ); }
protected void generateIconList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement) { if (!deviceModel.hasIcons()) return; Element iconListElement = appendNewElement(descriptor, deviceElement, ELEMENT.iconList); for (Icon icon : deviceModel.getIcons()) { Element iconElement = appendNewElement(descriptor, iconListElement, ELEMENT.icon); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.mimetype, icon.getMimeType()); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.width, icon.getWidth()); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.height, icon.getHeight()); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.depth, icon.getDepth()); if (deviceModel instanceof RemoteDevice) { appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url, icon.getUri()); } else if (deviceModel instanceof LocalDevice) { appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url, namespace.getIconPath(icon)); } } }
@Override public String toString() { return "Icon(" + getWidth() + "x" + getHeight() + ", MIME: " + getMimeType() + ") " + getUri(); } }
log.warning("Invalid icon, missing mime type: " + this); if (getWidth() == 0) { log.warning("UPnP specification violation of: " + getDevice()); log.warning("Invalid icon, missing width: " + this);
public Icon deepCopy() { return new Icon( getMimeType(), getWidth(), getHeight(), getDepth(), getUri(), getData() ); }
protected void generateIconList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement) { if (!deviceModel.hasIcons()) return; Element iconListElement = appendNewElement(descriptor, deviceElement, ELEMENT.iconList); for (Icon icon : deviceModel.getIcons()) { Element iconElement = appendNewElement(descriptor, iconListElement, ELEMENT.icon); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.mimetype, icon.getMimeType()); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.width, icon.getWidth()); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.height, icon.getHeight()); appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.depth, icon.getDepth()); if (deviceModel instanceof RemoteDevice) { appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url, icon.getUri()); } else if (deviceModel instanceof LocalDevice) { appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url, namespace.getIconPath(icon)); } } }