本文整理汇总了Java中javax.swing.Timer.stop方法的典型用法代码示例。如果您正苦于以下问题:Java Timer.stop方法的具体用法?Java Timer.stop怎么用?Java Timer.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.Timer
的用法示例。
在下文中一共展示了Timer.stop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import javax.swing.Timer; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent evt) {
ActionListener src = (ActionListener)ref.get();
if (src != null) {
src.actionPerformed(evt);
} else { // source listener was garbage collected
if (evt.getSource() instanceof Timer) {
Timer timer = (Timer)evt.getSource();
timer.removeActionListener(this);
if (stopTimer) {
timer.stop();
}
}
}
}
示例2: SearchHistoryPanel
import javax.swing.Timer; //导入方法依赖的package包/类
/** Creates new form SearchHistoryPanel */
public SearchHistoryPanel(File repository, RepositoryInfo info, File [] roots, SearchCriteriaPanel criteria) {
this.roots = roots;
this.repository = repository;
this.info = info;
this.criteria = criteria;
this.diffViewFactory = new SearchHistoryTopComponent.DiffResultsViewFactory();
criteriaVisible = true;
explorerManager = new ExplorerManager ();
initComponents();
initializeFilter();
filterTimer = new Timer(500, this);
filterTimer.setRepeats(false);
filterTimer.stop();
setupComponents();
info.addPropertyChangeListener(list = WeakListeners.propertyChange(this, info));
aquaBackgroundWorkaround();
refreshComponents(true);
}
示例3: SearchHistoryPanel
import javax.swing.Timer; //导入方法依赖的package包/类
/** Creates new form SearchHistoryPanel */
public SearchHistoryPanel(File [] roots, SearchCriteriaPanel criteria) {
this.roots = roots;
this.repositoryUrl = null;
this.criteria = criteria;
this.diffViewFactory = new SearchHistoryTopComponent.DiffResultsViewFactory();
criteriaVisible = true;
explorerManager = new ExplorerManager ();
initComponents();
initializeFilter();
filterTimer = new Timer(500, this);
filterTimer.setRepeats(false);
filterTimer.stop();
aquaBackgroundWorkaround();
setupComponents();
refreshComponents(true);
}
示例4: SearchHistoryPanel
import javax.swing.Timer; //导入方法依赖的package包/类
/** Creates new form SearchHistoryPanel */
public SearchHistoryPanel(File [] roots, SearchCriteriaPanel criteria) {
this.bOutSearch = false;
this.bIncomingSearch = false;
this.roots = roots;
this.criteria = criteria;
this.diffViewFactory = new SearchHistoryTopComponent.DiffResultsViewFactory();
criteriaVisible = true;
explorerManager = new ExplorerManager ();
initComponents();
initializeFilter();
filterTimer = new Timer(500, this);
filterTimer.setRepeats(false);
filterTimer.stop();
setupComponents();
aquaBackgroundWorkaround();
refreshComponents(true);
}
示例5: BranchSelector
import javax.swing.Timer; //导入方法依赖的package包/类
public BranchSelector (File repository) {
this.repository = repository;
panel = new BranchSelectorPanel();
panel.branchList.setCellRenderer(new RevisionRenderer());
filterTimer = new Timer(300, new ActionListener() {
@Override
public void actionPerformed (ActionEvent e) {
filterTimer.stop();
applyFilter();
}
});
panel.txtFilter.getDocument().addDocumentListener(this);
panel.branchList.addListSelectionListener(this);
panel.jPanel1.setVisible(false);
cancelButton = new JButton();
org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(BranchSelector.class, "CTL_BranchSelector_Action_Cancel")); // NOI18N
cancelButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSD_BranchSelector_Action_Cancel")); // NOI18N
cancelButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BranchSelector.class, "ACSN_BranchSelector_Action_Cancel")); // NOI18N
}
示例6: animacion
import javax.swing.Timer; //导入方法依赖的package包/类
/**
* Animacion de explosion para el enemigo
* @param enemy referencia al enemigo
*/
private void animacion(final Enemy enemy){
cont = 0;
timer = new Timer(0, new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
if(timer.getDelay()==0){
timer.setDelay(700);
}
cont += timer.getDelay();
enemy.getEnemy().setIcon(icon);
icon.getImage().flush();
if(cont == 1400){
enemy.getEnemy().setVisible(false);
enemy.getEnemy().setLocation(-600, 0);
timer.stop();
}
}
});
timer.start();
}
示例7: NotificationCenterTopComponent
import javax.swing.Timer; //导入方法依赖的package包/类
public NotificationCenterTopComponent() {
notificationManager = NotificationCenterManager.getInstance();
filterCallback = new QuickFilterCallback();
tableRefreshTimer = new Timer(TABLE_REFRESH_PERIOD, new RefreshTimerListener());
tableRefreshTimer.stop();
tableKeyListener = new TableKeyListener();
italicFont = new JLabel().getFont().deriveFont(Font.ITALIC);
setName(NbBundle.getMessage(NotificationCenterTopComponent.class, "CTL_NotificationCenterTopComponent"));
setToolTipText(NbBundle.getMessage(NotificationCenterTopComponent.class, "HINT_NotificationCenterTopComponent"));
}
示例8: setupProgress
import javax.swing.Timer; //导入方法依赖的package包/类
private void setupProgress() {
setIcon(createProgressIcon());
t = new Timer(100, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Component comp = refComp.get();
TreeListNode nd = refNode.get();
if (nd == null && comp == null) {
t.stop();
Container p = getParent();
if (p != null) {
p.remove(ProgressLabel.this);
}
} else {
busyIcon.tick();
ProgressLabel.this.repaint();
if (nd != null) {
nd.fireContentChanged();
} else {
comp.repaint();
}
}
}
});
t.setRepeats(true);
super.setVisible(false);
}
示例9: SelectUriStep
import javax.swing.Timer; //导入方法依赖的package包/类
public SelectUriStep (File repositoryFile, Map<String, GitRemoteConfig> remotes, Mode mode) {
this.repositoryFile = repositoryFile;
this.repository = new RemoteRepository(null);
this.panel = new SelectUriPanel(repository.getPanel());
this.remotes = remotes;
this.inputFields = new JComponent[] {
panel.cmbConfiguredRepositories,
panel.rbConfiguredUri,
panel.rbCreateNew,
panel.lblRemoteNames,
panel.cbPersistRemote,
panel.cmbRemoteNames
};
this.mode = mode;
remoteNameEditTimer = new Timer(300, this);
remoteNameEditTimer.setRepeats(false);
remoteNameEditTimer.stop();
fillPanel();
attachListeners();
Mutex.EVENT.readAccess(new Runnable() {
@Override
public void run () {
enableFields();
validateBeforeNext();
}
});
}
示例10: cleanAndCheckTTV
import javax.swing.Timer; //导入方法依赖的package包/类
private void cleanAndCheckTTV () {
// make nodes and props gc'able
replaceTTVContent();
nodeStructure = null;
props = null;
// assure that weak hash map cache in TreeViewCell is busy a bit,
// so that it really releases refs to its values
repaintTimer = new Timer(1000, new ActionListener () {
public void actionPerformed (ActionEvent evt) {
if (repaintCount < 10) {
ep.invalidate();
ep.validate();
ep.repaint();
repaintCount++;
// test if nodes were released correctly
// invokeLater so that it comes really after explorer
// panel repaint
SwingUtilities.invokeLater(new Runnable() {
public void run() {
System.gc();
repaintTimer.stop();
result = repaintCount;
// wake up testNodeReleasing method, so that it can finish properly
synchronized (TTVTest.this) {
TTVTest.this.notifyAll();
}
}
});
} else {
repaintTimer.stop();
result = -1;
// wake up testNodeReleasing method, so that it can finish properly
synchronized (TTVTest.this) {
TTVTest.this.notifyAll();
}
}
}
});
repaintTimer.start();
}
示例11: PatchNameListener
import javax.swing.Timer; //导入方法依赖的package包/类
private PatchNameListener (ShelveChangesPanel panel, JButton okButton, Dialog dialog) {
this.panel = panel;
this.button = okButton;
this.dialog = dialog;
timer = new Timer(300, this);
timer.stop();
}
示例12: cancelDblClick
import javax.swing.Timer; //导入方法依赖的package包/类
private void cancelDblClick () {
Timer t = dblClickTimer;
if (t != null) {
t.stop();
dblClickTimer = null;
}
}
示例13: TagManager
import javax.swing.Timer; //导入方法依赖的package包/类
TagManager (File repository) {
this.repository = repository;
this.panel = new TagManagerPanel();
panel.tagList.setCellRenderer(new TagRenderer());
filterTimer = new Timer(300, new ActionListener() {
@Override
public void actionPerformed (ActionEvent e) {
filterTimer.stop();
applyFilter();
}
});
attachListeners();
}
示例14: showFrame
import javax.swing.Timer; //导入方法依赖的package包/类
/**
* 显示窗体
*/
public void showFrame()
{
this.setAlwaysOnTop(true);
if(chat==null)
btn打开.setVisible(false);
int width=350;
int height=266;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(screenSize.width-width-3,screenSize.height,width,height);
setVisible(true);
Timer timer=new Timer(10, new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
setLocation(getLocation().x, getLocation().y-10);
}
});
timer.start();
while(true)
{
// 25表示任务栏的高度,好奇怪,有的电脑注释掉下面的输出语句就会出现弹窗不停止的奇怪现象
System.out.println("当前高度:"+getLocation().y+",屏幕高度:"+screenSize.height);
if(getLocation().y+height<screenSize.height-25)
{
timer.stop();
break;
}
}
}
示例15: sendCommand
import javax.swing.Timer; //导入方法依赖的package包/类
private void sendCommand(byte[] packet) {
try {
if (packet[2] != (byte) 254) {
//log.info("starting time for timeout of status packet.");
timeoutTimer = new Timer(1000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
log.warning("Error: Timeout while waiting for Status packet from Servos!!!");
waitingForStatusPacket = false;
timeoutTimer.stop();
if (isCheckMovement) {
log.info("Restarting to check movement!");
btnCheckMovingActionPerformed(null);
}
}
});
timeoutTimer.start();
waitingForStatusPacket = true;
}
this.out.write(packet);
String test3 = "command: ";
for (byte element : packet) {
test3 += " " + (element & 0xFF);
}
log.info("Send to RS232: " + test3);
} catch (IOException ex) {
log.warning("In command(...) caught IOexception " + ex);
}
}