Package jsky.catalog

Examples of jsky.catalog.Catalog


    /** Set the window used to display images (from image servers, etc...). */
    public void setImageDisplay(MainImageDisplay im) {
        _imageDisplay = im;
        updateImageButtonStates();
        Catalog catalog = getCatalog();
        if (catalog != null && !catalog.isLocal()) {
            setFromImage(catalog.isImageServer(), false);
        }
    }
View Full Code Here


    private void _nodeSelected() {
        if (_ignoreSelection) {
            return;
        }

        Catalog cat = getSelectedCatalog();
        if (cat == null) {
            return;
        }

        if (cat == _rootCatDir) {
View Full Code Here

     * Add the given query result to the tree at the currently selected node.
     *
     * @param queryResult the query result
     */
    public void addQueryResult(QueryResult queryResult) {
        Catalog selectedCatalog = getSelectedCatalog();
        if (selectedCatalog == null) {
            setQueryResult(queryResult);
        } else {
            _addQueryResult(selectedCatalog, queryResult);
        }
View Full Code Here

            // 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

    }

    // This method is called when a tree node is selected to update the
    // enabled states of the actions defined in this class.
    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

    /**
     * Cut the selected catalog to the clipboard.
     */
    private void _cut() {
        Catalog selectedNode = getSelectedCatalog();
        if (selectedNode == null) {
            return;
        }

        ClipboardHelper.setClipboard(selectedNode);
View Full Code Here

    /**
     * Copy the selected catalog to the clipboard.
     */
    private void _copy() {
        Catalog selectedNode = getSelectedCatalog();
        if (selectedNode == null) {
            return;
        }
        ClipboardHelper.setClipboard(selectedNode);
    }
View Full Code Here

     * Paste the selected catalog from the clipboard.
     */
    private void _paste() {
        Object o = ClipboardHelper.getClipboard();
        if (o instanceof Catalog) {
            Catalog cat = (Catalog) o;
            _rootCatDir.addCatalog(0, cat);
            _rootCatDir.save();
            _updateTreeModel();
        } else {
            if (o == null) {
View Full Code Here

    /**
     * Add the selected catalog to the favorites list
     */
    private void _addToFavorites() {
        Catalog selectedCatalog = getSelectedCatalog();
        if (selectedCatalog == null) {
            return;
        }
        _rootCatDir.addCatalog(0, selectedCatalog);
        _rootCatDir.save();
View Full Code Here

    /**
     * Refresh the selected catalog or catalog directory (reload, discarding
     * any cached information)
     */
    private void _refreshSelected() {
        final Catalog selectedCatalog = getSelectedCatalog();
        if (selectedCatalog == _rootCatDir) {
            _reload();
            return;
        }
        // Run in a background thread, since it can hang
        new SwingWorker() {
            public Object construct() {
                try {
                    return selectedCatalog.reload();
                } catch (Exception e) {
                    return e;
                }
            }

            public void finished() {
                Object o = getValue();
                if (o instanceof Catalog) {
                    Catalog cat = (Catalog) o;
                    selectedCatalog.getParent().replaceCatalog(selectedCatalog, cat);
                    setQueryResult(_rootCatDir);
                    setSelectedCatalog(cat, false);
                } else if (o instanceof Exception) {
                    DialogUtil.error((Exception) o);
View Full Code Here

TOP

Related Classes of jsky.catalog.Catalog

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.