public abstract class DataSourceHolder
extends java.lang.Object
DataSource
s. For now these are the
DataTree
and
DataSelector
. This class provides
basic facilities to manage the list of data sources, create the
window, etc.Modifier and Type | Field and Description |
---|---|
protected java.awt.Dimension |
defaultDimension
The size of the window
|
protected DataSource |
formulaDataSource
The formula data source, i.e., the one that holds the end-user formulas
|
protected IdvWindow |
frame
The window this gui is in
|
protected IntegratedDataViewer |
idv
The IDV
|
protected boolean |
treatFormulaDataSourceSpecial
If true then we don't remove the formula data source
|
Constructor and Description |
---|
DataSourceHolder(IntegratedDataViewer idv,
DataSource formulaDataSource,
java.awt.Dimension defaultDimension)
Create this object
|
Modifier and Type | Method and Description |
---|---|
void |
addDataSource(DataSource dataSource)
Add the given
DataSource |
void |
addDisplayControl(DisplayControl control)
Adds the given
DisplayControl |
void |
addDisplayControl(DisplayControl control,
DataChoice choice)
A no-op that can be overrode by a derived class
|
void |
dataSourceChanged(DataSource source)
Be notified that the given
DataSource has changed. |
void |
dataSourceTimeChanged(DataSource source)
Be notified that the tim selection on the given
DataSource has changed. |
void |
displayTemplatesChanged()
A hook to notify that the list of favorites has changed
|
void |
dispose()
Remove all references to anything we may have.
|
void |
doClose()
Remove this holder from the IDV and dispose of the window
|
IdvWindow |
doMakeFrame()
Make the IdvWindow.
|
javax.swing.JComponent |
getButtons()
Hook for derived classes to provide their own dialog buttons
|
abstract javax.swing.JComponent |
getContents()
Needs to be overrode by derived classes to return
the GUI
|
java.util.List |
getDataSources()
Return the list of
DataSource s |
static javax.swing.ImageIcon |
getDerivedIcon()
Utility method to create, if needed, and return
the ImageIcon to be used to show
DerivedDataChoice s |
IdvWindow |
getFrame()
Get our window.
|
IntegratedDataViewer |
getIdv()
Return the IDV member.
|
java.awt.Point |
getLocationOnScreen()
Utility to determine the location on the screen.
|
protected java.lang.String |
getName()
Get the name of this data source holder.
|
void |
removeAllDataSources()
Remove all data sources
|
void |
removeDataSource(DataSource dataSource)
Remove the given
DataSource
only if it is not the formulaDataSource. |
protected boolean |
removeDataSourceInner(DataSource dataSource)
Remove the specified data source only if it is not the formulaDataSource.
|
void |
removeDisplayControl(DisplayControl control)
Remove the given
DisplayControl |
void |
setDefaultSize(java.awt.Dimension d)
Set the default window size to be used by this component
|
void |
setFrame(IdvWindow f)
Set our window
|
void |
show()
Show the window if it is non-null
|
protected IntegratedDataViewer idv
protected IdvWindow frame
protected DataSource formulaDataSource
protected boolean treatFormulaDataSourceSpecial
protected java.awt.Dimension defaultDimension
public DataSourceHolder(IntegratedDataViewer idv, DataSource formulaDataSource, java.awt.Dimension defaultDimension)
idv
- The IDVformulaDataSource
- The singleton formula data source. We treat this
special.defaultDimension
- How big is the window.public IdvWindow doMakeFrame()
public IntegratedDataViewer getIdv()
protected java.lang.String getName()
public void doClose()
public void show()
public void setFrame(IdvWindow f)
f
- The windowpublic IdvWindow getFrame()
public abstract javax.swing.JComponent getContents()
public java.awt.Point getLocationOnScreen()
public javax.swing.JComponent getButtons()
public java.util.List getDataSources()
DataSource
spublic static javax.swing.ImageIcon getDerivedIcon()
DerivedDataChoice
spublic void setDefaultSize(java.awt.Dimension d)
d
- The default sizepublic void addDisplayControl(DisplayControl control, DataChoice choice)
control
- The new display controlchoice
- The data choicepublic void removeDisplayControl(DisplayControl control)
DisplayControl
control
- The removed display controlpublic void addDisplayControl(DisplayControl control)
DisplayControl
control
- The new display controlpublic void dispose()
public void removeAllDataSources()
public void addDataSource(DataSource dataSource)
DataSource
dataSource
- The new data sourcepublic void removeDataSource(DataSource dataSource)
DataSource
only if it is not the formulaDataSource.dataSource
- The data source to be removedprotected boolean removeDataSourceInner(DataSource dataSource)
dataSource
- The data source to be removedpublic void dataSourceChanged(DataSource source)
DataSource
has changed.source
- The data source that changedpublic void dataSourceTimeChanged(DataSource source)
DataSource
has changed.source
- The data source whose time has changedpublic void displayTemplatesChanged()