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
-
Constructor Summary
ConstructorDescriptionSourcePanel
(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 TypeMethodDescriptionvoid
action listener to update channel list when a a different source is selectedvoid
addSelectionListener
(ActionListener listener) Add a listener to the data source drop down listvoid
void
addSourceType
(Class sourceType) void
Clear the list of excluded data blocks.void
excludeDataBlock
(PamDataBlock block, boolean exclude) Exclude specific data blocks from the source list.int
Get a list of selected channels or sequences (depending on the source)int
getPanel()
Get a reference to the JPanel containing the controlsreturn the selected data sourceint
Get the number of items in the list.int
Get the currently selected source indexboolean
void
void
setAllowNull
(boolean allowNull) Allow a null selection.void
setChannelList
(int channelList) Set the current channel selectionvoid
setEnabled
(boolean enabled) void
setEnabledWithChannels
(boolean enabled) void
setLocalisationRequirements
(int localisationRequirements) boolean
Set the current data source using the data source namevoid
setSource
(PamDataBlock sourceBlock) Set the current data source by block referencevoid
setSourceIndex
(int sourceIndex) boolean
Fill the list of available data sources, taking into account the list of excluded sourcesboolean
setSourceList
(boolean replaceChosen) void
setSourceToolTip
(String toolTip) Set a tooltip text for the source panel.
-
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
-
actionPerformed
action listener to update channel list when a a different source is selected- Specified by:
actionPerformed
in interfaceActionListener
-
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- 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
-