private LoadDataTask() { UJMPTimer.newInstance("LoadData").schedule(this, 50, 50); }
private UpdateIconTimerTask() { UJMPTimer.newInstance("UpdateIcon").schedule(this, 300, 300); }
public AutoCloseConnection(final Connection c, final int maxIdleTime, final long checkInterval) { this.connection = c; timerTask = new TimerTask() { @Override public void run() { try { if (connection != null && !connection.isClosed()) { long idleTime = System.currentTimeMillis() - lastAccessTime; if (idleTime >= maxIdleTime) { System.out.println("closing connection after " + idleTime + " ms"); close(); } } } catch (Exception e) { } } }; timer = UJMPTimer.newInstance("AutoCloseConnection"); timer.schedule(timerTask, checkInterval, checkInterval); }
public AutoCloseConnection(final Connection c, final int maxIdleTime, final long checkInterval) { this.connection = c; timerTask = new TimerTask() { @Override public void run() { try { if (connection != null && !connection.isClosed()) { long idleTime = System.currentTimeMillis() - lastAccessTime; if (idleTime >= maxIdleTime) { System.out.println("closing connection after " + idleTime + " ms"); close(); } } } catch (Exception e) { } } }; timer = UJMPTimer.newInstance("AutoCloseConnection"); timer.schedule(timerTask, checkInterval, checkInterval); }
public MemoryUsage() { setBorder(BorderFactory.createEtchedBorder()); setMinimumSize(new Dimension(50, 30)); timer = UJMPTimer.newInstance(this.getClass().getSimpleName()); timer.schedule(new UpdateTask(this), 0, 1000); }
public SystemTimeMatrix() { super(1, 1); setLabel("System Time"); setColumnLabel(0, "System.currentTimeMillis()"); matrix = this; timer = UJMPTimer.newInstance(this.getClass().getSimpleName()); timer.schedule(task, 1000, 1000); }
public StatusBar(GUIObject o) { this.guiObject = o; this.setPreferredSize(new Dimension(1000, 30)); this.setBorder(BorderFactory.createEtchedBorder()); this.setLayout(new GridBagLayout()); statusLabel.setPreferredSize(new Dimension(2000, 30)); statusLabel.setMinimumSize(new Dimension(200, 30)); add(statusLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); add(new MemoryUsage(), new GridBagConstraints(3, 0, 1, 1, 0.0, 1.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); jProgressBar.setStringPainted(false); jProgressBar.setMinimum(0); jProgressBar.setMaximum(1000); jProgressBar.setValue(1000); jProgressBar.setVisible(false); statusLabel.setBorder(BorderFactory.createEtchedBorder()); jProgressBar.setBorder(BorderFactory.createEtchedBorder()); add(jProgressBar, new GridBagConstraints(1, 0, 1, 1, 0.8, 1.0, GridBagConstraints.EAST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); timer = UJMPTimer.newInstance("StatusBar "+guiObject.getCoreObject().getClass().getSimpleName()); timer.schedule(new UpdateTask(this), 200, 200); }
public OperatingSystemMatrix() { super(6, 1); setLabel("Operating System"); setRowLabel(0, "Arch"); setRowLabel(1, "AvailableProcessors"); setRowLabel(2, "Name"); setRowLabel(3, "ObjectName"); setRowLabel(4, "SystemLoadAverage"); setRowLabel(5, "Version"); matrix = this; os = ManagementFactory.getOperatingSystemMXBean(); timer = UJMPTimer.newInstance(this.getClass().getSimpleName()); timer.schedule(task, 1000, 1000); }
timer = UJMPTimer.newInstance("FrameUpdate "+guiObject.getCoreObject().getClass().getSimpleName()); timer.schedule(updateTask, 500, 500);
timer = UJMPTimer.newInstance(this.getClass().getSimpleName()); timer.schedule(task, 1000, 1000);