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

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

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

ProgressMonitor.setMillisToPopup介绍

暂无

代码示例

代码示例来源:origin: skylot/jadx

private void saveAll(boolean export) {
  JFileChooser fileChooser = new JFileChooser();
  fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  fileChooser.setToolTipText(NLS.str("file.save_all_msg"));
  String currentDirectory = settings.getLastSaveFilePath();
  if (!currentDirectory.isEmpty()) {
    fileChooser.setCurrentDirectory(new File(currentDirectory));
  }
  int ret = fileChooser.showDialog(mainPanel, NLS.str("file.select"));
  if (ret == JFileChooser.APPROVE_OPTION) {
    JadxArgs decompilerArgs = wrapper.getArgs();
    decompilerArgs.setExportAsGradleProject(export);
    if (export) {
      decompilerArgs.setSkipSources(false);
      decompilerArgs.setSkipResources(false);
    } else {
      decompilerArgs.setSkipSources(settings.isSkipSources());
      decompilerArgs.setSkipResources(settings.isSkipResources());
    }
    settings.setLastSaveFilePath(fileChooser.getCurrentDirectory().getPath());
    ProgressMonitor progressMonitor = new ProgressMonitor(mainPanel, NLS.str("msg.saving_sources"), "", 0, 100);
    progressMonitor.setMillisToPopup(0);
    wrapper.saveAll(fileChooser.getSelectedFile(), progressMonitor);
  }
}

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

"Loading track..",
    is1);
  pmis.getProgressMonitor().setMillisToPopup(0);
  is2 = pmis;
} else {

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

ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(
  parentComponent, message, inputStream);
ProgressMonitor pm = pmis.getProgressMonitor();
pm.setMillisToPopup(millisToPopup);

代码示例来源:origin: BTCPrivate/bitcoin-private-full-node-wallet

private static boolean checkSHA256(File provingKey, Component parent) throws IOException {
    MessageDigest sha256;
    try {
      sha256 = MessageDigest.getInstance("SHA-256");
    } catch (NoSuchAlgorithmException impossible) {
      throw new IOException(impossible);
    }
    try (InputStream is = new BufferedInputStream(new FileInputStream(provingKey))) {
      ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(parent, LOCAL_MSG_VERIFYING_PROVING_KEY, is);
      pmis.getProgressMonitor().setMaximum(PROVING_KEY_SIZE);
      pmis.getProgressMonitor().setMillisToPopup(10);
      DigestInputStream dis = new DigestInputStream(pmis, sha256);
      byte[] temp = new byte[0x1 << 13];
      while (dis.read(temp) >= 0) ;
      byte[] digest = sha256.digest();
      return PROVING_KEY_SHA256.equalsIgnoreCase(DatatypeConverter.printHexBinary(digest));
    }
  }
}

代码示例来源: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: minio/minio-java

bis);
pmis.getProgressMonitor().setMillisToPopup(10);
minioClient.putObject("bank", "my-objectname", pmis, bis.available(), "application/octet-stream");
System.out.println("my-objectname is uploaded successfully");

代码示例来源:origin: ZencashOfficial/zencash-swing-wallet-ui

private static boolean checkSHA256SG(File sproutGroth, Component parent) throws IOException {
  MessageDigest sha256;
  try {
    sha256 = MessageDigest.getInstance("SHA-256");
  } catch (NoSuchAlgorithmException impossible) {
    throw new IOException(impossible);
  }
  try (InputStream is = new BufferedInputStream(new FileInputStream(sproutGroth))) {
    ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(parent,
        LanguageUtil.instance().getString("sprout.groth.fetcher.option.pane.verify.progress.monitor.text"),
        is);
    pmis.getProgressMonitor().setMaximum(SPROUT_GROTH_SIZE);
    pmis.getProgressMonitor().setMillisToPopup(10);
    DigestInputStream dis = new DigestInputStream(pmis, sha256);
    byte [] temp = new byte[0x1 << 13];
    while(dis.read(temp) >= 0);
    byte [] digest = sha256.digest();
    return SHA256SG.equalsIgnoreCase(DatatypeConverter.printHexBinary(digest));
  }
}

代码示例来源:origin: ZencashOfficial/zencash-swing-wallet-ui

private static boolean checkSHA256(File provingKey, Component parent) throws IOException {
  MessageDigest sha256;
  try {
    sha256 = MessageDigest.getInstance("SHA-256");
  } catch (NoSuchAlgorithmException impossible) {
    throw new IOException(impossible);
  }
  try (InputStream is = new BufferedInputStream(new FileInputStream(provingKey))) {
    ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(parent,
        LanguageUtil.instance().getString("proving.key.fetcher.option.pane.verify.progress.monitor.text"),
        is);
    pmis.getProgressMonitor().setMaximum(PROVING_KEY_SIZE);
    pmis.getProgressMonitor().setMillisToPopup(10);
    DigestInputStream dis = new DigestInputStream(pmis, sha256);
    byte [] temp = new byte[0x1 << 13];
    while(dis.read(temp) >= 0);
    byte [] digest = sha256.digest();
    return SHA256.equalsIgnoreCase(DatatypeConverter.printHexBinary(digest));
  }
}

代码示例来源:origin: ZencashOfficial/zencash-swing-wallet-ui

private static boolean checkSHA256SS(File saplingSpend, Component parent) throws IOException {
    MessageDigest sha256;
    try {
      sha256 = MessageDigest.getInstance("SHA-256");
    } catch (NoSuchAlgorithmException impossible) {
      throw new IOException(impossible);
    }
    try (InputStream is = new BufferedInputStream(new FileInputStream(saplingSpend))) {
      ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(parent,
          LanguageUtil.instance().getString("sapling.spend.fetcher.option.pane.verify.progress.monitor.text"),
          is);
      pmis.getProgressMonitor().setMaximum(SAPLING_SPEND_SIZE);
      pmis.getProgressMonitor().setMillisToPopup(10);
      DigestInputStream dis = new DigestInputStream(pmis, sha256);
      byte [] temp = new byte[0x1 << 13];
      while(dis.read(temp) >= 0);
      byte [] digest = sha256.digest();
      return SHA256SS.equalsIgnoreCase(DatatypeConverter.printHexBinary(digest));
    }
  }
}

代码示例来源:origin: iTransformers/netTransformer

private void doDiff() {
  progressMonitor = new ProgressMonitor(this,"Running diff tool","", 0, 1000);
  progressMonitor.setMillisToPopup(0);
  new File(getDiffPath3()).mkdirs();
  String path1 = getDiffPath1();
  String path2 = getDiffPath2();
  String path3 = getDiffPath3();
  File path3File = new File (path3);
  File path3Undirected = new File(path3 + File.separator + ProjectConstants.undirectedGraphmlDirName);
  String path3UndirectedNetwork = path3Undirected.getAbsolutePath() + File.separator + ProjectConstants.networkGraphmlFileName;
  if (!path3File.exists()){
    path3File.mkdir();
  }
  if (!path3Undirected.exists()){
    path3Undirected.mkdir();
  }
  if (!path3Undirected.exists()){
    path3Undirected.mkdir();
  }
  task = new GraphMLFileDiffTool(new File(path1),new File(path2),new File(path3UndirectedNetwork), getNodeIgnoredKeysFile(),getEdgeIgnoredKeysFile(), "xmlTopologyViewerConfig/conf/xslt/graphml_diff.xslt");
  task.addPropertyChangeListener(this);
  task.execute();
}

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

pm.setMillisToPopup(2000);

代码示例来源:origin: BTCPrivate/bitcoin-private-full-node-wallet

ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(parent, LOCAL_MSG_DOWNLOADING_PROVING_KEY, is);
pmis.getProgressMonitor().setMaximum(PROVING_KEY_SIZE);
pmis.getProgressMonitor().setMillisToPopup(10);

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

monitor.setMillisToPopup(0);
monitor.setMillisToDecideToPopup(0);

代码示例来源:origin: iTransformers/netTransformer

@Override
protected String performIPSecAction(IPsecPair[] ipsecpair) throws IOException {
  //If this is first run we want to save the old key before generating new ones
  List<String> userInput = firstTimeConfigurationCheck(ipsecpair);
  progressMonitor = new ProgressMonitor(this, "Running routers", "", 0, 100);
  progressMonitor.setMillisToPopup(0);
  worker = new ChangeIPSecKeyWorker(ipsecpair, progressMonitor,userInput);
  worker.addPropertyChangeListener(this);
  worker.execute();
  return "";
}

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

bis);
pmis.getProgressMonitor().setMillisToPopup(10);
baos = new BufferedOutputStream(new FileOutputStream("..."));

代码示例来源:origin: MarginallyClever/Makelangelo-software

/**
 * Load and convert the image in the chosen style
 * @return false if loading cancelled or failed.
 */
@Override
public boolean load(InputStream in,MakelangeloRobot robot) {
  try {
    img = new TransformedImage( ImageIO.read(in) );
  } catch (IOException e1) {
    e1.printStackTrace();
    return false;
  }
  
  chosenRobot = robot;
  switch(getPreferredFillStyle()) {
    case 0:  scaleToFillPaper();  break;
    case 1:  scaleToFitPaper();  break;
    default: break;
  }
  
  pm = new ProgressMonitor(null, Translator.get("Converting"), "", 0, 100);
  pm.setProgress(0);
  pm.setMillisToPopup(0);
  
  chooseImageConversionOptions(robot);
  
  return true;
}

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

monitor = new ProgressMonitor(labelComponent.getTopLevelAncestor(), "Loading XML", "", 0, 100);
monitor.setProgress(0);
monitor.setMillisToPopup(0);
monitor.setMillisToDecideToPopup(0);
XmlWorker worker = new XmlWorker();

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

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

代码示例来源: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);
}

相关文章