本文整理汇总了Java中javax.swing.Timer.setCoalesce方法的典型用法代码示例。如果您正苦于以下问题:Java Timer.setCoalesce方法的具体用法?Java Timer.setCoalesce怎么用?Java Timer.setCoalesce使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.Timer
的用法示例。
在下文中一共展示了Timer.setCoalesce方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import javax.swing.Timer; //导入方法依赖的package包/类
private void init() {
setLayout(new BorderLayout());
setBackground(Color.WHITE);
loadLabel.setHorizontalAlignment(SwingConstants.CENTER);
loadLabel.setHorizontalTextPosition(SwingConstants.CENTER);
loadLabel.setVerticalTextPosition(SwingConstants.BOTTOM);
loadLabel.setBackground(Color.WHITE);
add(loadLabel, BorderLayout.CENTER);
tick = new Timer(500, (ActionEvent ae) -> {
repaint();
});
tick.setCoalesce(true);
tick.setRepeats(true);
}
示例2: BarcodeScannerWatcher
import javax.swing.Timer; //导入方法依赖的package包/类
public BarcodeScannerWatcher()
{
queuePush = new Timer(1, null);
queuePush.setCoalesce(true);
queuePush.setRepeats(false);
queuePush.addActionListener(new ActionListener() {
@Override public void actionPerformed(ActionEvent ae) {
timeout();
}
});
applyConfig();
Messenger.register(MT.SCANNER_OPTIONS_CHANGED, new MessageListener() {
@Override public void event(MT type, Object data) {
applyConfig();
}
});
}
示例3: makeVisible
import javax.swing.Timer; //导入方法依赖的package包/类
private synchronized void makeVisible(boolean animate, final boolean top, final Item lastTop) {
if (animationRunning) {
return;
}
int height = top ? preferredHeight - tapPanelMinimumHeight : preferredHeight;
if (!animate) {
setTop(top);
if (top && lastTop != null) {
lastTop.setTop(false);
}
scrollPane.setPreferredSize(new Dimension(0, height));
outerPanel.setPreferredSize(new Dimension(0, height));
scrollPane.setVisible(true);
separator.setVisible(true);
} else {
scrollPane.setPreferredSize(new Dimension(0, 1));
outerPanel.setPreferredSize(new Dimension(0, height));
animationRunning = true;
isTop = top;
if (isTop && lastTop != null) {
lastTop.setTop(false);
}
topGapPanel.setVisible(!isTop);
if (animationRunning) {
scrollPane.setVisible(true);
separator.setVisible(true);
tapPanel.revalidate();
}
if (isTop) {
tapPanel.setBackground(backgroundColor);
}
int delta = 1;
int currHeight = 1;
Timer animationTimer = new Timer(20, null);
animationTimer.addActionListener(new AnimationTimerListener(animationTimer, delta, currHeight));
animationTimer.setCoalesce(false);
animationTimer.start();
} // else
}
示例4: AnnotationSetsView
import javax.swing.Timer; //导入方法依赖的package包/类
public AnnotationSetsView(){
setHandlers = new ArrayList<SetHandler>();
tableRows = new ArrayList<Object>();
visibleAnnotationTypes = new LinkedBlockingQueue<TypeSpec>();
pendingEvents = new LinkedBlockingQueue<GateEvent>();
eventMinder = new Timer(EVENTS_HANDLE_DELAY,
new HandleDocumentEventsAction());
eventMinder.setRepeats(true);
eventMinder.setCoalesce(true);
}
示例5: AutoSlideTrigger
import javax.swing.Timer; //导入方法依赖的package包/类
AutoSlideTrigger() {
super();
slideInTimer = new Timer(200, this);
slideInTimer.setRepeats(true);
slideInTimer.setCoalesce(true);
}
示例6: initGUI
import javax.swing.Timer; //导入方法依赖的package包/类
@Override
protected void initGUI() {
// textView = new JEditorPane();
// textView.setContentType("text/plain");
// textView.setEditorKit(new RawEditorKit());
textView = new JTextArea();
textView.setAutoscrolls(false);
textView.setLineWrap(true);
textView.setWrapStyleWord(true);
// the selection is hidden when the focus is lost for some system
// like Linux, so we make sure it stays
// it is needed when doing a selection in the search textfield
textView.setCaret(new PermanentSelectionCaret());
scroller = new JScrollPane(textView);
textView.setText(document.getContent().toString());
textView.getDocument().addDocumentListener(swingDocListener);
// display and put the caret at the beginning of the file
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
if(textView.modelToView(0) != null) {
textView.scrollRectToVisible(textView.modelToView(0));
}
textView.select(0, 0);
textView.requestFocus();
} catch(BadLocationException e) {
e.printStackTrace();
}
}
});
// contentPane = new JPanel(new BorderLayout());
// contentPane.add(scroller, BorderLayout.CENTER);
// //get a pointer to the annotation list view used to display
// //the highlighted annotations
// Iterator horizViewsIter = owner.getHorizontalViews().iterator();
// while(annotationListView == null && horizViewsIter.hasNext()){
// DocumentView aView = (DocumentView)horizViewsIter.next();
// if(aView instanceof AnnotationListView)
// annotationListView = (AnnotationListView)aView;
// }
highlightsMinder = new Timer(BLINK_DELAY, new UpdateHighlightsAction());
highlightsMinder.setInitialDelay(HIGHLIGHT_DELAY);
highlightsMinder.setDelay(BLINK_DELAY);
highlightsMinder.setRepeats(true);
highlightsMinder.setCoalesce(true);
highlightsMinder.start();
// blinker = new Timer(this.getClass().getCanonicalName() +
// "_blink_timer",
// true);
// final BlinkAction blinkAction = new BlinkAction();
// blinker.scheduleAtFixedRate(new TimerTask(){
// public void run() {
// blinkAction.actionPerformed(null);
// }
// }, 0, BLINK_DELAY);
initListeners();
}