wt.clients.util
Class IconCache

java.lang.Object
  extended bywt.clients.util.IconCache
All Implemented Interfaces:
Externalizable, IconCacheIF, Serializable

public class IconCache
extends Object
implements IconCacheIF, Externalizable



Supported API: true

Extendable: true

See Also:
Serialized Form

Field Summary
private  Image CHECK_OUT_GLYPH
           
private  String CHECK_OUT_GLYPH_LOC
           
private  Image CHECKED_OUT_FROM_PDM_GLYPH
           
private  String CHECKED_OUT_FROM_PDM_GLYPH_LOC
           
private static String CLASSNAME
           
private static boolean DEBUG
           
private  IconDelegateFactory delegateFactory
           
static long EXTERNALIZATION_VERSION_UID
           
private  Hashtable hrefTable
           
private  Hashtable iconTable
           
private  Image MASTER_GLYPH
           
private  String MASTER_GLYPH_LOC
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  Image SHARED_FROM_GLYPH
           
private  String SHARED_FROM_GLYPH_LOC
           
private  Image SHARED_TO_GLYPH
           
private  String SHARED_TO_GLYPH_LOC
           
private  Image SHORTCUT_GLYPH
           
private  String SHORTCUT_GLYPH_LOC
           
private  Panel temp
           
private  URLFactory url_factory
           
private  Image WORKING_GLYPH
           
private  String WORKING_GLYPH_LOC
           
 
Constructor Summary
IconCache()
          

Supported API: false
IconCache(WTContext aContext)
          Deprecated. in R4 - use no-arg constructor
 
Method Summary
protected  Image _addGlyphs(Image mainIcon, IconSelector selector)
          

Supported API: false
protected  ArrayList _getGlyphsHREF(String glyph_type)
          

Supported API: false
protected  Image _getIcon(IconDelegate delegate, IconSelector selector)
          

Supported API: false
private  Image _getIcon(IconDelegate delegate, IconSelector selector, String sharedFrom, String sharedTo, WTContainer containerContext)
          

Supported API: false
protected  ArrayList _getIconHREF(IconDelegate delegate, IconSelector selector, String glyph_type)
          Calls getIconSlector, then calls getIcon with the resolved resource key.
protected  Object[] _getIconSelector(IconDelegate delegate, IconSelector selector)
          Finds the IconSelector needed if the current selector is not a resource key.
 Image getOpenIcon(Class windchillClass)
          Method getStandardIcon returns an icon for a Windchill business class

Supported API: false
 Image getOpenIcon(WTObject busObj)
          Method getStandardIcon returns an icon for a Windchill business object with the appropriate glyphs added as overlays.
 String[] getOpenIconHREF(Class windchillClass, URLFactory urlfactory, String glyph_type)
          Method getStandardIconHREF returns an String[0] HREF to the icon for a Windchill business object.
 Image getStandardIcon(Class windchillClass)
          Method getStandardIcon returns an icon for a Windchill business class

Supported API: false
 Image getStandardIcon(IconSelector iconselector)
          Method getStandardIcon returns an icon for a Windchill business class

Supported API: false
 Image getStandardIcon(WTObject busObj)
          Method getStandardIcon returns an icon for a Windchill business object with the appropriate glyphs added as overlays.
 Image getStandardIcon(WTObject busObj, String sharedFrom, String sharedTo, WTContainer contextContainer)
          Returns an Image of the icon with the appropriate glyphs (adornments) for an object.
 String[] getStandardIconHREF(Class windchillClass, URLFactory urlfactory, String glyph_type)
          Method getStandardIconHREF returns an String[0] HREF to the icon for a Windchill business object.
 String[] getStandardIconHREF(WTObject a_business_object, URLFactory urlfactory, String glyph_type)
          Method getStandardIconHREF returns an String[0] HREF to the icon for a Windchill business object.
 Image mergeImages(Image main_image, Image glyph_image)
          Method mergeImages creates a single image by overlaying a given transparent glyph adornment on top of a main image.
 Image mergeImages(Image main_image, Vector glyphs)
          Method mergeImages creates a single image by overlaying the given transparent glyph adornments on top of a main image.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(IconCache thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

url_factory

private URLFactory url_factory

iconTable

private Hashtable iconTable

hrefTable

private Hashtable hrefTable

WORKING_GLYPH_LOC

private String WORKING_GLYPH_LOC

CHECK_OUT_GLYPH_LOC

private String CHECK_OUT_GLYPH_LOC

SHORTCUT_GLYPH_LOC

private String SHORTCUT_GLYPH_LOC

MASTER_GLYPH_LOC

private String MASTER_GLYPH_LOC

SHARED_TO_GLYPH_LOC

private String SHARED_TO_GLYPH_LOC

SHARED_FROM_GLYPH_LOC

private String SHARED_FROM_GLYPH_LOC

CHECKED_OUT_FROM_PDM_GLYPH_LOC

private String CHECKED_OUT_FROM_PDM_GLYPH_LOC

WORKING_GLYPH

private Image WORKING_GLYPH

CHECK_OUT_GLYPH

private Image CHECK_OUT_GLYPH

SHORTCUT_GLYPH

private Image SHORTCUT_GLYPH

MASTER_GLYPH

private Image MASTER_GLYPH

SHARED_TO_GLYPH

private Image SHARED_TO_GLYPH

SHARED_FROM_GLYPH

private Image SHARED_FROM_GLYPH

CHECKED_OUT_FROM_PDM_GLYPH

private Image CHECKED_OUT_FROM_PDM_GLYPH

delegateFactory

private IconDelegateFactory delegateFactory

temp

private Panel temp

DEBUG

private static boolean DEBUG
Constructor Detail

IconCache

public IconCache()
          throws WTException,
                 IOException,
                 InterruptedException


Supported API: false

Throws:
WTException
IOException
InterruptedException

IconCache

public IconCache(WTContext aContext)
          throws WTException,
                 IOException,
                 InterruptedException
Deprecated. in R4 - use no-arg constructor

Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(IconCache thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getStandardIconHREF

public String[] getStandardIconHREF(Class windchillClass,
                                    URLFactory urlfactory,
                                    String glyph_type)
                             throws WTException,
                                    IllegalAccessException,
                                    InvocationTargetException,
                                    InterruptedException,
                                    PropertyVetoException
Method getStandardIconHREF returns an String[0] HREF to the icon for a Windchill business object. If a glyph is required, it's href is String[1].

Supported API: false

Specified by:
getStandardIconHREF in interface IconCacheIF
Parameters:
windchillClass - The Class to look up the icon for.
urlfactory -
glyph_type - Identifier for the type of glyph to superimpose over the Image. Such as RevisionControlledIconDelegate.CHECKED_OUT. If this value is null, there is no glyph to superimpose over the Image.
Returns:
String[]
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

getOpenIconHREF

public String[] getOpenIconHREF(Class windchillClass,
                                URLFactory urlfactory,
                                String glyph_type)
                         throws WTException,
                                IllegalAccessException,
                                InvocationTargetException,
                                InterruptedException,
                                PropertyVetoException
Method getStandardIconHREF returns an String[0] HREF to the icon for a Windchill business object. If a glyph is required, it's href is String[1].

Supported API: false

Specified by:
getOpenIconHREF in interface IconCacheIF
Parameters:
windchillClass - The Class to look up the icon for.
urlfactory -
glyph_type - Identifier for the type of glyph to superimpose over the Image. Such as RevisionControlledIconDelegate.CHECKED_OUT. If this value is null, there is no glyph to superimpose over the Image.
Returns:
String[]
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

getStandardIcon

public Image getStandardIcon(WTObject busObj)
                      throws WTException,
                             IllegalAccessException,
                             InvocationTargetException,
                             InterruptedException,
                             PropertyVetoException
Method getStandardIcon returns an icon for a Windchill business object with the appropriate glyphs added as overlays.

Supported API: false

Specified by:
getStandardIcon in interface IconCacheIF
Parameters:
busObj - The WTObject that the icon will be returned for placing the appropriate glyphs on top of the main image for the class.
Returns:
Image
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

getOpenIcon

public Image getOpenIcon(WTObject busObj)
                  throws WTException,
                         IllegalAccessException,
                         InvocationTargetException,
                         InterruptedException,
                         PropertyVetoException
Method getStandardIcon returns an icon for a Windchill business object with the appropriate glyphs added as overlays.

Supported API: false

Specified by:
getOpenIcon in interface IconCacheIF
Parameters:
busObj - The WTObject that the icon will be returned for placing the appropriate glyphs on top of the main image for the class.
Returns:
Image
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

getStandardIcon

public Image getStandardIcon(Class windchillClass)
                      throws WTException,
                             IllegalAccessException,
                             InvocationTargetException,
                             InterruptedException,
                             PropertyVetoException
Method getStandardIcon returns an icon for a Windchill business class

Supported API: false

Specified by:
getStandardIcon in interface IconCacheIF
Parameters:
windchillClass - The Class to look up the icon for
Returns:
Image
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

getOpenIcon

public Image getOpenIcon(Class windchillClass)
                  throws WTException,
                         IllegalAccessException,
                         InvocationTargetException,
                         InterruptedException,
                         PropertyVetoException
Method getStandardIcon returns an icon for a Windchill business class

Supported API: false

Specified by:
getOpenIcon in interface IconCacheIF
Parameters:
windchillClass - The Class to look up the icon for
Returns:
Image
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

getStandardIcon

public Image getStandardIcon(IconSelector iconselector)
                      throws WTException,
                             IllegalAccessException,
                             InvocationTargetException,
                             InterruptedException,
                             PropertyVetoException
Method getStandardIcon returns an icon for a Windchill business class

Supported API: false

Specified by:
getStandardIcon in interface IconCacheIF
Parameters:
iconselector - The IconSelector is used in to look up the icon, this is part of the Icon Delegation throughout Windchill.
Returns:
Image
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

_getIconHREF

protected ArrayList _getIconHREF(IconDelegate delegate,
                                 IconSelector selector,
                                 String glyph_type)
                          throws WTException,
                                 IllegalAccessException,
                                 InvocationTargetException,
                                 InterruptedException,
                                 PropertyVetoException
Calls getIconSlector, then calls getIcon with the resolved resource key.

Supported API: false

Parameters:
delegate -
selector -
glyph_type - Identifier for the type of glyph to superimpose over the Image. Such as RevisionControlledIconDelegate.CHECKED_OUT. If this value is null, there is no glyph to superimpose over the Image.
Returns:
ArrayList
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

_getIconSelector

protected Object[] _getIconSelector(IconDelegate delegate,
                                    IconSelector selector)
                             throws WTException,
                                    IllegalAccessException,
                                    InvocationTargetException
Finds the IconSelector needed if the current selector is not a resource key. If it cannot find the resource key, it attempts to resolve the Selector. Returns An Object[0] of the selector and [1] of iconKeyValues if there is more than one.

Supported API: false

Parameters:
delegate -
selector -
Returns:
Object[]
Throws:
WTException
IllegalAccessException
InvocationTargetException

_getIcon

protected Image _getIcon(IconDelegate delegate,
                         IconSelector selector)
                  throws WTException,
                         IllegalAccessException,
                         InvocationTargetException,
                         InterruptedException,
                         PropertyVetoException


Supported API: false

Parameters:
delegate -
selector -
Returns:
Image
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

_getGlyphsHREF

protected ArrayList _getGlyphsHREF(String glyph_type)


Supported API: false

Parameters:
glyph_type - Identifier for the type of glyph to superimpose over the Image. Such as RevisionControlledIconDelegate.CHECKED_OUT. If this value is null, there is no glyph to superimpose over the Image.
Returns:
ArrayList

_addGlyphs

protected Image _addGlyphs(Image mainIcon,
                           IconSelector selector)
                    throws InterruptedException


Supported API: false

Parameters:
mainIcon -
selector -
Returns:
Image
Throws:
InterruptedException

mergeImages

public Image mergeImages(Image main_image,
                         Image glyph_image)
                  throws InterruptedException
Method mergeImages creates a single image by overlaying a given transparent glyph adornment on top of a main image. This method assumes that the first Image parameter is the main image and the second Image parameter is the glyph adornment. This method verifies that the images are loaded before attempting to create the new image.

Specified by:
mergeImages in interface IconCacheIF
Parameters:
main_image - the main Image onto which a glyph is placed.
glyph_image - The glyph Image which is placed on top of the main image.
Returns:
Image
Throws:
InterruptedException

mergeImages

public Image mergeImages(Image main_image,
                         Vector glyphs)
                  throws InterruptedException
Method mergeImages creates a single image by overlaying the given transparent glyph adornments on top of a main image. This method assumes that the first Image parameter is the main image and the second parameter is a Vector of Images which are all glyphs to be used in adorning the main image. This method verifies that the images are loaded before attempting to create the new image.

Specified by:
mergeImages in interface IconCacheIF
Parameters:
main_image - the main Image onto which a glyph is placed.
glyphs - The glyph Image which is placed on top of the main image.
Returns:
Image
Throws:
InterruptedException

getStandardIconHREF

public String[] getStandardIconHREF(WTObject a_business_object,
                                    URLFactory urlfactory,
                                    String glyph_type)
                             throws WTException,
                                    IllegalAccessException,
                                    InvocationTargetException,
                                    InterruptedException,
                                    PropertyVetoException
Method getStandardIconHREF returns an String[0] HREF to the icon for a Windchill business object. If a glyph is required, it's href is String[1].

Supported API: false

Parameters:
a_business_object - The business object to look up the icon for.
urlfactory -
glyph_type - Identifier for the type of glyph to superimpose over the Image. Such as RevisionControlledIconDelegate.CHECKED_OUT. If this value is null, there is no glyph to superimpose over the Image.
Returns:
String[]
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

getStandardIcon

public Image getStandardIcon(WTObject busObj,
                             String sharedFrom,
                             String sharedTo,
                             WTContainer contextContainer)
                      throws WTException,
                             IllegalAccessException,
                             InvocationTargetException,
                             InterruptedException,
                             PropertyVetoException
Returns an Image of the icon with the appropriate glyphs (adornments) for an object. This version is sandbox-aware and will return sandbox sharing glyphs if the input parameters so direct.

Parameters:
sharedFrom - The following values are recognized:
  • IconDelegate.DISPLAY_SHARED_FROM_GLYPH - display a glyph on the icon indicating the object has been shared into the current container from another container
  • IconDelegate.NO_SHARED_FROM_GLYPH - don't display a glyph indicating the object has been shared into the container from another container
  • IconDelegate.COMPUTE_SHARED_FROM_GLYPH - using the value of the currentContainerContext, determine if the object has been shared into the current container from another container and display the shared-from glyph if it has. This computation requires a database query.
sharedTo - The following values are recognized:
  • IconDelegate.DISPLAY_SHARED_TO_GLYPH - display a glyph on the icon indicating the object has been shared to another container by its owning container
  • IconDelegate.NO_SHARED_TO_GLYPH - don't display a glyph indicating the object has been shared to another container
  • IconDelegate.COMPUTE_SHARED_TO_GLYPH - if obj is a SubFolder and the currentContainerContext is the objects's owning container determine if the object has been shared to another container and display the shared-to glyph if it has. This computation requires a database query.
contextContainer - Current container. May be null unless sharedFrom is COMPUTE_SHARED_FROM_GLYPH or sharedTo is COMPUTE_SHARED_TO_GLYPH.
Returns:
Image
Throws:
WTException - Description of the Exception
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException

_getIcon

private Image _getIcon(IconDelegate delegate,
                       IconSelector selector,
                       String sharedFrom,
                       String sharedTo,
                       WTContainer containerContext)
                throws WTException,
                       IllegalAccessException,
                       InvocationTargetException,
                       InterruptedException,
                       PropertyVetoException


Supported API: false

Parameters:
delegate -
selector -
sharedFrom -
sharedTo -
containerContext -
Returns:
Image
Throws:
WTException
IllegalAccessException
InvocationTargetException
InterruptedException
PropertyVetoException