javax.swing.ProgressMonitor.setMillisToDecideToPopup()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中javax.swing.ProgressMonitor.setMillisToDecideToPopup()方法的一些代码示例,展示了ProgressMonitor.setMillisToDecideToPopup()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProgressMonitor.setMillisToDecideToPopup()方法的具体详情如下:
包路径:javax.swing.ProgressMonitor
类名称:ProgressMonitor
方法名:setMillisToDecideToPopup

ProgressMonitor.setMillisToDecideToPopup介绍

暂无

代码示例

代码示例来源:origin: igvteam/igv

public static void main(String[] args) throws MalformedURLException {
  URL url = HttpUtils.createURL(args[0]);
  String localFile = args[1];
  JComponent frame = null;
  String message = "Downloading " + url.toString();
  int min = 0;
  int max = 100;
  final javax.swing.ProgressMonitor monitor = new javax.swing.ProgressMonitor(frame, message, "", min, max);
  monitor.setMillisToDecideToPopup(100);
  Downloader dl = new Downloader(url, new File(localFile), monitor);
  (new Thread(dl)).start();
}

代码示例来源:origin: stackoverflow.com

// using a File just for demonstration / testing
  File f = new File("a");
  try (InputStream stream = new FileInputStream(f)) {
   ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(null, "Downloading...", stream);
   int downloadSize = f.length();
   ProgressMonitor pm = pmis.getProgressMonitor();
   pm.setMillisToDecideToPopup(0);
   pm.setMillisToPopup(0);
   // tell the progress bar that we start at the beginning of the stream
   pm.setMinimum(0);
   // tell the progress bar the total number of bytes we are going to read.    
   pm.setMaximum(downloadSize);
   copyInputStreamToFile(pmis, new File("/tmp/b"));
  }

代码示例来源:origin: org.cytoscape/network-analyzer-impl

int maxProgress = analyzer.getMaxProgress();
monitor = new ProgressMonitor(owner, Messages.DT_ANALYZING, null, 0, maxProgress);
monitor.setMillisToDecideToPopup(1500);
timer = new Timer(1000, this);

代码示例来源:origin: net.sf.taverna.t2.ui-activities/dataflow-activity-ui

public void actionPerformed(ActionEvent e) {
  /*if (e.getSource() instanceof Component) {
    parentComponent = (Component) e.getSource();
  } else {
    parentComponent = null;
  }*/
  parentComponent = MainWindow.getMainWindow();
  Thread t = new Thread(this, "Import workflow");
  progressMonitor = new ProgressMonitor(parentComponent,
      "Importing workflow", "", 0, 100);
  progressMonitor.setMillisToDecideToPopup(200);
  progressMonitor.setProgress(5);
  t.start();
  setVisible(false);
}

代码示例来源:origin: cytoscape.coreplugins/rfilters

pm.setMillisToDecideToPopup(500);
pm.setMillisToPopup(2000);

代码示例来源:origin: MinecraftForge/Installer

monitor.setMillisToDecideToPopup(0);

代码示例来源:origin: igvteam/igv

/**
 * Convenience method.  Download the resource at url to the local file.
 *
 * @param url
 * @param localFile
 * @param frame
 * @return  true for completed download, false if canceled.
 * @throws MalformedURLException
 */
public static boolean download(URL url, File localFile, Component frame) throws MalformedURLException {
  String message = "Downloading " + url.toString();
  int min = 0;
  int max = 100;
  final javax.swing.ProgressMonitor monitor;
  if(IGV.hasInstance()) {
    monitor = new javax.swing.ProgressMonitor(frame, message, "", min, max);
    monitor.setMillisToDecideToPopup(100);
  } else {
    monitor = null;
  }
  final Downloader downloader = new Downloader(url, localFile, monitor);
  downloader.run();
  return downloader.canceled == false;
}

代码示例来源:origin: org.icepdf.os/icepdf-viewer

"", 0, textExtractionTask.getLengthOfTask());
progressMonitor.setProgress(0);
progressMonitor.setMillisToDecideToPopup(0);

代码示例来源:origin: stackoverflow.com

progressMonitor.setMillisToDecideToPopup(0);
progressMonitor.setProgress(0);
AccessibleContext ac = progressMonitor.getAccessibleContext();

代码示例来源:origin: stackoverflow.com

monitor.setProgress(0);
monitor.setMillisToPopup(0);
monitor.setMillisToDecideToPopup(0);
XmlWorker worker = new XmlWorker();
worker.addPropertyChangeListener(listener);

代码示例来源:origin: LibraryOfCongress/bagger

public void statusBarBegin(Progress progress, String message, String activityMonitored) {
 BusyIndicator.showAt(Application.instance().getActiveWindow().getControl());
 task = new LongTask();
 task.setActivityMonitored(activityMonitored);
 task.setProgress(progress);
 timer.addActionListener(new TimerListener());
 progressMonitor = new ProgressMonitor(this.getControl(), message, "Preparing the operation...", 0, 1);
 progressMonitor.setMillisToDecideToPopup(ONE_SECOND);
 task.setMonitor(progressMonitor);
 task.go();
 timer.start();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

progressMonitor.setMillisToDecideToPopup(0);
if (progress != -1) {
  progressMonitor.setProgress(progress);

代码示例来源:origin: cytoscape/application

/**
   * It creates and initializes a progress monitor.
   */
  protected void initializeMonitor() {
    String message = monitoredTask.getTaskName();
    pMonitor = new ProgressMonitor(this.parentComponent, new Object[] { message }, null, 0,
                    monitoredTask.getLengthOfTask());

    CyLogger.getLogger().info("Task length: " + monitoredTask.getLengthOfTask());
    CyLogger.getLogger().info("About to Popup");
    pMonitor.setProgress(0);
    pMonitor.setMillisToDecideToPopup(0);
    pMonitor.setMillisToPopup(0);
  } //initializeMonitor
} //CytoscapeProgressMonitor class

代码示例来源:origin: cmu-phil/tetrad

public void doLayout() {
  GraphUtils.circleLayout(graph, 300, 300, 200);
  this.monitor = new ProgressMonitor(null, "Energy settling...",
      "Energy = ?", 0, 100);
  getMonitor().setMillisToDecideToPopup(10);
  getMonitor().setMillisToPopup(0);
  getMonitor().setProgress(0);
  List<List<Node>> components =
      GraphUtils.connectedComponents(this.graph);
  Collections.sort(components, new Comparator<List<Node>>() {
    public int compare(List<Node> o1, List<Node> o2) {
      int i1 = o1.size();
      int i2 = o2.size();
      return i2 < i1 ? -1 : i2 == i1 ? 0 : 1;
    }
  });
  for (List<Node> component1 : components) {
    initialize(component1, isRandomlyInitialized());
    layoutComponent(component1);
  }
  getMonitor().setProgress(100);
}

代码示例来源:origin: org.apache.uima/uimaj-tools

progressMonitor.setNote(initial);
progressMonitor.setMillisToPopup(-1);
progressMonitor.setMillisToDecideToPopup(-1);
numDocsProcessed = 0;
progressTimer.start();

相关文章