/** Start/stop autoupdating if needed */ private void checkAutoUpdate() { // bumping up the timestamp will stop any previous threads timestamp++; if (animationInfo.getAnimationSetInfo().usingCurrentTime()) { Misc.run( new Runnable() { public void run() { updateAnimationSet(++timestamp); } }); } }
/** * Process the given list of {@link PropertiedAction}s. * * @param actions The list of actions to process */ protected void handleActions(final List actions) { // Run the call in another thread. For now use the ChooserRunnable. This // really does nothing but is a hook for when we have cancel // load, etc, functionality Misc.run( new ChooserRunnable(this) { public void run() { showWaitCursor(); try { handleActionsInThread(actions); } catch (Exception exc) { logException("Creating data source", exc); } showNormalCursor(); if (getCanceled()) {} } }); }
/** * Disable/enable any components that depend on the server. Try to update the status labelwith * what we know here. */ protected void updateStatus() { super.updateStatus(); // Put this in a thread to fix the enabled but shown // as disabled bug Misc.run( new Runnable() { public void run() { enableComps(); } }); if (state != STATE_CONNECTED) { clearTimesList(); } if (state == STATE_UNCONNECTED) { setStatus("Please connect to the server", "connect"); } else if (state == STATE_CONNECTING) { setStatus("Connecting to server: " + getServer()); } else if (getGoodToGo()) { setStatus( "Press \"" + CMD_LOAD + "\" to load the selected " + getDataName().toLowerCase(), "buttons"); } else if (getState() == STATE_CONNECTED) { if (usingStations() && (stationMap.getStations().size() > 0) && (getSelectedStations().size() == 0)) { if (stationMap.getMultipleSelect()) { setStatus("Please select one or more stations", "stations"); } else { setStatus("Please select a station", "stations"); } if (stationMap.getDeclutter()) { // setStatus( // getStatusLabel().getText(), "stations"); } } else if (!haveTimeSelected()) { setStatus(MSG_TIMES); } } setHaveData(getGoodToGo()); }
/** Reload the current xml and update the display. */ public void doUpdate() { if (okToDoUrlListEvents) { Misc.run(this, "doUpdateInner"); } }
/** Update the selector. Call handleUpdate in a thread */ public final void doUpdate() { Misc.run(this, "handleUpdateFromThread"); }
/** Connect to the server. Call handleConnect in a thread */ protected final void doConnect() { Misc.run(this, "handleConnectFromThread"); }