當前位置: 首頁>>代碼示例>>Java>>正文


Java ProgressMonitor.setMillisToPopup方法代碼示例

本文整理匯總了Java中javax.swing.ProgressMonitor.setMillisToPopup方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressMonitor.setMillisToPopup方法的具體用法?Java ProgressMonitor.setMillisToPopup怎麽用?Java ProgressMonitor.setMillisToPopup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.ProgressMonitor的用法示例。


在下文中一共展示了ProgressMonitor.setMillisToPopup方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doInBackground

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
@Override
public Void doInBackground() {
	String rawString = configManager.getRawString();
	try {
		stream = new ProgressMonitorInputStream(null, (Object) "Flashing",
				new ByteArrayInputStream(rawString
						.getBytes(HacklaceConfigManager.HACKLACE_CHARSET)));
		ProgressMonitor progressMonitor = stream.getProgressMonitor();
		progressMonitor.setMaximum(rawString.length());
		progressMonitor.setProgress(0);
		progressMonitor.setMillisToPopup(0);
		animatorGui.setCursor(Cursor
				.getPredefinedCursor(Cursor.WAIT_CURSOR));
		flashExporter.write(stream);
	} catch (Exception ex) {
		JOptionPane.showMessageDialog(null, "Error flashing hacklace: "
				+ ex, "Error", JOptionPane.ERROR_MESSAGE);
	}
	return null;
}
 
開發者ID:Twissi,項目名稱:Animator,代碼行數:21,代碼來源:FlashThread.java

示例2: construct

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
@Override
public Object construct() {

	ProgressMonitor pm = new ProgressMonitor(own, msg, "", 0, max);

	pm.setMillisToDecideToPopup(0);
	pm.setMillisToPopup(0);
	pm.setProgress(0);

	return pm;
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:12,代碼來源:LoadPanel.java

示例3: SkelGen

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
public SkelGen( List<Line> footprint, Tweed tweed, BlockGen blockGen ) {
	super( "model", tweed );
	this.footprint = footprint;
	this.blockGen = blockGen;
	skelFootprint = new SkelFootprint(tweed);
	
	ProgressMonitor m = new ProgressMonitor( tweed.frame(), "Optimizing", "", 0, 100 );

	m.setProgress( 1 );
	m.setMillisToPopup( 0 );
	
	new Thread( () -> { 
		optimize(m);
		SkelGen.this.calculateOnJmeThread(); } ).start();
}
 
開發者ID:twak,項目名稱:chordatlas,代碼行數:16,代碼來源:SkelGen.java

示例4: start

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
@Override
public void start(int max)
{
	super.start(max);
	task = new ProgressMonitor(parent, message, "", 0, max);
	task.setMillisToDecideToPopup(100);
	task.setMillisToPopup(500);
}
 
開發者ID:igd-iva,項目名稱:colormap-explorer,代碼行數:9,代碼來源:SwingProgressListener.java

示例5: getPersistentProgressMonitor

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
public static ProgressMonitor getPersistentProgressMonitor(Component frame, String message) {
	final ProgressMonitor monitor = new ProgressMonitor(frame, message, "", 0, 1); //$NON-NLS-1$
	monitor.setMillisToDecideToPopup(0);
	monitor.setMillisToPopup(0);
	
	SwingUtilities.invokeLater(new Runnable() {
		@Override
		public void run() {
			try {
				monitor.setProgress(0);

				AccessibleContext ac = monitor.getAccessibleContext();
				if (ac == null) throw new Exception();
				
				JDialog dialog = (JDialog) ac.getAccessibleParent();
				if (dialog == null) throw new Exception();
				
				dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
				for (WindowListener listener : dialog.getWindowListeners()) {
					dialog.removeWindowListener(listener);
				}
				
				java.util.List<JButton> components = SwingUtils.getDescendantsOfType(JButton.class, dialog, true);
				if (components.isEmpty()) throw new Exception();
				
				JButton button = components.get(0);
				if (button == null) throw new Exception();
				
				button.setVisible(false);
			} catch (Exception e) {
				CCLog.addError(LocaleBundle.getString("LogMessage.ErrorOmitingProgressMonitor"), e); //$NON-NLS-1$
			}
		}
	});
	
	return monitor;
}
 
開發者ID:Mikescher,項目名稱:jClipCorn,代碼行數:38,代碼來源:DialogHelper.java

示例6: FileMover

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
public FileMover(final ClientFrame frame, boolean fromTree, final boolean copy, File targetParent, File... files) {
	this.targetParent = targetParent;
	this.files = files;
	this.fromTree = fromTree;
	this.copy = copy;
	this.frame = frame;
	
	canceled = false;
	
	
	JDialog dialog = new JDialog(frame, "");
	dialog.setContentPane(new JLabel("<html><body>Ermittle Gesamtgröße<br>Bitte warten...</body></html>", JLabel.CENTER));
	dialog.setSize(160, 80);
	dialog.setLocationRelativeTo(frame);
	dialog.setAlwaysOnTop(true);
	dialog.setVisible(true);
	
	int count = 0;
	for (File f : files) {
		if (f.isDirectory()) count += Assistant.getFileCount(f);
		else count++;
	}
	
	dialog.dispose();
	
	value = 0;
	
	monitor = new ProgressMonitor(frame, (copy ? "Kopiere" : "Verschiebe") + " Dateien...", "", 0, count);
	monitor.setMillisToDecideToPopup(0);
	monitor.setMillisToPopup(0);
	
	start();
}
 
開發者ID:Dakror,項目名稱:VirtualHub,代碼行數:34,代碼來源:FileMover.java

示例7: ExportProcessMonitorDialog

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
public ExportProcessMonitorDialog(AbstractProcess<Void, DataExportStatus> exportProcess, JFrame parentFrame,  RecordsToExport recordsToExport, DataFormat exportType, EarthSurveyService earthSurveyService, LocalPropertiesService localPropertiesService ) {
	super();
	this.process = exportProcess;
	this.recordsToExport = recordsToExport;
	this.exportType = exportType;
	this.earthSurveyService = earthSurveyService;
	this.localPropertiesService = localPropertiesService;
	progressMonitor = new ProgressMonitor(parentFrame, Messages.getString("ExportDialogProcessMonitor.0"), Messages.getString("ExportDialogProcessMonitor.1"), 0, 100); //$NON-NLS-1$ //$NON-NLS-2$
	progressMonitor.setMillisToPopup(1000);
}
 
開發者ID:openforis,項目名稱:collect-earth,代碼行數:11,代碼來源:ExportProcessMonitorDialog.java

示例8: startProgressMonitor

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
public static void startProgressMonitor()
{
	progressMonitor = new ProgressMonitor(CalicoDataStore.calicoObj,
               "Synchronizing with server: " + CalicoDataStore.ServerHost,
               "", 0, 100);
	progressMonitor.setProgress(0);
	progressMonitor.setMillisToPopup(1);
	progressMonitor.setMillisToDecideToPopup(1);
}
 
開發者ID:uci-sdcl,項目名稱:Calico,代碼行數:10,代碼來源:ListenServerQueue.java

示例9: DefaultSwingProgressListener

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
/**
 * Constructor with customized message.
 */
public DefaultSwingProgressListener(Component parentComponent, String message, String initialNote) {
	progressMonitor = new ProgressMonitor(parentComponent, message, initialNote, 0, 1);
	progressMonitor.setMillisToDecideToPopup(0);
	progressMonitor.setMillisToPopup(0);
}
 
開發者ID:a2geek,項目名稱:apple2-image-encoder,代碼行數:9,代碼來源:DefaultSwingProgressListener.java

示例10: tableChanged

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
@Override
public void tableChanged(TableModelEvent e) {
	super.tableChanged(e);
	if (e.getType() == DataTableModelEvent.CUSTOM_TABLE_MODEL_TYPE) {
		DataTableModelEvent ec = (DataTableModelEvent) e;
		// log("tableChanged: columnIndex: "+columnIndex+", firstRow = "+e.getFirstRow()+", lastRow = "+e.getLastRow()+", Type = "+e.getType()+", source = "+e.getSource());
		// log("tableChange: this.mainWindow: "+this.mainWindow);
		// log("TableModelEventIDs: Allcols:"+TableModelEvent.ALL_COLUMNS+", Delete:"+TableModelEvent.DELETE+", Insert:"+TableModelEvent.INSERT+", Header:"+TableModelEvent.HEADER_ROW+", Update:"+TableModelEvent.UPDATE);
		boolean[] autofitRequired = ec.getAxisAutofitRequired();
		boolean[] resetFiltersRequired = ec.getAxisResetFilterRequired();
		boolean[] applyFiltersRequired = ec.getAxisApplyFiltersRequired();

		final ProgressMonitor progressMonitor = new ProgressMonitor(this.getParent(), "", "Rebuilding charts", 0, this.mainWindow.getDataSheet().getParameterCount() - 1);
		progressMonitor.setMillisToPopup(0);

		for (int i = 0; i < this.mainWindow.getDataSheet().getParameterCount() && !progressMonitor.isCanceled(); i++) {
			final int progress = i;
			SwingUtilities.invokeLater(new Runnable() {
				public void run() {
					progressMonitor.setProgress(progress);
				}
			});
			if (autofitRequired[i]) {
				// log("tableChanged:  autofitRequired");
				this.mainWindow.autofitAxisAllChartFrames(i);
			}
			if (resetFiltersRequired[i]) {
				// log("tableChanged:  resetFiltersRequired");
				this.mainWindow.resetFiltersOnAxisAllChartFrames(i);
			}
			if (applyFiltersRequired[i]) {
				// log("tableChanged:  applyFiltersRequired");
				this.mainWindow.refilterAllChartFrames(i);
			}
		}
		if (ec.isChartRebuildRequired()) {
			log("tableChanged: isChartRebuildRequired ");
			this.mainWindow.rebuildAllChartFrames();
		}
		if (ec.isChartRepaintRequired()) {
			log("tableChanged:isChartRepaintRequired  ");
			this.mainWindow.repaintAllChartFrames();
		}
		if (ec.isDataPanelUpdateRequired()) {
			log("tableChanged:isDataPanelUpdateRequired  ");
			this.mainWindow.updateDataPanel();
		}

		progressMonitor.close();
	}
}
 
開發者ID:enguerrand,項目名稱:xdat,代碼行數:52,代碼來源:DataTable.java

示例11: loadVenueData

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
public Vector loadVenueData(Component parent) throws Exception {

		headers = null;
		Socket s = null;
		ProgressMonitor progress = null;
		Vector venues = null;

		try
		{
			StallInputStream stallInput = new StallInputStream();

			ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(
					parent, "Loading filter data from pente.org", stallInput);
			progress = pmis.getProgressMonitor();
            progress.setNote("Connecting to pente.org...");
			progress.setMillisToDecideToPopup(1);
            progress.setMillisToPopup(1);
            progress.setMaximum(15000);

			StringBuffer paramsBuffer = new StringBuffer();
	        StringBuffer requestBuffer = createHttpRequest(paramsBuffer, "/venues");

	        int len = 0;

        	s = getHttpResponseSocket(requestBuffer);
        	progress.setProgress(2000);
            progress.setNote("Downloading from pente.org...");

            // read past the http headers to the data
            InputStream in = s.getInputStream();
            String contentLength = getHeader("content-length:", in);
            if (contentLength != null) {
            	len = Integer.parseInt(contentLength);
            }
//            for (int i = 0; i < len; i++) {
//            	int b = in.read();
//            	if (b == -1) {
//            		System.out.println("error");
//            	}
//            }

        	progress.setMaximum(len);
        	stallInput.setInputStream(in);

        	ObjectInputStream objectIn = new ObjectInputStream(pmis);
			venues = (Vector) objectIn.readObject();

        } catch (Exception e) {
        	if (s != null) {
        		s.close();
            	s = null;
        	}
			if (!(e instanceof InterruptedException) && !(progress == null || !progress.isCanceled())) {
				throw e;
			}
        }

        return venues;
	}
 
開發者ID:dweebo,項目名稱:pentedb,代碼行數:60,代碼來源:PlunkHttpLoader.java

示例12: updateServer

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
public static void updateServer(final java.awt.Component parent) {
    if(previewKey == null) {
        return;
    }

    final String user = LoginDialog.getUser(parent);
    if(user == null) {
        return;
    }
    final String password = LoginDialog.getPassword(parent);
    
    ProgressMonitor pm = new ProgressMonitor(parent, "Enabling Preview", "Preview", 0, 100);
    pm.setMillisToPopup(0);
    new Thread() {
        public void run() {
            try {
                if(view.getLoadedResources() != null) {
                    String localServerURL = null;
                    try {
                        InetAddress addr = InetAddress.getLocalHost();
                        byte[] ipAddr = addr.getAddress();
                        if((ipAddr[0] & 0xff) == 127) {
                            // workaround  for linux where loopback is returned
                            Socket s = new Socket("codename-one.appspot.com", 80);
                            String p = s.getLocalAddress().getHostAddress();
                            s.close();
                            localServerURL = p;
                        } else {
                            localServerURL = (ipAddr[0] & 0xff) + "." + (ipAddr[1] & 0xff) + 
                                    "." + (ipAddr[2] & 0xff) + "." + (ipAddr[3] & 0xff);
                        }
                    } catch(Throwable t) {
                    }
                    
                    URL u = new URL("https://codename-one.appspot.com/liveeditpreview/preview");
                    HttpURLConnection con = (HttpURLConnection)u.openConnection();
                    con.setDoOutput(true);
                    con.setDoInput(true);
                    con.setRequestMethod("POST");
                    EditableResources res = view.getLoadedResources();
                    ByteArrayOutputStream bo = new ByteArrayOutputStream();
                    DataOutputStream out = new DataOutputStream(bo);
                    out.writeUTF(user.toLowerCase());
                    out.writeUTF(password);
                    out.writeUTF(getMainFormSelection());
                    if(getThemeSelection() == null) {
                        if(view.getLoadedResources().getThemeResourceNames().length > 0) {
                            out.writeUTF(view.getLoadedResources().getThemeResourceNames()[0]);
                        } else {
                            out.writeUTF("");
                        }
                    } else {
                        out.writeUTF(getThemeSelection());                        
                    }
                    if(localServerURL != null) {
                        out.writeUTF("http://" + localServerURL +
                                ":" + LocalServer.getPort() + "/");
                    } else {
                        out.writeUTF("");
                    }
                    view.getLoadedResources().save(out);
                    out.close();

                    OutputStream requestOut = con.getOutputStream();
                    requestOut.write(bo.toByteArray());
                    DataInputStream di = new DataInputStream(con.getInputStream());
                    previewKey = di.readUTF();
                    di.close();
                }
            } catch (Exception ex) {
                ex.printStackTrace();
                //JOptionPane.showMessageDialog(parent, "Error: \n" + ex.toString(), "Error Connecting To Server", JOptionPane.ERROR_MESSAGE);
            }
        }
    }.start();
    
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:78,代碼來源:LivePreview.java

示例13: ImportProcessMonitorDialog

import javax.swing.ProgressMonitor; //導入方法依賴的package包/類
public ImportProcessMonitorDialog(AbstractProcess<Void, ReferenceDataImportStatus<ParsingError>> importProcess, JFrame parentFrame ) {
	super();
	this.process = importProcess;
	progressMonitor = new ProgressMonitor(parentFrame, Messages.getString("ExportDialogProcessMonitor.0"), Messages.getString("ExportDialogProcessMonitor.1"), 0, 100); //$NON-NLS-1$ //$NON-NLS-2$
	progressMonitor.setMillisToPopup(1000);
}
 
開發者ID:openforis,項目名稱:collect-earth,代碼行數:7,代碼來源:ImportProcessMonitorDialog.java


注:本文中的javax.swing.ProgressMonitor.setMillisToPopup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。