public abstract class AbstractCatalogDirectory extends Object implements CatalogDirectory
ARCHIVE, CATALOG, DIRECTORY, IMAGE_SERVER, LOCAL, NAME_SERVER
Constructor and Description |
---|
AbstractCatalogDirectory(String name)
Initialize with the name of the catalog directory.
|
Modifier and Type | Method and Description |
---|---|
void |
addCatalog(Catalog cat)
Add the given catalog to the catalog list if it is not already there.
|
void |
addCatalog(int index,
Catalog cat)
Add the given catalog to the catalog list if it is not already there.
|
void |
addTreeModelListener(TreeModelListener l)
Adds a listener for the
TreeModelEvent
posted after the tree changes. |
Object |
clone()
Implementation of the clone method (makes a shallow copy).
|
Catalog |
getCatalog(int i)
Return the ith catalog in the directory
|
Catalog |
getCatalog(String catalogName)
Return the named catalog, if found in this directory
|
TableQueryResult |
getCatalogList()
Return a memory catalog describing the list of catalogs in the directory
|
List |
getCatalogs()
Return a copy of the list of catalogs in this catalog directory.
|
Object |
getChild(Object parent,
int index)
Returns the child of
parent at index index
in the parent's
child array. |
int |
getChildCount(Object parent)
Returns the number of children of
parent . |
String |
getDescription()
Return a description of the catalog, or null if not available
|
URL |
getDocURL()
Return a URL pointing to documentation for the catalog, or null if not available
|
HTMLQueryResultHandler |
getHTMLQueryResultHandler()
Return the handler used to report HTML format errors from servers
|
String |
getId()
Return the Id or short name of the catalog directory
|
int |
getIndexOfChild(Object parent,
Object child)
Returns the index of child in parent.
|
String |
getName()
Return the name of the catalog directory
|
List |
getNameServers()
Return a list of name servers (Catalogs with serv_type
equal to "namesvr") to use to resolve astronomical object names.
|
int |
getNumCatalogs()
Return the number of catalogs in this directory
|
int |
getNumParams()
Return the number of query parameters that this catalog accepts
|
FieldDesc |
getParamDesc(int i)
Return a description of the ith query parameter
|
FieldDesc |
getParamDesc(String name)
Return a description of the named query parameter
|
CatalogDirectory |
getParent()
Return a reference to the parent catalog directory, or null if not known.
|
Catalog[] |
getPath()
Return an array of Catalog or CatalogDirectory objects representing the
path from the root catalog directory to this catalog.
|
Catalog[] |
getPath(Catalog cat)
Return an array of catalogs describing the path to the given catalog or catalog directory.
|
Object |
getRoot()
Returns the root of the tree.
|
AbstractCatalogDirectory |
getRootCatalogDirectory()
Returns the root catalog directory, casted to an AbstractCatalogDirectory.
|
String |
getTitle()
Return a string to display as a title for the catalog directory in a user interface
|
String |
getType()
Return the catalog type (one of the constants: CATALOG, ARCHIVE, DIRECTORY, LOCAL, IMAGE_SERVER)
|
URL |
getURL()
Return the URL of the file describing this catalog directory.
|
int |
indexOf(Catalog cat)
Return the index of the given catalog in the directory
|
boolean |
isImageServer()
Return true if this object represents an image server.
|
boolean |
isLeaf(Object node)
Returns
true if node is a leaf. |
boolean |
isLocal()
Return true if this is a local catalog, and false if it requires
network access or if a query could hang.
|
void |
moveCatalog(Catalog cat,
boolean up)
Move the the given catalog up or down in the tree.
|
void |
moveCatalogToEnd(Catalog cat,
boolean up)
Move the the given catalog all the way up or down in the tree, as far as possible.
|
QueryResult |
query(QueryArgs queryArgs)
This method assumes the catalog directory has no query parameters and
just returns "this".
|
void |
removeCatalog(Catalog cat)
Remove the given catalog from the catalog list.
|
void |
removeTreeModelListener(TreeModelListener l)
Removes a listener previously added with
addTreeModelListener . |
void |
replaceCatalog(Catalog oldCat,
Catalog newCat)
Replace the given old catalog with the given new catalog in the catalog list.
|
void |
setCatalogs(List catalogs)
Set the list of catalogs in this catalog directory.
|
void |
setHTMLQueryResultHandler(HTMLQueryResultHandler handler)
Optional handler, used to report HTML format errors from servers
|
void |
setId(String id)
Set the Id or short name of the catalog directory
|
void |
setName(String name)
Return the name of the catalog directory
|
void |
setParent(CatalogDirectory dir)
Set the parent catalog directory
|
void |
setRegionArgs(QueryArgs queryArgs,
CoordinateRadius region)
This method is required to implement the Catalog interface, but does nothing here.
|
void |
setURL(URL url)
Set the URL of the file describing this catalog directory.
|
String |
toString()
Return a string representing this object (in this case the name)
|
void |
valueForPathChanged(TreePath path,
Object newValue)
Messaged when the user has altered the value for the item identified
by
path to newValue . |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
loadSubDir, reload, save
public AbstractCatalogDirectory(String name)
name
- the display name for the catalog directorypublic Object clone()
public CatalogDirectory getParent()
Catalog
public void setParent(CatalogDirectory dir)
Catalog
public HTMLQueryResultHandler getHTMLQueryResultHandler()
public void setHTMLQueryResultHandler(HTMLQueryResultHandler handler)
public String toString()
public void addCatalog(int index, Catalog cat)
public void addCatalog(Catalog cat)
addCatalog
in interface CatalogDirectory
public void removeCatalog(Catalog cat)
removeCatalog
in interface CatalogDirectory
public void replaceCatalog(Catalog oldCat, Catalog newCat)
replaceCatalog
in interface CatalogDirectory
public void moveCatalog(Catalog cat, boolean up)
moveCatalog
in interface CatalogDirectory
public void moveCatalogToEnd(Catalog cat, boolean up)
moveCatalogToEnd
in interface CatalogDirectory
public Catalog getCatalog(String catalogName)
getCatalog
in interface CatalogDirectory
public int getNumCatalogs()
getNumCatalogs
in interface CatalogDirectory
public Catalog getCatalog(int i)
getCatalog
in interface CatalogDirectory
public int indexOf(Catalog cat)
indexOf
in interface CatalogDirectory
public void setCatalogs(List catalogs)
public List getCatalogs()
public TableQueryResult getCatalogList()
getCatalogList
in interface CatalogDirectory
public URL getURL()
public void setURL(URL url)
public String getName()
public void setName(String name)
public String getTitle()
public String getId()
public void setId(String id)
public String getDescription()
getDescription
in interface Catalog
public URL getDocURL()
public int getNumParams()
getNumParams
in interface Catalog
public FieldDesc getParamDesc(int i)
getParamDesc
in interface Catalog
public FieldDesc getParamDesc(String name)
getParamDesc
in interface Catalog
public void setRegionArgs(QueryArgs queryArgs, CoordinateRadius region)
setRegionArgs
in interface Catalog
queryArgs
- (in/out) describes the query argumentsregion
- (in) describes the query region (center and radius range)public boolean isLocal()
public boolean isImageServer()
isImageServer
in interface Catalog
public String getType()
public QueryResult query(QueryArgs queryArgs) throws IOException
query
in interface Catalog
queryArgs
- An object describing the query arguments (not used here)IOException
public List getNameServers()
getNameServers
in interface CatalogDirectory
public AbstractCatalogDirectory getRootCatalogDirectory()
public Object getRoot()
null
only if the tree has no nodes.public Object getChild(Object parent, int index)
parent
at index index
in the parent's
child array. parent
must be a node previously obtained
from this data source. This should not return null
if index
is a valid index for parent
(that is index >= 0 &&
index < getChildCount(parent
)).public int getChildCount(Object parent)
parent
.
Returns 0 if the node
is a leaf or if it has no children. parent
must be a node
previously obtained from this data source.getChildCount
in interface TreeModel
parent
- a node in the tree, obtained from this data sourceparent
public boolean isLeaf(Object node)
true
if node
is a leaf.
It is possible for this method to return false
even if node
has no children.
A directory in a filesystem, for example,
may contain no files; the node representing
the directory is not a leaf, but it also has no children.public void valueForPathChanged(TreePath path, Object newValue)
path
to newValue
.
If newValue
signifies a truly new value
the model should post a treeNodesChanged
event.valueForPathChanged
in interface TreeModel
path
- path to the node that the user has alterednewValue
- the new value from the TreeCellEditorpublic int getIndexOfChild(Object parent, Object child)
parent
is null
or child
is null
,
returns -1.getIndexOfChild
in interface TreeModel
parent
- a note in the tree, obtained from this data sourcechild
- the node we are interested inchild
or parent
are null
public void addTreeModelListener(TreeModelListener l)
TreeModelEvent
posted after the tree changes.addTreeModelListener
in interface TreeModel
l
- the listener to addremoveTreeModelListener(javax.swing.event.TreeModelListener)
public void removeTreeModelListener(TreeModelListener l)
addTreeModelListener
.removeTreeModelListener
in interface TreeModel
l
- the listener to removeaddTreeModelListener(javax.swing.event.TreeModelListener)
public Catalog[] getPath(Catalog cat)
getPath
in interface CatalogDirectory
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.