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.
-
initialized
- have I been initialized
-
itemCount
- how many items are in the list
-
Line1
- two lines of label for the page
-
Line2
- two lines of label for the page
-
myList
- AWT List to show items
-
myName
- how you should think of me
-
myObserveList
- List block being managed
-
whereAmI
- where am I in the list (index)
-
ListBox(String, String, ListBlock)
- Make list box
String
Label line 1
String
Label line 2
ListBlock
Observe list to display
-
AddComponent(Component, int, int, int, int, int, int, double, double)
- Add component to panel.
-
clearAll()
- Clear all selections in list
-
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.
-
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.
-
FinalizePanel()
- Finalize Panel
Any editing should modify list so this is a NOP
-
getAll()
- Make a ChangeList including all scans in a list whether selected or not.
-
getAllIndices()
- Get all item indices
Return a list of Scans indices
-
getAllScans()
- Get all items
Return a list of Scans
if the list is a calibrator list the entries are converted
to Scans.
-
getIndex(String)
- Get an Observe List item index from the coresponding ListBox List label
-
getLabel(int)
- Return the Label from a list entry
-
getName(String)
- Get an Observe List item Id string from the coresponding ListBox List label
-
getScan(int)
- Return a copy of the scan at a specified index.
-
getSelected()
- Make a ChangeList including all selected scans in a list.
-
getSelectedIndices()
- Get selected item indices
Return a list of Scans indices corresponding to selected items.
-
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.
-
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.
-
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.
-
makeName(int, String)
- Make a list entry name from the index and the item label.
-
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.
-
next(ChangeList)
- Return a ChangeList for the Scan following the first (only) scan in a ChangeList.
-
previous(ChangeList)
- Return a ChangeList for the Scan prior to the first (only) scan in a ChangeList.
-
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.
-
replaceScans(int[], Scan[])
- Replace a list of scans at specified indices.
-
ResetPanel()
- Restore Panel
Update displayed list with the current contents
myName
public String myName
- how you should think of me
initialized
public boolean initialized
- have I been initialized
itemCount
public int itemCount
- how many items are in the list
whereAmI
public int whereAmI
- where am I in the list (index)
myObserveList
public ListBlock myObserveList
- List block being managed
Line1
public Label Line1
- two lines of label for the page
Line2
public Label Line2
- two lines of label for the page
myList
public List myList
- AWT List to show items
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
clearAll
public void clearAll()
- Clear all selections in list
getAll
public ChangeList getAll()
- Make a ChangeList including all scans in a list whether selected or not.
- Returns:
-
ChangeList
change order template for list
getSelected
public ChangeList getSelected()
- Make a ChangeList including all selected scans in a list.
- Returns:
-
ChangeList
change order template for list
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
getAllIndices
public int[] getAllIndices()
- Get all item indices
Return a list of Scans indices
- Returns:
-
int[]
list of selected scan indices. null=none
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
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
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
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
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
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
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
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
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
FinalizePanel
public void FinalizePanel()
- Finalize Panel
Any editing should modify list so this is a NOP
ResetPanel
public void ResetPanel()
- Restore Panel
Update displayed list with the current contents
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
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
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
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
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
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
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
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