jet.controls
Class JetImgProperty

java.lang.Object
  extended by jet.controls.JetProperty
      extended by jet.controls.JetString
          extended by jet.controls.JetImgProperty
All Implemented Interfaces:
jet.controls.JetResourceable, jet.convert.ImgInfo, jet.convert.PropInfo, jet.convert.StringInfo, jet.util.ImagePropertiable, jet.util.Propertiable

public class JetImgProperty
extends JetString
implements jet.controls.JetResourceable, jet.util.ImagePropertiable, jet.convert.ImgInfo

JetImgProperty, for saving/retrieving an Image: loaded from file("Image(file name)" following) or Object directly("Image(Embed)"following).
Notice:
1) It doesn't have default value
2) It does used to saving/retrieving an Image(file name) by default
3) In JReport, Image(file name) is the resource based Catalog, so the file is based on Catalog's path.


Note to Developer:
If try to debug a JetImgProperty used to saving/retrieving an Image(Embed), must focus on the variable named "embedImage"
May be we need append 'synchronized' to get/set relative APIs


Field Summary
 
Fields inherited from class jet.controls.JetProperty
CHART_BACKGROUND_EDITOR, CHART_FILLPATTERN_EDITOR, CHART_FILTER_EDITOR, CHART_FILTER_EDITOR_NO_DATE, CHART_ICON_STYLE, CHART_PATTERN_LIST_EDITOR, CHART_PENSTYLE_EDITOR, CHART_TEXTSTYLE_EDITOR, CHOICE_EDITOR, COLOR_EDITOR, COMBO_EDITOR, COMMAND_EDITOR, CONTROL_SELECT_ITEMS, DATASOURCE_EDITOR, DBCOL_EDITOR, DETAIL_REPORT_EDITOR, EDIT_FORBIDDEN, EDIT_FORBIDDEN_INIT, EDITABLE_ALLTIME, INTERNAL, LINK_EDITOR, MULSEL_EDITOR, PARAMCOL_EDITOR, QUERY_EDITOR, RECORDDB_EDITOR, SECURITY_EDITOR, TEXT_EDITOR
 
Fields inherited from interface jet.util.Propertiable
BIGSTRING, BOOLEAN, CHG_FMTTINGBLNAME, CHG_FMTTINGFORMULA, CHG_OTHER, COLOR, COMPFML_RESOURCE, CUSTOMER, CUSTOMERLINK, DELIM, DELIMCHAR, DOUBLE, ENUMERATION, IGNORED, IMAGE, IMGVECTOR, MAPPINGTBL, NORMAL_RESOURCE, NUMBER, REFERENCE, STRING, SUB1_DELIM, UNIT, VAL_NORMALLENGTH, VAL_NORMALSTART, VECTOR
 
Constructor Summary
JetImgProperty()
           
JetImgProperty(jet.controls.JetObject parent, java.lang.String name)
          Create JetImgProperty instance
 
Method Summary
 void clearEmbed()
           
 jet.util.image.ImageResource getEmbedImageResource()
           
 byte[] getGifBytes()
          Deprecated.  
 javax.swing.ImageIcon getImageIcon(java.lang.String currentPath)
          Deprecated.  
 jet.util.image.ImageResource getImageResourceByID(java.lang.String resourceId)
           
 jet.util.image.ImageResource getImageResourceByPath(java.lang.String resourcePath)
           
 int getImageType()
          Deprecated. if "EMBED" return the image type of ImageResource, else return MediaType.UNKNOWN
 java.lang.String getInspValue()
          Effective if JetProperty.isCurrentAutoValue() is false.
 java.lang.String getLocalPath()
          Deprecated.  
 java.lang.Object getObject()
          Deprecated.  
 java.lang.String getPath()
          If path doesn't set, will return the report resource path,and try to set "catFullName" as catalog full file name
 java.lang.Object getResource()
          Deprecated.  
 java.lang.Object getResource(java.lang.String depPath)
          Deprecated.  
 int getResourceID()
          Deprecated.  
 java.lang.String getURL()
          Deprecated.  
 boolean isEmbed()
          Effective if JetProperty.isCurrentAutoValue() is false.
 void set(java.lang.String str)
          Sets value and call setURL(null)
 void setEmbedImage(jet.util.image.ImageResource ir)
          Changes to saving/retrieving an Image(Embed) or not.
Notice: must call #setEmbedImageType(int) before/after it.
 void setLocalPath(java.lang.String path)
          Deprecated.  
 void setObject(java.lang.Object value)
          Sets normal value
 void setResourceID(int id)
          Deprecated.  
 void setURL(java.lang.String url)
          Deprecated.  
 java.lang.String toString()
          Effective if JetProperty.isCurrentAutoValue() is false.
 
Methods inherited from class jet.controls.JetString
get, getMatchingSqlType, getPropertyChoice, set, setPropertyChoice
 
Methods inherited from class jet.controls.JetProperty
canChangeByBL, canChangeByFmtt, canChangeByOthers, enableAllChangeBys, getChangeBy, getChangeByBL, getChangeByBLName, getChangeByBLType, getChangeByFmtt, getChangeByFmttName, getChangeByObject, getChangeByObjectName, getChangeByOtherType, getCurrentValue, getCurrentValue, getEditFlag, getEditorType, getInspValue, getName, getNormalObject, getParent, getPropType, getRuntimeChangeBy, getUnifiedObject, getValue, isChagneByFmtt, isChangeByBL, isChangeByOther, isCurrentAutoValue, isEnableAutoValue, isNull, isSetAnyChangeBy, isSetRuntimeChgBy, isTransient, loadFullChangeBy, propertyChanged, saveFullChangeBy, setAsAutoValue, setCanChangeByBL, setCanChangeByFmtt, setCanChangeByOthers, setChangeByBL, setChangeByBL, setChangeByFmtt, setChangeByObject, setChangeByObject, setEditFlag, setEditorType, setEnableAutoValue, setRuntimeChangeBy, setTransient, setUnitValue, toUnitString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jet.util.ImagePropertiable
get
 
Methods inherited from interface jet.util.Propertiable
getChangeByBL, getChangeByBLType, getChangeByFmtt, getChangeByOtherType, getNormalObject, getPropType, getRuntimeChangeBy, getUnifiedObject, isChagneByFmtt, isChangeByBL, isChangeByOther, isCurrentAutoValue, isSetRuntimeChgBy, loadFullChangeBy, saveFullChangeBy, setAsAutoValue, setChangeByBL, setChangeByBL, setChangeByFmtt, setChangeByObject, setChangeByObject, setRuntimeChangeBy
 
Methods inherited from interface jet.convert.StringInfo
get
 
Methods inherited from interface jet.convert.PropInfo
getChangeByObjectName, getName, getValue, isChangeByOther, isNull, toUnitString
 

Constructor Detail

JetImgProperty

public JetImgProperty()

JetImgProperty

public JetImgProperty(jet.controls.JetObject parent,
                      java.lang.String name)
Create JetImgProperty instance

Parameters:
parent - owner
name - name
Method Detail

set

public void set(java.lang.String str)
Sets value and call setURL(null)

Specified by:
set in interface jet.util.Propertiable
Overrides:
set in class JetString
Parameters:
str - the String value, null means default value
See Also:
setValue(String)

setEmbedImage

public void setEmbedImage(jet.util.image.ImageResource ir)
Changes to saving/retrieving an Image(Embed) or not.
Notice: must call #setEmbedImageType(int) before/after it.

Parameters:
embedImage - if null change to saving/retrieving an Image(file name) else an Image(Embed)
imageType - the meidaType must one of MediaType.JPG,MediaType.PNG,MediaType.BITMAP,MediaType.GIF
See Also:
MediaType

clearEmbed

public void clearEmbed()

isEmbed

public boolean isEmbed()
Effective if JetProperty.isCurrentAutoValue() is false. Had this been set to saving/retrieving an Image(Embed)?

Specified by:
isEmbed in interface jet.util.ImagePropertiable
See Also:
JetProperty.isCurrentAutoValue()

getInspValue

public java.lang.String getInspValue()
Effective if JetProperty.isCurrentAutoValue() is false. ONLY For Designer UI
If this used to save/retrieve an Image(file name) return the file name
else return empty-string(Before V9.1) or the file name that called before #setEmbedImage(Image).

Specified by:
getInspValue in interface jet.convert.PropInfo
Overrides:
getInspValue in class JetProperty
See Also:
JetProperty.isCurrentAutoValue()

toString

public java.lang.String toString()
Effective if JetProperty.isCurrentAutoValue() is false. If this is set saving/retrieving Image(file name), return image file name directly. else return the String constructed by the byte array encoded by Base64 on the byte array encoded from Image(Embed) with imageType

Specified by:
toString in interface jet.convert.PropInfo
Overrides:
toString in class JetString
Returns:
the value of this string.
See Also:
setValue(String), #imageToByte(Image, int), #isImageEmbed(), JetProperty.isCurrentAutoValue()

setObject

public void setObject(java.lang.Object value)
Description copied from class: JetProperty
Sets normal value

Specified by:
setObject in interface jet.util.Propertiable
Overrides:
setObject in class JetProperty

getImageResourceByID

public jet.util.image.ImageResource getImageResourceByID(java.lang.String resourceId)
Specified by:
getImageResourceByID in interface jet.util.ImagePropertiable

getImageResourceByPath

public jet.util.image.ImageResource getImageResourceByPath(java.lang.String resourcePath)
Specified by:
getImageResourceByPath in interface jet.util.ImagePropertiable

getEmbedImageResource

public jet.util.image.ImageResource getEmbedImageResource()
Specified by:
getEmbedImageResource in interface jet.util.ImagePropertiable

getResourceID

public int getResourceID()
Deprecated. 

Specified by:
getResourceID in interface jet.controls.JetResourceable
Specified by:
getResourceID in interface jet.convert.ImgInfo
Returns:
the resource ID in the resource file.

setResourceID

public void setResourceID(int id)
Deprecated. 

Sets the resource ID in the resource file.

Specified by:
setResourceID in interface jet.controls.JetResourceable
Throws:
java.lang.UnsupportedOperationException

getLocalPath

public java.lang.String getLocalPath()
Deprecated. 

Specified by:
getLocalPath in interface jet.controls.JetResourceable
Specified by:
getLocalPath in interface jet.convert.ImgInfo
Returns:
the local path of the resource.
Throws:
java.lang.UnsupportedOperationException

setLocalPath

public void setLocalPath(java.lang.String path)
Deprecated. 

Sets the local path of the resource.

Specified by:
setLocalPath in interface jet.controls.JetResourceable
Throws:
java.lang.UnsupportedOperationException

getURL

public java.lang.String getURL()
Deprecated. 

Specified by:
getURL in interface jet.controls.JetResourceable
Specified by:
getURL in interface jet.convert.ImgInfo
Returns:
the URL string of the resource.
Throws:
java.lang.UnsupportedOperationException

setURL

public void setURL(java.lang.String url)
Deprecated. 

Implemented API in JetResourceable
Sets the URL string of the resource.

Specified by:
setURL in interface jet.controls.JetResourceable
Throws:
java.lang.UnsupportedOperationException

getPath

public java.lang.String getPath()
If path doesn't set, will return the report resource path,and try to set "catFullName" as catalog full file name

Specified by:
getPath in interface jet.convert.ImgInfo
Returns:
the path
Throws:
java.lang.UnsupportedOperationException

getResource

public java.lang.Object getResource(java.lang.String depPath)
Deprecated. 

if "EMBED" return ImageResource(EMBED), else return null

Specified by:
getResource in interface jet.convert.ImgInfo
Parameters:
depPath - the based path
Returns:
null if Image(file name) can be loaded.
Throws:
java.lang.UnsupportedOperationException

getResource

public java.lang.Object getResource()
Deprecated. 

if "EMBED" return ImageResource(EMBED), else return null

Specified by:
getResource in interface jet.controls.JetResourceable
Specified by:
getResource in interface jet.convert.ImgInfo
See Also:
getObject(), getResource(String)

getGifBytes

public byte[] getGifBytes()
                   throws java.io.IOException
Deprecated. 

if "EMBED" return the byte array encode with gif and ImageResource(EMBED), else return null

Specified by:
getGifBytes in interface jet.convert.ImgInfo
Throws:
java.io.IOException
See Also:
ImageEncoder.renderImageToGif(Image)

getObject

public java.lang.Object getObject()
Deprecated. 

If "EMBED" return ImageResource(EMBED) else return "ImageName"

Specified by:
getObject in interface jet.convert.ImgInfo
Specified by:
getObject in interface jet.util.ImagePropertiable
Specified by:
getObject in interface jet.util.Propertiable
Overrides:
getObject in class JetProperty
See Also:
JetProperty.isChangeByOther(), JetProperty.isCurrentAutoValue()

getImageIcon

public javax.swing.ImageIcon getImageIcon(java.lang.String currentPath)
                                   throws java.io.IOException
Deprecated. 

if "EMBED" Try to create ImageIcon via ImageResource(EMBED) and return, else return null

Throws:
java.io.IOException

getImageType

public int getImageType()
Deprecated. if "EMBED" return the image type of ImageResource, else return MediaType.UNKNOWN

See Also:
MediaType, ImageResource.getImageType()