本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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;
}
示例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();
}
示例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);
}