|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--uk.org.iscream.cms.conient.datacomponents.VisibleDataComponent | +--uk.org.iscream.cms.conient.datacomponents.CPUDataComponent
This is DataComponent specifically for displaying CPU percentages. It uses the JProgressBar to display the value.
Field Summary | |
private String |
_attribute
The attribute that this component is concerned with |
protected String |
_cache
Remembers what the last value was, so we only update if we have to. |
private JProgressBar |
_item
The progress bar that we will display CPU percentage data in |
private JLabel |
_label
The friendly label for this component |
private int |
_max
The maximum value for the percentage |
private int |
_min
The minimum value for the percentage |
private String |
_name
The friendly name of this component |
String |
REVISION
The current CVS revision of this class |
Fields inherited from class javax.swing.JPanel |
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CPUDataComponent(String name,
String attribute)
Creates the component with a friendly name to be used as label |
Method Summary | |
String |
getPacketAttribute()
Returns the string showing the packet attribute that the component is looking after |
void |
run()
This run method updates any Swing components The setValue() method adds this component to the Swing Event Dispatching Queue to run this method. |
void |
setValue(XMLPacket packet)
This takes the packet to obtain the value from, it then performs all approriate conversions and adds this class to the Swing Event Dispatching queue. |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final String REVISION
private String _name
private String _attribute
protected String _cache
private final int _min
private final int _max
private JLabel _label
private JProgressBar _item
Constructor Detail |
public CPUDataComponent(String name, String attribute)
name
- the friendly nameattribute
- the data attribute we look afterMethod Detail |
public void run()
public String toString()
Object.toString()
method to provide clean logging (every class should have this).
toString
in class Component
public void setValue(XMLPacket packet) throws DataFormatException
packet
- the XMLPacket to get the data from
DataFormatException
- if there was a problem converting the data for displaypublic String getPacketAttribute()
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |