pl.edu.agh.cast.resource
Interface IVisualResource

All Known Implementing Classes:
VisualResource

public interface IVisualResource

An interface representing single visual resource which contains of:

A single resource can have many images which differ in the following things:

Author:
AGH CAST Team

Field Summary
static char NAME_SEPARATOR
          A character used to separate parts of image name such as size, variant and right name.
 
Method Summary
 void dispose()
          Disposes the resource.
 String getDescription()
          Gets localized resource description.
 String getGroupId()
          Returns group id.
 String getId()
          Gets resource id.
 org.eclipse.swt.graphics.Image getImage()
          Gets default image associated with the resource.
 org.eclipse.swt.graphics.Image getImage(ImageSize size)
          Gets default image associated with this resource with specified size.
 org.eclipse.swt.graphics.Image getImage(String variant)
          Gets a given variant of image in default size (see getImage() method java doc for more details about how default size is chosen).
 org.eclipse.swt.graphics.Image getImage(String variant, ImageSize size)
          Gets a given variant of image in specified size.
 String getLabel()
          Gets localized resource label.
 List<String> getTags()
          Returns tags associated with the resource.
 Type getType()
          Returns type of element represented by the resource.
 

Field Detail

NAME_SEPARATOR

static final char NAME_SEPARATOR
A character used to separate parts of image name such as size, variant and right name.

See Also:
Constant Field Values
Method Detail

getId

String getId()
Gets resource id. For resources representing type such as phone number, entity, etc the id should be equal to Type.toString(). In other cases the id should be unique string in Java package style.

Returns:
resource id

getTags

List<String> getTags()
Returns tags associated with the resource.

Returns:
list of tags

getGroupId

String getGroupId()
Returns group id.

Returns:
group id or null if the resource has no group.

getType

Type getType()
Returns type of element represented by the resource.

Returns:
element or data set type or null if the resource is not associated with any element

getLabel

String getLabel()
Gets localized resource label.

Returns:
resource label

getDescription

String getDescription()
Gets localized resource description.

Returns:
resource description

getImage

org.eclipse.swt.graphics.Image getImage()
Gets default image associated with the resource. If the default image has only one size registered this version is returned, otherwise the default size (according to ImageSize.getDefaultSize() is searched and returned, if not found null is returned

Returns:
default image, null if image not exists

getImage

org.eclipse.swt.graphics.Image getImage(ImageSize size)
Gets default image associated with this resource with specified size.

Parameters:
size - image size
Returns:
image with specified size, null if image not exists

getImage

org.eclipse.swt.graphics.Image getImage(String variant)
Gets a given variant of image in default size (see getImage() method java doc for more details about how default size is chosen).

Parameters:
variant - image variant
Returns:
a specified variant of the resource image, null if variant of image not exists

getImage

org.eclipse.swt.graphics.Image getImage(String variant,
                                        ImageSize size)
Gets a given variant of image in specified size.

Parameters:
variant - image variant
size - image size
Returns:
a specified variant of the resource image, null if image not exists

dispose

void dispose()
Disposes the resource. It disposes all hold images.



Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.