DESY ACOP Beans Home

com.cosylab.gui
Class ValueIconPair

java.lang.Object
  extended by com.cosylab.gui.ValueIconPair
All Implemented Interfaces:
java.lang.Comparable

public class ValueIconPair
extends java.lang.Object
implements java.lang.Comparable

ValueIconPair combines a long value with a specifi icon.

Author:
Jaka Bobnar, Cosylab

Constructor Summary
ValueIconPair(java.lang.Long value, java.io.File iconFile)
          Constructs a new ValueIconPair with the given value and the File describing the image icon.
ValueIconPair(long value, javax.swing.Icon icon)
          Constructs a new ValueIconPair with the given value and icon.
ValueIconPair(java.lang.Long value, javax.swing.Icon icon)
          Constructs a new ValueIconPair with the given value and icon.
ValueIconPair(java.lang.Long value, java.lang.String iconName)
          Constructs a new ValueIconPair with the given value and path to the icon in the classpath.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 javax.swing.Icon getIcon()
          Returns the icon.
 java.lang.String getIconName()
          Returns the icon name.
 java.lang.Long getValue()
          Returns the value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueIconPair

public ValueIconPair(long value,
                     javax.swing.Icon icon)
Constructs a new ValueIconPair with the given value and icon.

Parameters:
value -
icon -

ValueIconPair

public ValueIconPair(java.lang.Long value,
                     javax.swing.Icon icon)
Constructs a new ValueIconPair with the given value and icon. The icon name is in this case the icon.toString().

Parameters:
value -
icon -

ValueIconPair

public ValueIconPair(java.lang.Long value,
                     java.lang.String iconName)
Constructs a new ValueIconPair with the given value and path to the icon in the classpath.

Parameters:
value -
iconName -

ValueIconPair

public ValueIconPair(java.lang.Long value,
                     java.io.File iconFile)
Constructs a new ValueIconPair with the given value and the File describing the image icon. The file can point to any location on the disk as long as it is accessible. The file does not need to be in the classpath. The name of the file is the absolute path of the icon file.

Parameters:
value -
iconFile -
Method Detail

getIcon

public javax.swing.Icon getIcon()
Returns the icon.

Returns:

getValue

public java.lang.Long getValue()
Returns the value.

Returns:

getIconName

public java.lang.String getIconName()
Returns the icon name.

Returns:

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable


Copyright © 2010. All Rights Reserved.