use of javax.swing.Timer in project screenbird by adamhub.
the class Recorder method compileAudio.
/**
* Compiles the audio recordings.
*/
public synchronized void compileAudio() {
waitingForAudio = true;
java.util.Timer timer = new java.util.Timer("Compile Audio Timer");
timer.schedule(new TimerTask() {
public void run() {
audioRecorder.compileAudio(getWav());
waitingForAudio = false;
}
}, 3000);
}
use of javax.swing.Timer in project EnrichmentMapApp by BaderLab.
the class ControlPanelMediator method filterNodesAndEdges.
private void filterNodesAndEdges(EMViewControlPanel viewPanel, EnrichmentMap map) {
CyNetworkView netView = viewPanel.getNetworkView();
Timer timer = filterTimers.get(netView);
if (timer == null) {
timer = new Timer(0, new FilterActionListener(viewPanel, map, netView));
timer.setRepeats(false);
timer.setCoalesce(true);
filterTimers.put(netView, timer);
} else {
for (ActionListener listener : timer.getActionListeners()) {
if (listener instanceof FilterActionListener)
((FilterActionListener) listener).cancel();
}
timer.stop();
}
timer.setInitialDelay(250);
timer.start();
}
use of javax.swing.Timer in project ACS by ACS-Community.
the class Manager method initializeGUI.
/**
* Initialize GUI.
*/
public void initializeGUI() {
setSize(320, 200);
setLayout(new GridBagLayout());
setTitle("ACS Manager");
add(getRequestsProgressBar(), new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(40, 40, 40, 40), 0, 0));
guiUpdaterTimer = new Timer(GUI_UPDATE_INTERVAL, new GUIUpdater());
guiUpdaterTimer.start();
setLocationByPlatform(true);
setVisible(true);
toFront();
addWindowListener(new WindowListener() {
/* (non-Javadoc)
* @see java.awt.event.WindowListener#windowActivated(java.awt.event.WindowEvent)
*/
public void windowActivated(WindowEvent event) {
}
/* (non-Javadoc)
* @see java.awt.event.WindowListener#windowClosed(java.awt.event.WindowEvent)
*/
public void windowClosed(WindowEvent event) {
}
/* (non-Javadoc)
* @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
*/
public void windowClosing(WindowEvent event) {
destroy();
}
/* (non-Javadoc)
* @see java.awt.event.WindowListener#windowDeactivated(java.awt.event.WindowEvent)
*/
public void windowDeactivated(WindowEvent event) {
}
/* (non-Javadoc)
* @see java.awt.event.WindowListener#windowDeiconified(java.awt.event.WindowEvent)
*/
public void windowDeiconified(WindowEvent event) {
}
/* (non-Javadoc)
* @see java.awt.event.WindowListener#windowIconified(java.awt.event.WindowEvent)
*/
public void windowIconified(WindowEvent event) {
}
/* (non-Javadoc)
* @see java.awt.event.WindowListener#windowOpened(java.awt.event.WindowEvent)
*/
public void windowOpened(WindowEvent event) {
}
});
}
use of javax.swing.Timer in project adempiere by adempiere.
the class Waiting method init.
// Waiting
/**
* Common Initialize routine - does not create if timer == 1
* @param text Message to be displayed
* @param canNotWait user can continue with other work
* @param timer timer ticks (seconds) - if less than 5 then 10
*/
private void init(String text, boolean canNotWait, int timer) {
log.fine(text + " - Sec=" + timer);
// don't show if 1 sec average
if (timer == 1)
return;
try {
jbInit();
setText(text);
if (!canNotWait)
bDoNotWait.setVisible(false);
} catch (Exception e) {
log.log(Level.SEVERE, "Waiting", e);
}
// set progress Bar
progressBar.setMinimum(0);
// min 2 seconds
progressBar.setMaximum(timer < 5 ? 10 : timer);
// Timer
// every second
m_timer = new Timer(1000, this);
m_timer.start();
AEnv.showCenterWindow(getOwner(), this);
}
use of javax.swing.Timer in project adempiere by adempiere.
the class AGlassPane method setBusyTimer.
// getMessage
/**************************************************************************
* Set and start Busy Counter if over 2 seconds
* @param time in seconds
*/
public void setBusyTimer(int time) {
log.config("Time=" + time);
// should we display a progress bar?
if (time < 2) {
m_timermax = 0;
if (isVisible())
repaint();
return;
}
m_timermax = time;
m_timervalue = 0;
// Start Timer
if (m_timer == null) {
// every second
m_timer = new Timer(1000, this);
}
m_timer.start();
if (!isVisible())
setVisible(true);
repaint();
}
Aggregations