Package jsky.catalog

Examples of jsky.catalog.CatalogDirectory


    /**
     * Open a catalog window for the named catalog, if found.
     */
    public void openCatalogWindow(String name) {
        CatalogDirectory dir = CatalogNavigator.getCatalogDirectory(false);
        Catalog cat = dir.findCatalog(name);
        if (cat != null) {
            openCatalogWindow(cat);
        }
    }
View Full Code Here


    AstroCatalog cat = new AstroCatalog();
    cat.setName("Test");
    cat.setProtocol("http");
    cat.setHost("nvo.stsci.edu");
    cat.setURLPath("/vor10/ristandardservice.asmx");
    CatalogDirectory dir = VoCatalogDirectory.getDirectory(cat);
    int n = dir.getNumCatalogs();
    for(int i = 0; i < n; i++) {
      Catalog catalog = dir.getCatalog(i);
      System.out.println(i + ": " + catalog.getName() + " - " + catalog.getTitle());
    }
  }
View Full Code Here

    /**
     * Add the catalog menu items.
     */
    public void addMenuItems() {
        CatalogDirectory dir = CatalogNavigator.getCatalogDirectory(false);

        // update menu when the config file changes
        dir.removeTreeModelListener(this);
        dir.addTreeModelListener(this);

        _catalogMenu = _createCatalogSubMenu(this, _catalogMenu, true, dir, Catalog.CATALOG,
                _I18N.getString("catalogs"), CatalogTreeCellRenderer.CATALOG_ICON);

        _archiveMenu = _createCatalogSubMenu(this, _archiveMenu, true, dir, Catalog.ARCHIVE,
View Full Code Here

            // save changes
            cat.setSymbols(_symbols);
            cat.setSymbolsEdited(true);

            // Add the catalog to the top level catalog directory and then call save on it
            CatalogDirectory rootDir = null, catDir = cat.getParent();
            if (catDir != null) {
                rootDir = (CatalogDirectory) catDir.getRoot();
            }
            if (rootDir != null) {
                Catalog existingCat = rootDir.getCatalog(cat.getName());
                if (existingCat != null && existingCat != cat) {
                    rootDir.removeCatalog(existingCat);
                }
                rootDir.addCatalog(1, cat);
                rootDir.save();
            }
        }
    }
View Full Code Here

        if (contentType != null && contentType.equals("text/html")) {
            // might be an HTML error from an HTTP server
            _htmlQueryResultHandler.displayHTMLPage(url);
        } else {
//            String filename = url.getFile();
            CatalogDirectory parentDir = _rootCatDir;
            Catalog selectedNode = getSelectedCatalog();
            if (selectedNode != null && selectedNode != _rootCatDir) {
                CatalogDirectory dir = selectedNode.getParent();
                if (dir != null) {
                    parentDir = dir;
                }
            }
            return parentDir.loadSubDir(url);
View Full Code Here

    private void updateEnabledStates() {
        Catalog selectedNode = getSelectedCatalog();
        if (selectedNode == null) {
            return;
        }
        CatalogDirectory parent = selectedNode.getParent();
        boolean topLevel = (parent == _rootCatDir);
        boolean editable = (topLevel && !(selectedNode instanceof CatalogDirectory));

        _cutAction.setEnabled(editable);
        _copyAction.setEnabled(!(selectedNode instanceof CatalogDirectory));
View Full Code Here

     *
     * @param cat the entry from the config file
     * @return the catalog directory
     */
    public static CatalogDirectory getDirectory(AstroCatalog cat) {
        CatalogDirectory dir = getConfigFile();
        dir.setName(cat.getName()); // XXX allow more configuration
        return dir;
    }
View Full Code Here

     */
    public Catalog reload() {
        if (this == _configFile) {
            // reload top level config file all subdirs.
            _reloadFlag = true;
            CatalogDirectory catDir = null;
            try {
                // Find and read in AstroCat.xml file to get any changes in the catalog list
                catDir = getConfigFile();
            } finally {
                _reloadFlag = false;
View Full Code Here

TOP

Related Classes of jsky.catalog.CatalogDirectory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.