public class Icon extends Object implements Validatable
Note that validation of icons is lax on purpose, a valid Icon
might still
return null
from getMimeType()
, getWidth()
,
getHeight()
, and getDepth()
. However, getUri()
will return
a valid URI for a valid Icon
.
Modifier | Constructor and Description |
---|---|
protected |
Icon(org.seamless.util.MimeType mimeType,
int width,
int height,
int depth,
URI uri,
byte[] data) |
|
Icon(String mimeType,
int width,
int height,
int depth,
File file)
Use this constructor if your local icon data can be resolved with a
File , the file's
name must be unique within the scope of a device. |
|
Icon(String mimeType,
int width,
int height,
int depth,
String uniqueName,
byte[] data)
Use this constructor if your local icon data is in a
byte[] . |
|
Icon(String mimeType,
int width,
int height,
int depth,
String uniqueName,
InputStream is)
Use this constructor if your local icon data is an
InputStream . |
|
Icon(String mimeType,
int width,
int height,
int depth,
String uniqueName,
String binHexEncoded)
Use this constructor if your local icon is binary data encoded with BinHex.
|
|
Icon(String mimeType,
int width,
int height,
int depth,
URI uri)
Used internally by Cling when
RemoteDevice is discovered, you shouldn't have to call this. |
|
Icon(String mimeType,
int width,
int height,
int depth,
URL url)
Use this constructor if your local icon data can be resolved on the classpath, for
example:
MyClass.class.getResource("/my/icon.png) |
Modifier and Type | Method and Description |
---|---|
Icon |
deepCopy() |
byte[] |
getData() |
int |
getDepth() |
Device |
getDevice() |
int |
getHeight() |
org.seamless.util.MimeType |
getMimeType() |
URI |
getUri() |
int |
getWidth() |
String |
toString() |
List<ValidationError> |
validate() |
public Icon(String mimeType, int width, int height, int depth, URI uri)
RemoteDevice
is discovered, you shouldn't have to call this.public Icon(String mimeType, int width, int height, int depth, URL url) throws IOException
MyClass.class.getResource("/my/icon.png)
url
- A URL of the icon data that can be read with new File(url.toURI())
.IOException
public Icon(String mimeType, int width, int height, int depth, File file) throws IOException
File
, the file's
name must be unique within the scope of a device.IOException
public Icon(String mimeType, int width, int height, int depth, String uniqueName, InputStream is) throws IOException
InputStream
.uniqueName
- Must be a valid URI path segment and unique within the scope of a device.IOException
public Icon(String mimeType, int width, int height, int depth, String uniqueName, byte[] data)
byte[]
.uniqueName
- Must be a valid URI path segment and unique within the scope of a device.public Icon(String mimeType, int width, int height, int depth, String uniqueName, String binHexEncoded)
uniqueName
- Must be a valid URI path segment and unique within the scope of a device.binHexEncoded
- The icon bytes encoded as BinHex.protected Icon(org.seamless.util.MimeType mimeType, int width, int height, int depth, URI uri, byte[] data)
public org.seamless.util.MimeType getMimeType()
public int getWidth()
public int getHeight()
public int getDepth()
public URI getUri()
public byte[] getData()
public Device getDevice()
public List<ValidationError> validate()
validate
in interface Validatable
List
if all rules validated properly, otherwise, the detected errors.public Icon deepCopy()
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.