All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JObserve.GUI.ListBox

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----JObserve.GUI.ListBox

public class ListBox
extends Panel
Subpanel for displaying and editing Observe Lists Create and manage a panel which contains a selectable List containing an Observe List. It is intended that a number of these are displayed on a single panel.


Variable Index

 o initialized
have I been initialized
 o itemCount
how many items are in the list
 o Line1
two lines of label for the page
 o Line2
two lines of label for the page
 o myList
AWT List to show items
 o myName
how you should think of me
 o myObserveList
List block being managed
 o whereAmI
where am I in the list (index)

Constructor Index

 o ListBox(String, String, ListBlock)
Make list box String Label line 1 String Label line 2 ListBlock Observe list to display

Method Index

 o AddComponent(Component, int, int, int, int, int, int, double, double)
Add component to panel.
 o clearAll()
Clear all selections in list
 o deleteScans(int[])
Delete a list of scans at a given index in the list Observe list is updated and the ResetPanel function is used to update the displayed list.
 o EditScan(int, String)
Edit event on a list item If the list is a calibrator list then a readonly display of the calibrator contents is in invoked.
 o FinalizePanel()
Finalize Panel Any editing should modify list so this is a NOP
 o getAll()
Make a ChangeList including all scans in a list whether selected or not.
 o getAllIndices()
Get all item indices Return a list of Scans indices
 o getAllScans()
Get all items Return a list of Scans if the list is a calibrator list the entries are converted to Scans.
 o getIndex(String)
Get an Observe List item index from the coresponding ListBox List label
 o getLabel(int)
Return the Label from a list entry
 o getName(String)
Get an Observe List item Id string from the coresponding ListBox List label
 o getScan(int)
Return a copy of the scan at a specified index.
 o getSelected()
Make a ChangeList including all selected scans in a list.
 o getSelectedIndices()
Get selected item indices Return a list of Scans indices corresponding to selected items.
 o getSelectedScans()
Get selected items Return a list of Scans corresponding to selected items if the list is a calibrator list the entries are converted to Scans.
 o insertScans(Scan[], int)
Insert a list of scans at a given index in the list Observe list is updated and the ResetPanel function is used to update the displayed list.
 o LookupScan(String)
Look for a scan with a given name (Id) Return a list of Scans corresponding to selected items if the list is a calibrator list the entries are converted to Scans.
 o makeName(int, String)
Make a list entry name from the index and the item label.
 o modify(ChangeList)
Modify a list of scans at a given index in the list Observe list is updated and the ResetPanel function is used to update the displayed list.
 o next(ChangeList)
Return a ChangeList for the Scan following the first (only) scan in a ChangeList.
 o previous(ChangeList)
Return a ChangeList for the Scan prior to the first (only) scan in a ChangeList.
 o removeScans(Scan[], int)
Remove a list of scans after a given index in the list Observe list is updated and the ResetPanel function is used to update the displayed list.
 o replaceScans(int[], Scan[])
Replace a list of scans at specified indices.
 o ResetPanel()
Restore Panel Update displayed list with the current contents

Variables

 o myName
 public String myName
how you should think of me

 o initialized
 public boolean initialized
have I been initialized

 o itemCount
 public int itemCount
how many items are in the list

 o whereAmI
 public int whereAmI
where am I in the list (index)

 o myObserveList
 public ListBlock myObserveList
List block being managed

 o Line1
 public Label Line1
two lines of label for the page

 o Line2
 public Label Line2
two lines of label for the page

 o myList
 public List myList
AWT List to show items

Constructors

 o ListBox
 public ListBox(String label1,
                String label2,
                ListBlock list)
Make list box String Label line 1 String Label line 2 ListBlock Observe list to display

Methods

 o clearAll
 public void clearAll()
Clear all selections in list

 o getAll
 public ChangeList getAll()
Make a ChangeList including all scans in a list whether selected or not.

Returns:
ChangeList change order template for list
 o getSelected
 public ChangeList getSelected()
Make a ChangeList including all selected scans in a list.

Returns:
ChangeList change order template for list
 o getAllScans
 public Scan[] getAllScans()
Get all items Return a list of Scans if the list is a calibrator list the entries are converted to Scans.

Returns:
Scan[] list of selected scans. null=none
 o getAllIndices
 public int[] getAllIndices()
Get all item indices Return a list of Scans indices

Returns:
int[] list of selected scan indices. null=none
 o getSelectedScans
 public Scan[] getSelectedScans()
Get selected items Return a list of Scans corresponding to selected items if the list is a calibrator list the entries are converted to Scans.

Returns:
Scan[] list of selected scans. null=none
 o LookupScan
 public Scan LookupScan(String theId)
Look for a scan with a given name (Id) Return a list of Scans corresponding to selected items if the list is a calibrator list the entries are converted to Scans.

Parameters:
String - the Scan Id
Returns:
Scan the first match. null=no match
 o getScan
 public Scan getScan(int index)
Return a copy of the scan at a specified index. Calibrator list entries are converted.

Parameters:
int - the 0-rel index of the scan
Returns:
Scan the first match. null=no match
 o getSelectedIndices
 public int[] getSelectedIndices()
Get selected item indices Return a list of Scans indices corresponding to selected items.

Returns:
int[] list of selected scan indices. null=List empty
 o modify
 public void modify(ChangeList change) throws IllegalArgumentException
Modify a list of scans at a given index in the list Observe list is updated and the ResetPanel function is used to update the displayed list.

Parameters:
ChangeList - work order for modifications Note the delete list should be in ascending index order.
Throws: IllegalArgumentException
if passed invalid arguments
 o insertScans
 public int insertScans(Scan scans[],
                        int index) throws IllegalArgumentException
Insert a list of scans at a given index in the list Observe list is updated and the ResetPanel function is used to update the displayed list.

Parameters:
Scan[] - list of selected scan indices. null=none
int - 0-rel order number in list, if 0 or less then the scans are added at the head of the list and if larger than the number of scans then they are added at the end.
Returns:
int the actual 0-rel order number in list (-1 = NOP)
Throws: IllegalArgumentException
if passed invalid arguments
 o removeScans
 public void removeScans(Scan scans[],
                         int index) throws IllegalArgumentException
Remove a list of scans after a given index in the list Observe list is updated and the ResetPanel function is used to update the displayed list. This is the inverse of insertScans.

Parameters:
Scan[] - list of selected scan indices. null=none
int - 0-rel order number in list, if 0 or less then the scans are added at the head of the list and if larger than the number of scans then they are added at the end.
Throws: IllegalArgumentException
if passed invalid arguments
 o deleteScans
 public void deleteScans(int indices[]) throws IllegalArgumentException
Delete a list of scans at a given index in the list Observe list is updated and the ResetPanel function is used to update the displayed list. If the List being modified in the Observe list it is unscheduled after the first modified scan.

Parameters:
int[] - list of selected scan indices. null=none Note this list should be in ascending index order.
Throws: IllegalArgumentException
if passed invalid arguments
 o replaceScans
 public void replaceScans(int indices[],
                          Scan scans[]) throws IllegalArgumentException
Replace a list of scans at specified indices. Observe list is updated and the ResetPanel function is used to update the displayed list. If the List being modified in the Observe list it is unscheduled after the first modified scan. This is the inverse of deleteScans

Parameters:
int[] - list of selected scan indices.
Scan[] - list of scans to be inserted. Note this list should be in ascending index order.
Throws: IllegalArgumentException
if passed invalid arguments
 o FinalizePanel
 public void FinalizePanel()
Finalize Panel Any editing should modify list so this is a NOP

 o ResetPanel
 public void ResetPanel()
Restore Panel Update displayed list with the current contents

 o makeName
 public static String makeName(int index,
                               String Id)
Make a list entry name from the index and the item label. This is provide a unique label for list entries. Visible index is 1-rel.

Parameters:
int - the 0-rel index number
String - the base from which to derive the list name
Returns:
String the label string for the list
 o getName
 public static String getName(String label)
Get an Observe List item Id string from the coresponding ListBox List label

Parameters:
String - the label string from the list
Returns:
String the corresponding item's Id string
 o getIndex
 public static int getIndex(String label)
Get an Observe List item index from the coresponding ListBox List label

Parameters:
String - the label string from the list
Returns:
String the corresponding item's 0-rel index
 o AddComponent
 public void AddComponent(Component comp,
                          int x,
                          int y,
                          int gridwidth,
                          int gridheight,
                          int fill,
                          int anchor,
                          double weightx,
                          double weighty)
Add component to panel.

Parameters:
Component - The component to add
int - The X (0-rel) cell number
int - The Y (0-rel) cell number
int - The number of cells in X
int - The number of cells in Y
int - The expansion code allowed
int - The anchor code
double - The X expansion weight
double - The Y expansion weight
 o EditScan
 public void EditScan(int index,
                      String label)
Edit event on a list item If the list is a calibrator list then a readonly display of the calibrator contents is in invoked. If the list contains Scans then a copy of the Scan is made into an appropriate ChangeList and passed to a scan editor. The scan editor invokes the modify method when it is done to change the list.

Parameters:
int - the index number (0-rel) of the scan to edit
String - Label in the displayed AWT.List of the scan to edit
 o next
 public ChangeList next(ChangeList in)
Return a ChangeList for the Scan following the first (only) scan in a ChangeList. If this is already the last scan the returned ChangeList contains the same one.

Parameters:
ChangeList - input ChangeList
Returns:
ChangeList ChangeList for next scan
 o previous
 public ChangeList previous(ChangeList in)
Return a ChangeList for the Scan prior to the first (only) scan in a ChangeList. If this is already the first scan the returned ChangeList contains the same one.

Parameters:
ChangeList - input ChangeList
Returns:
ChangeList ChangeList for previous scan
 o getLabel
 public String getLabel(int index)
Return the Label from a list entry

Parameters:
int - the index number (0-rel) of the scan to edit
Returns:
String Label in the displayed AWT.List of the scan to edit

All Packages  Class Hierarchy  This Package  Previous  Next  Index