public class SourcePanel
extends java.lang.Object
implements java.awt.event.ActionListener
This is for general use within other dialog panels.
Constructor and Description |
---|
SourcePanel(java.awt.Window ownerWindow,
java.lang.Class sourceType,
boolean hasChannels,
boolean includeSubClasses)
Construct a panel without a border
|
SourcePanel(java.awt.Window ownerWindow,
java.lang.String borderTitle,
java.lang.Class sourceType,
boolean hasChannels,
boolean includeSubClasses)
Construct a panel with a titles border
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
action listener to update channel list when a
a different source is selected
|
void |
addSelectionListener(java.awt.event.ActionListener listener)
Add a listener to the data source drop down list
|
void |
addSourcePanelMonitor(SourcePanelMonitor gspm) |
void |
clearExcludeList()
Clear the list of excluded data blocks.
|
void |
excludeDataBlock(PamDataBlock block,
boolean exclude)
Exclude specific data blocks from the source list.
|
javax.swing.JCheckBox[] |
getChannelBoxes() |
int |
getChannelList()
Get a list of selected channels
|
int |
getLocalisationRequirements() |
javax.swing.JPanel |
getPanel()
Get a reference to the JPanel containing the controls
|
PamDataBlock |
getSource()
return the selected data source
|
int |
getSourceCount()
Get the number of items in the list.
|
int |
getSourceIndex()
Get the currently selected source index
|
java.lang.String |
getSourceName() |
java.lang.Class |
getSourceType()
get the data source type for this SourcePanel
|
void |
removeSourcePanelMonitor(SourcePanelMonitor gspm) |
void |
setChannelList(int channelList)
Set the current channel selection
|
void |
setEnabled(boolean enabled) |
void |
setEnabledWithChannels(boolean enabled) |
void |
setLocalisationRequirements(int localisationRequirements) |
void |
setSource(PamDataBlock sourceBlock)
Set the current data source by block reference
|
boolean |
setSource(java.lang.String sourceName)
Set the current data source using the data source name
|
void |
setSourceIndex(int sourceIndex) |
boolean |
setSourceList()
Fill the list of available data sources, taking into account
the list of excluded sources
|
boolean |
setSourceList(boolean replaceChosen) |
void |
setSourceToolTip(java.lang.String toolTip)
Set a tooltip text for the source panel.
|
void |
setSourceType(java.lang.Class sourceType)
Set the source type for this SourcePanel
|
public SourcePanel(java.awt.Window ownerWindow, java.lang.String borderTitle, java.lang.Class sourceType, boolean hasChannels, boolean includeSubClasses)
borderTitle
- 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.public SourcePanel(java.awt.Window ownerWindow, java.lang.Class sourceType, boolean hasChannels, boolean includeSubClasses)
ownerWindow
- Parent windowsourceType
- Data Source typehasChannels
- Include a set of checkboxes to list available channelsinclude
- subclasses of the sourceTypepublic void setEnabled(boolean enabled)
public void setEnabledWithChannels(boolean enabled)
public void addSelectionListener(java.awt.event.ActionListener listener)
listener
- listenerpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public boolean setSource(java.lang.String sourceName)
sourceName
- public void setSource(PamDataBlock sourceBlock)
sourceBlock
- public void setSourceIndex(int sourceIndex)
public boolean setSourceList()
public boolean setSourceList(boolean replaceChosen)
public PamDataBlock getSource()
public java.lang.String getSourceName()
public int getChannelList()
public void setChannelList(int channelList)
channelList
- bitmap of currently selected channelspublic java.lang.Class getSourceType()
public void setSourceType(java.lang.Class sourceType)
sourceType
- public int getSourceIndex()
public javax.swing.JPanel getPanel()
public void excludeDataBlock(PamDataBlock block, boolean exclude)
block
- PamDataBlock to exlcudeexclude
- true - excluse; false - allowpublic void clearExcludeList()
public javax.swing.JCheckBox[] getChannelBoxes()
public int getLocalisationRequirements()
public void setLocalisationRequirements(int localisationRequirements)
public int getSourceCount()
public void addSourcePanelMonitor(SourcePanelMonitor gspm)
public void removeSourcePanelMonitor(SourcePanelMonitor gspm)
public void setSourceToolTip(java.lang.String toolTip)
toolTip
- Tooltip text.