org.openbp.common.rc.image
Class AbstractJavaImage

java.lang.Object
  extended by org.openbp.common.rc.ResourceItem
      extended by org.openbp.common.rc.image.AbstractJavaImage
Direct Known Subclasses:
TBmp, TGif, TJpeg, TPng

public abstract class AbstractJavaImage
extends ResourceItem

Abstract image resource item implementation for the ImageIcon object.

Author:
Andreas Putz

Field Summary
protected static java.lang.String TAG_IMAGE_PATH
          XML tag 'path'
 
Fields inherited from class org.openbp.common.rc.ResourceItem
ATTRIBUTE_PROPERTY_NAME, ATTRIBUTE_PROPERTY_TYPE, GROUP_DELIMITER, name, resourceCollection, resourceObject
 
Constructor Summary
AbstractJavaImage()
           
 
Method Summary
protected  boolean checkFileExtension(java.lang.String extension)
          Checks the validation of the file extension.
protected abstract  java.lang.String[] getFileExtensions()
          Gets the file extensions.
 void initializeFromDOM(ResourceCollection res, org.w3c.dom.Element sourceElement, java.lang.String group)
          Determines the information from the DOM element and set this to the resource item.
protected  java.lang.Object loadResourceObject()
          Loads the object associated with the resource.
 
Methods inherited from class org.openbp.common.rc.ResourceItem
getErrorName, getName, getObject, getResourceCollection, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAG_IMAGE_PATH

protected static final java.lang.String TAG_IMAGE_PATH
XML tag 'path'

See Also:
Constant Field Values
Constructor Detail

AbstractJavaImage

public AbstractJavaImage()
Method Detail

initializeFromDOM

public void initializeFromDOM(ResourceCollection res,
                              org.w3c.dom.Element sourceElement,
                              java.lang.String group)
Determines the information from the DOM element and set this to the resource item.

Overrides:
initializeFromDOM in class ResourceItem
Parameters:
res - Resource the item belongs to
sourceElement - Resource item node
group - Name of the resource item group or null

loadResourceObject

protected java.lang.Object loadResourceObject()
Loads the object associated with the resource. Loads the image from the image path specified in the resource XML file.

Overrides:
loadResourceObject in class ResourceItem
Returns:
The image or null on error

checkFileExtension

protected boolean checkFileExtension(java.lang.String extension)
Checks the validation of the file extension.

Parameters:
extension - File extension f.e. 'gif'
Returns:
true Is valid
false Is invalid

getFileExtensions

protected abstract java.lang.String[] getFileExtensions()
Gets the file extensions.

Returns:
Array with the extensions


Copyright © 2011. All Rights Reserved.