当前位置: 首页>>代码示例>>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;未经允许,请勿转载。