Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

com::cosylab::gui::components::r2::JMultiIconLabel Class Reference

List of all members.

Public Member Functions

 JMultiIconLabel ()
 JMultiIconLabel (String[] resourceNames)
 JMultiIconLabel (String[] resourceNames, int horizontalAlignement)
 JMultiIconLabel (javax.swing.Icon[] icons)
 JMultiIconLabel (javax.swing.Icon[] icons, int horizontalAlignment)
void addIcon (String resourceName)
void addIcon (javax.swing.Icon icon)
void addIcons (String[] resourceNames)
void addIcons (Icon[] icons)
Icon getIconByIndex (int index)
void setIconByIndex (int index)

Protected Member Functions

Icon loadFromResource (String resourceName)

Private Attributes

final java.util.Vector iconList = new java.util.Vector()

Detailed Description

This class extends javax.swing.JLabel so that it allows display of multiple icons. It maintains internal list of icons that associates integer values with Icon objects. This index is guaranteed to be valid even if the desired icon could not be found, is not valid or is null. In such cases the corresponding icon will not be displayed.

Icons can be provided by either the calling class via the javax.swing.Icon object or they can be loaded from the projects resource automatically. Two methods are provided to add the icons: addIcon, addIcons The later is preffered when adding multiple icons at the same time.
Use the setIconByIndex method to set which icon should be displayed.
The disabled state icon of the JLabel is not overriden and can be still specified.

Creation date: (12/24/2001 15:57:21)

Author:
: Ales Pucelj (ales.pucelj@kgb.ijs.si)


Constructor & Destructor Documentation

com::cosylab::gui::components::r2::JMultiIconLabel::JMultiIconLabel  )  [inline]
 

Default constructor for JMultiIconLabel.

com::cosylab::gui::components::r2::JMultiIconLabel::JMultiIconLabel String[]  resourceNames  )  [inline]
 

Constructs a JMultiIconLabel and loads the icons from the specified resource names.

Parameters:
text java.lang.String

com::cosylab::gui::components::r2::JMultiIconLabel::JMultiIconLabel String[]  resourceNames,
int  horizontalAlignement
[inline]
 

Constructs a JMultiIconLabel and loads the icons from the specified resource names. Also sets the horizontal alignement of the text.

Parameters:
text java.lang.String
horizontalAlignement int.

com::cosylab::gui::components::r2::JMultiIconLabel::JMultiIconLabel javax.swing.Icon[]  icons  )  [inline]
 

Constructs a JMultiIconLabel and adds the icons to the icon list.

Parameters:
image javax.swing.Icon

com::cosylab::gui::components::r2::JMultiIconLabel::JMultiIconLabel javax.swing.Icon[]  icons,
int  horizontalAlignment
[inline]
 

Constructs a JMultiIconLabel and adds the icons to the icon list. Also sets the horizontal alignement of the text.

Parameters:
image javax.swing.Icon
horizontalAlignment int


Member Function Documentation

void com::cosylab::gui::components::r2::JMultiIconLabel::addIcon javax.swing.Icon  icon  )  [inline]
 

Appends the icon to the list of icons.

Creation date: (12/24/2001 16:02:13)

Parameters:
icon javax.swing.Icon

void com::cosylab::gui::components::r2::JMultiIconLabel::addIcon String  resourceName  )  [inline]
 

Appends the icon specified by resourceName to the end of internal list of icons. This method calls addIcon(Icon) and loadFromResource(String). If resourceName does not exist in the projects resources, method adds empty icon.

Creation date: (12/24/2001 16:14:15)

Parameters:
resourceName java.lang.String

void com::cosylab::gui::components::r2::JMultiIconLabel::addIcons Icon[]  icons  )  [inline]
 

Appends all icons specified by icons parameter to the internal list of icons. For adding multiple icons, this method outperforms individual calls to addIcon method.

After calling this method, the list of icons will grow by the size of the array, regardless of its contentrs. If any of the icons is null or of invalid type, the associated icon will not be displayed.

Creation date: (12/24/2001 16:17:36)

Parameters:
icons javax.swing.Icon[]

void com::cosylab::gui::components::r2::JMultiIconLabel::addIcons String[]  resourceNames  )  [inline]
 

Appends all icons specified by resourceNames to the end of internal list of icons. For adding multiple icons, this method outperforms individual calls to addIcon method.

After calling this method, the list of icons will grow by the size of the array, regardless of its contentrs. If any of the icons is null or of invalid type, the associated icon will not be displayed.

Creation date: (12/24/2001 16:21:36)

Parameters:
resourceNames java.lang.String[]

Icon com::cosylab::gui::components::r2::JMultiIconLabel::getIconByIndex int  index  )  [inline]
 

Returns the Icon resource assigned to the specified index. If the icon has not been defined, returns null.

Creation date: (12/24/2001 16:10:44)

Returns:
javax.swing.Icon
Parameters:
index int

Icon com::cosylab::gui::components::r2::JMultiIconLabel::loadFromResource String  resourceName  )  [inline, protected]
 

Loads the Icon from the projects resource. Returns null if the resource does not exist.

Creation date: (12/24/2001 16:04:52)

Returns:
javax.swing.Icon
Parameters:
resourceName java.lang.String

void com::cosylab::gui::components::r2::JMultiIconLabel::setIconByIndex int  index  )  [inline]
 

Displays the icon specified by index. If the icon with this index has not been defined, no icon will be displayed.

Creation date: (12/24/2001 16:09:33)

Parameters:
index int


Member Data Documentation

final java.util.Vector com::cosylab::gui::components::r2::JMultiIconLabel::iconList = new java.util.Vector() [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:12:28 2009 for ACS Java API by doxygen 1.3.8