net.sf.freecol.client.gui.panel
Class ColopediaTreeItem

java.lang.Object
  extended by net.sf.freecol.client.gui.panel.ColopediaTreeItem

 class ColopediaTreeItem
extends java.lang.Object

TreeCellItems are used to represent the name and icon of a node in the Colopedia's tree.


Field Summary
private  javax.swing.ImageIcon icon
           
private  FreeColGameObjectType objectType
           
private  ColopediaPanel.PanelType panelType
           
private  java.lang.String text
           
 
Constructor Summary
ColopediaTreeItem(ColopediaPanel.PanelType panelType)
          The constructor that will add the items to this panel.
ColopediaTreeItem(ColopediaPanel.PanelType panelType, java.lang.String text)
          The constructor that will add the items to this panel.
ColopediaTreeItem(FreeColGameObjectType objectType, java.lang.String text, javax.swing.ImageIcon icon)
          The constructor that will add the items to this panel.
 
Method Summary
 FreeColGameObjectType getFreeColGameObjectType()
          Returns the type this item represents.
 javax.swing.ImageIcon getIcon()
          Returns the item's icon.
 ColopediaPanel.PanelType getPanelType()
          Returns the panel type this item belongs to.
 java.lang.String toString()
          Returns the item's name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

panelType

private ColopediaPanel.PanelType panelType

objectType

private FreeColGameObjectType objectType

text

private java.lang.String text

icon

private javax.swing.ImageIcon icon
Constructor Detail

ColopediaTreeItem

ColopediaTreeItem(ColopediaPanel.PanelType panelType)
The constructor that will add the items to this panel.

Parameters:
panelType - The panel type.

ColopediaTreeItem

ColopediaTreeItem(ColopediaPanel.PanelType panelType,
                  java.lang.String text)
The constructor that will add the items to this panel.

Parameters:
panelType - The panel type.
text - The name of the item.

ColopediaTreeItem

ColopediaTreeItem(FreeColGameObjectType objectType,
                  java.lang.String text,
                  javax.swing.ImageIcon icon)
The constructor that will add the items to this panel.

Parameters:
objectType - The type represented by this item.
text - The name of the item.
icon - The icon of the item.
Method Detail

getFreeColGameObjectType

public FreeColGameObjectType getFreeColGameObjectType()
Returns the type this item represents.

Returns:
the type this item represents.

getPanelType

public ColopediaPanel.PanelType getPanelType()
Returns the panel type this item belongs to.

Returns:
the panel type this item belongs to.

toString

public java.lang.String toString()
Returns the item's name.

Overrides:
toString in class java.lang.Object
Returns:
The item's name

getIcon

public javax.swing.ImageIcon getIcon()
Returns the item's icon.

Returns:
the item's icon.