All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uk.ac.starlink.table.gui.TableLoadClient Maven / Gradle / Ivy

There is a newer version: 4.3
Show newest version
package uk.ac.starlink.table.gui;

import uk.ac.starlink.table.StarTable;
import uk.ac.starlink.table.StarTableFactory;

/**
 * Interface for a GUI-based consumer of tables which are being loaded.
 * All its methods are called on the Event Dispatch Thread, and must be
 * called in sequence:
 * 
    *
  1. {@link #startSequence}
  2. *
  3. {@link #setLabel}, {@link #loadSuccess}, {@link #loadFailure} * (any number of times, in any order)
  4. *
  5. {@link #endSequence}
  6. *
* * @author Mark Taylor * @since 13 Sept 2010 */ public interface TableLoadClient { /** * Returns the table factory via which all loaded tables will be produced. * * @return table factory */ StarTableFactory getTableFactory(); /** * Called before any table load attempts are made. */ void startSequence(); /** * Sets a short text string suitable for presenting to the user * to indicate what is being loaded. May be invoked one or more times * during the load sequence. */ void setLabel( String label ); /** * Presents a table which has been successfully loaded. * The return value indicates whether this client is interested in * attempts to load more tables, if there are more. * * @param table loaded table * @return true iff more loadSuccess/loadFailure calls are acceptable */ boolean loadSuccess( StarTable table ); // true if want more /** * Presents a failure which has resulted from a table load attempt. * The return value indicates whether this client is interested in * attempts to load more tables, if there are more. * * @param error error * @return true iff more loadSuccess/loadFailure calls are acceptable */ boolean loadFailure( Throwable error ); /** * Indicates that no more loadSuccess/loadFailure methods will be invoked. * The cancelled argument indicates whether the sequence * finished naturally, or was cancelled by a deliberate act of the user. * * @param cancelled true iff the sequence was cancelled by a user action */ void endSequence( boolean cancelled ); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy