use of javax.swing.Timer in project lotro-companion by dmorcellet.
the class AboutPanelController method buildContributorsPanel.
private JPanel buildContributorsPanel() {
JPanel ret = GuiFactory.buildPanel(null);
final List<JPanel> panels = buildToonPanels();
int maxWidth = 0, maxHeight = 0;
for (JPanel panel : panels) {
Dimension d = panel.getPreferredSize();
int width = d.width;
if (width > maxWidth)
maxWidth = width;
int height = d.height;
if (height > maxHeight)
maxHeight = height;
panel.setSize(d);
panel.setVisible(false);
ret.add(panel);
}
ret.setSize(maxWidth, maxHeight);
ret.setPreferredSize(new Dimension(maxWidth, maxHeight));
JPanel groupPanel = panels.get(panels.size() - 1);
int x = (maxWidth - groupPanel.getWidth()) / 2;
int y = (maxHeight - groupPanel.getHeight()) / 2;
groupPanel.setLocation(x, y);
panels.get(0).setVisible(true);
ActionListener al = new ActionListener() {
private int _index = 0;
@Override
public void actionPerformed(ActionEvent e) {
JPanel oldPanel = panels.get(_index);
oldPanel.setVisible(false);
_index++;
if (_index == panels.size())
_index = 0;
JPanel newPanel = panels.get(_index);
newPanel.setVisible(true);
}
};
_timer = new Timer(3000, al);
_timer.setRepeats(true);
_timer.start();
return ret;
}
use of javax.swing.Timer in project lotro-companion by dmorcellet.
the class FactionStatusEditionPanelController method triggerChartUpdateTimer.
private void triggerChartUpdateTimer() {
if (_updateTimer == null) {
ActionListener updateChart = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
_chart.updateData();
}
};
_updateTimer = new Timer(100, updateChart);
_updateTimer.setRepeats(false);
}
_updateTimer.restart();
}
use of javax.swing.Timer in project lotro-companion by dmorcellet.
the class ProfessionStatusEditionPanelController method triggerChartUpdateTimer.
private void triggerChartUpdateTimer() {
if (_updateTimer == null) {
ActionListener updateChart = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
_chart.updateData();
}
};
_updateTimer = new Timer(100, updateChart);
_updateTimer.setRepeats(false);
}
_updateTimer.restart();
}
use of javax.swing.Timer in project cytoscape-impl by cytoscape.
the class RoundedProgressBar method setIndeterminate.
public void setIndeterminate() {
if (indet)
return;
indet = true;
indetUpdate = new Timer(INDET_UPDATE_MS, new IndetUpdate());
indetUpdate.start();
}
use of javax.swing.Timer in project WorldPainter by Captain-Chaos.
the class Scroller method attach.
public void attach(JScrollBar scrollBar) {
this.scrollBar = scrollBar;
state = State.PAUSING_AT_START;
pauseStart = System.currentTimeMillis();
timer = new Timer(100, this);
timer.start();
}
Aggregations