rocca
Class RoccaSidePanel

java.lang.Object
  extended by rocca.RoccaSidePanel
All Implemented Interfaces:
PamObserver, PamSidePanel

public class RoccaSidePanel
extends java.lang.Object
implements PamSidePanel, PamObserver


Nested Class Summary
private  class RoccaSidePanel.SidePanel
           
 
Field Summary
(package private)  RoccaControl roccaControl
           
(package private)  RoccaSidePanel.SidePanel sidePanel
           
(package private)  javax.swing.JTextField sightingNum
           
(package private)  javax.swing.JLabel[] species
           
(package private)  int[] speciesClassCount
           
(package private)  javax.swing.JTextField[] speciesClassCountTxt
           
(package private)  javax.swing.border.TitledBorder titledBorder
           
 
Constructor Summary
RoccaSidePanel(RoccaControl roccaControl)
           
 
Method Summary
 java.lang.String getObserverName()
           
 PamObserver getObserverObject()
           
 javax.swing.JComponent getPanel()
           
 long getRequiredDataHistory(PamObservable o, java.lang.Object arg)
           
 java.lang.String getSightingNum()
           
 int[] getSpeciesClassCount()
          Returns the classification counts for the current species list
 void incSpeciesCount(int speciesToInc)
          Increments a specific species classification count
 void masterClockUpdate(long milliSeconds, long sampleNumber)
           
 void noteNewSettings()
           
 void removeObservable(PamObservable o)
          called when an Observable (PamDataBlock) is removed from the system
 void rename(java.lang.String newName)
           
 void setSampleRate(float sampleRate, boolean notify)
          New sample rate
 void setSightingNum(java.lang.String sightingNum)
           
 void setSpecies(java.lang.String[] speciesAsString)
          Creates a new list of species and sets the counts to 0.
 void setSpeciesClassCount(int[] speciesClassCount)
          Sets all the species counts.
 void update(PamObservable o, PamDataUnit arg)
          Informs the PamObserver that new data have been added to the Observable class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

roccaControl

RoccaControl roccaControl

sidePanel

RoccaSidePanel.SidePanel sidePanel

titledBorder

javax.swing.border.TitledBorder titledBorder

sightingNum

javax.swing.JTextField sightingNum

species

javax.swing.JLabel[] species

speciesClassCount

int[] speciesClassCount

speciesClassCountTxt

javax.swing.JTextField[] speciesClassCountTxt
Constructor Detail

RoccaSidePanel

public RoccaSidePanel(RoccaControl roccaControl)
Method Detail

getObserverObject

public PamObserver getObserverObject()
Specified by:
getObserverObject in interface PamObserver
Returns:
the actual observer. In most cases concrete classes will just return 'this' in response. The exception is the Threaded observer, which will return the single thread observer.

getPanel

public javax.swing.JComponent getPanel()
Specified by:
getPanel in interface PamSidePanel
Returns:
Reference to a graphics component that can be added to the view. This will typically be a JPanel or a JInternalFrame; The component will be displayed to the side of the main tab control.

rename

public void rename(java.lang.String newName)
Specified by:
rename in interface PamSidePanel

getObserverName

public java.lang.String getObserverName()
Specified by:
getObserverName in interface PamObserver

setSpecies

public void setSpecies(java.lang.String[] speciesAsString)
Creates a new list of species and sets the counts to 0. Repaints the sidepanel once the fields are updated

Parameters:
speciesAsString - a string array of species names (max 5 characters)

getSpeciesClassCount

public int[] getSpeciesClassCount()
Returns the classification counts for the current species list

Returns:
an int array containing the classification counts

setSpeciesClassCount

public void setSpeciesClassCount(int[] speciesClassCount)
Sets all the species counts.

Parameters:
speciesClassCount - an int array with the counts for each species. The length of the array must match the length of the species list

incSpeciesCount

public void incSpeciesCount(int speciesToInc)
Increments a specific species classification count

Parameters:
speciesToInc - the index of the species to increment

getSightingNum

public java.lang.String getSightingNum()

setSightingNum

public void setSightingNum(java.lang.String sightingNum)

getRequiredDataHistory

public long getRequiredDataHistory(PamObservable o,
                                   java.lang.Object arg)
Specified by:
getRequiredDataHistory in interface PamObserver
Parameters:
o - PamObservable class requiring the data
arg - optional argument from PamObservable
Returns:
time in milliseconds requried by data held in PamObservable

noteNewSettings

public void noteNewSettings()
Specified by:
noteNewSettings in interface PamObserver

removeObservable

public void removeObservable(PamObservable o)
Description copied from interface: PamObserver
called when an Observable (PamDataBlock) is removed from the system

Specified by:
removeObservable in interface PamObserver

setSampleRate

public void setSampleRate(float sampleRate,
                          boolean notify)
Description copied from interface: PamObserver
New sample rate

Specified by:
setSampleRate in interface PamObserver
notify - Notify other PamObservers and PamObservables in the chain.

masterClockUpdate

public void masterClockUpdate(long milliSeconds,
                              long sampleNumber)
Specified by:
masterClockUpdate in interface PamObserver

update

public void update(PamObservable o,
                   PamDataUnit arg)
Description copied from interface: PamObserver
Informs the PamObserver that new data have been added to the Observable class

Specified by:
update in interface PamObserver
Parameters:
o - Reference to the Observable (a PamDataBlock)
arg - Reference to the new PamDataUnit