public void addLogUpload(LogFile logFile) { if (RemoteLogRepositoryBackend.getInstance().isConnected()) { RemoteLogRepositoryBackend.getInstance().enqueueUpload(logFile); JProgressBar jpb = new JProgressBar(); jpb.setStringPainted(true); jpb.setString("Requesting"); this._middlePanel._uploadsPanel.addRow(new JLabel(logFile.getName()), jpb); } }
public void componentShown(ComponentEvent e) { synchronized (this) { // load LogRepository.getInstance(); if (!_localLoaded) { Thread t = new Thread() { public void run() { LogRepository.getInstance().refreshLocalLogs(); LogFilesTab.this.showLocalLogs(); _localLoaded = true; } }; t.start(); } if (RemoteLogRepositoryBackend.getInstance().isConnected() && !_remoteLoaded) { Thread t = new Thread() { public void run() { LogRepository.getInstance().refreshRemoteLogs(); _remoteLoaded = true; } }; t.start(); } } }
public MiddlePanel() { this.setLayout(new GridBagLayout()); GridBagConstraints cons = new GridBagConstraints(); RemoteLogRepositoryBackend.getInstance().setDownloadListener(_downloadsPanel); RemoteLogRepositoryBackend.getInstance().setUploadListener(_uploadsPanel); _inSplitPane.setTopComponent(_downloadsPanel); _inSplitPane.setBottomComponent(_uploadsPanel); _inSplitPane.setResizeWeight(0.5); _outSplitPane.setTopComponent(_logDetailsPane); _outSplitPane.setBottomComponent(_inSplitPane); _outSplitPane.setResizeWeight(0.6); cons.fill = GridBagConstraints.BOTH; cons.weightx = 1.0; cons.weighty = 1.0; this.add(_outSplitPane, cons); }