Package PamView.dialog
Class SourcePanel
java.lang.Object
PamView.dialog.SourcePanel
- All Implemented Interfaces:
 ActionListener,EventListener
- Direct Known Subclasses:
 EffortSourcePanel,GroupedSourcePanel,PlaybackSourcePanel
Standard panel for dialogs that shows a list of
 available data sources and, optionally a list of data channels.
 
This is for general use within other dialog panels.
- Author:
 - Doug Gillespie
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected JCheckBox[]protected ArrayList<PamDataBlock> protected booleanprotected booleanprotected Windowprotected JPanelprotected JComboBox<PamDataBlock>  - 
Constructor Summary
ConstructorsConstructorDescriptionSourcePanel(Window ownerWindow, Class sourceType, boolean hasChannels, boolean includeSubClasses) Construct a panel without a borderSourcePanel(Window ownerWindow, String borderTitle, Class sourceType, boolean hasChannels, boolean includeSubClasses) Construct a panel with a titles border - 
Method Summary
Modifier and TypeMethodDescriptionvoidaction listener to update channel list when a a different source is selectedvoidaddSelectionListener(ActionListener listener) Add a listener to the data source drop down listvoidvoidaddSourceType(Class sourceType) voidClear the list of excluded data blocks.protected voidvoidexcludeDataBlock(PamDataBlock block, boolean exclude) Exclude specific data blocks from the source list.intGet a list of selected channels or sequences (depending on the source)intgetPanel()Get a reference to the JPanel containing the controlsreturn the selected data sourceintGet the number of items in the list.intGet the currently selected source indexbooleanvoidprotected voidrePackOwner(int channelsMap) Repack the owner window if the number of channels has changedprotected voidprotected voidselectionChanged(int channel) protected voidvoidsetAllowNull(boolean allowNull) Allow a null selection.voidsetChannelList(int channelList) Set the current channel selection Only enables channels that are available (remainder are silently disabled).voidsetEnabled(boolean enabled) voidsetEnabledWithChannels(boolean enabled) voidsetLocalisationRequirements(int localisationRequirements) booleanSet the current data source using the data source namevoidsetSource(PamDataBlock sourceBlock) Set the current data source by block referencevoidsetSourceIndex(int sourceIndex) booleanFill the list of available data sources, taking into account the list of excluded sourcesbooleansetSourceList(boolean replaceChosen) voidsetSourceToolTip(String toolTip) Set a tooltip text for the source panel.protected voidprotected void 
- 
Field Details
- 
panel
 - 
sourceTypes
 - 
hasChannels
protected boolean hasChannels - 
borderTitle
 - 
includeSubClasses
protected boolean includeSubClasses - 
sourceList
 - 
channelBoxes
 - 
ownerWindow
 - 
excludedBlocks
 
 - 
 - 
Constructor Details
- 
SourcePanel
public SourcePanel(Window ownerWindow, String borderTitle, Class sourceType, boolean hasChannels, boolean includeSubClasses) Construct a panel with a titles border- Parameters:
 ownerWindow- parentWindowborderTitle- Title to go in bordersourceType- Data Source typehasChannels- Include a set of checkboxes to list available channelsincludeSubClasses- inlcude all subclasses of sourceType in the list.
 - 
SourcePanel
public SourcePanel(Window ownerWindow, Class sourceType, boolean hasChannels, boolean includeSubClasses) Construct a panel without a border- Parameters:
 ownerWindow- Parent windowsourceType- Data Source typehasChannels- Include a set of checkboxes to list available channelsinclude- subclasses of the sourceType
 
 - 
 - 
Method Details
- 
setEnabled
public void setEnabled(boolean enabled)  - 
setEnabledWithChannels
public void setEnabledWithChannels(boolean enabled)  - 
addSelectionListener
Add a listener to the data source drop down list- Parameters:
 listener- listener
 - 
selectionChanged
protected void selectionChanged(int channel)  - 
createPanel
protected void createPanel() - 
selectNoChannels
protected void selectNoChannels() - 
selectAllChannels
protected void selectAllChannels() - 
actionPerformed
action listener to update channel list when a a different source is selected- Specified by:
 actionPerformedin interfaceActionListener
 - 
sourceChanged
protected void sourceChanged() - 
showChannels
protected void showChannels() - 
rePackOwner
protected void rePackOwner(int channelsMap) Repack the owner window if the number of channels has changed- Parameters:
 channelsMap- bitmap of used channels.
 - 
setSource
Set the current data source using the data source name- Parameters:
 sourceName-- Returns:
 - true if OK
 
 - 
setSource
Set the current data source by block reference- Parameters:
 sourceBlock-
 - 
setSourceIndex
public void setSourceIndex(int sourceIndex)  - 
setSourceList
public boolean setSourceList()Fill the list of available data sources, taking into account the list of excluded sources- Returns:
 - sets a list of available sources. Returns false if no sources are available.
 
 - 
setSourceList
public boolean setSourceList(boolean replaceChosen)  - 
getCompatibleDataBlocks
 - 
getSource
return the selected data source- Returns:
 - source data block
 
 - 
getSourceName
- Returns:
 - the source data block name, or null if nothing selected.
 
 - 
getChannelList
public int getChannelList()Get a list of selected channels or sequences (depending on the source)- Returns:
 - bitmap of selected channels
 
 - 
setChannelList
public void setChannelList(int channelList) Set the current channel selection Only enables channels that are available (remainder are silently disabled).- Parameters:
 channelList- bitmap of currently selected channels
 - 
addSourceType
 - 
getSourceIndex
public int getSourceIndex()Get the currently selected source index- Returns:
 - source index within the source list
 
 - 
getPanel
Get a reference to the JPanel containing the controls- Returns:
 - JPanel container
 
 - 
excludeDataBlock
Exclude specific data blocks from the source list. e.g. a process would normally not be able to use it's own output data block as an input source and should therefore exclude it from the list.- Parameters:
 block- PamDataBlock to exlcudeexclude- true - excluse; false - allow
 - 
clearExcludeList
public void clearExcludeList()Clear the list of excluded data blocks. - 
getChannelBoxes
 - 
getLocalisationRequirements
public int getLocalisationRequirements() - 
setLocalisationRequirements
public void setLocalisationRequirements(int localisationRequirements)  - 
getSourceCount
public int getSourceCount()Get the number of items in the list.- Returns:
 - number of sources of this type of data
 
 - 
addSourcePanelMonitor
 - 
removeSourcePanelMonitor
 - 
setSourceToolTip
Set a tooltip text for the source panel.- Parameters:
 toolTip- Tooltip text.
 - 
isAllowNull
public boolean isAllowNull()- Returns:
 - the allowNull
 
 - 
setAllowNull
public void setAllowNull(boolean allowNull) Allow a null selection.- Parameters:
 allowNull- the allowNull to set
 
 -