Java Doc for Progress.java in  » IDE-Netbeans » nbi » org » netbeans » installer » utils » progress » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » nbi » org.netbeans.installer.utils.progress 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.installer.utils.progress.Progress

All known Subclasses:   org.netbeans.installer.utils.progress.CompositeProgress,
Progress
public class Progress (Code)
This class encapsulates data that describes the course of an operation, such as the operation description, detailed status string and completion percentage.

A typical usecase would be for a client to costruct an instance of this object and pass it to the operation handler, which will update the progress as the operation goes on. The client can register itself as a listener for the progress object; this way it will receive notifications on the progress updates.

The client can also use the built-in cancellation facility to inform the operation handler of the necessity to break the operation and return. Whether the operation will be stopped, however, solely depends on the operation handler's politeness.

In some cases the opreation handler is not capable of working directly with the progress that was passed to it. In this case it should construct a specialized Progress instance and use the synchronization facility to keep these two in sync.
See Also:   Progress.addProgressListener(ProgressListener)
See Also:   Progress.setCanceled(boolean)
See Also:   Progress.synchronizeFrom(Progress)
See Also:   CompositeProgress
author:
   Kirill Sorokin
since:
   1.0



Field Summary
final public static  intCOMPLETE
     The final (maximum) value of a progress' percentage.
final public static  StringERROR_WRONG_PERCENTAGE
     The error message which will be displayed when a user tries to set an invalid percentage.
final public static  intSTART
     The initial (minimum) value of a progress' percentage.
protected  booleancanceled
     A flag which indicates whether or not the progress has been canceled.
protected  Stringdetail
     The detailed status of the progress.
protected  intpercentage
     The current state of the progress expressed in percents.
protected  Stringtitle
     The title (i.e.

Constructor Summary
public  Progress()
     Creates a new Progress instance.
public  Progress(ProgressListener initialListener)
     Creates a new Progress instance and registers the supplied listener.

It's important to remember that listeners in progress are not implemented via weak references and hence should be handled with care.


Method Summary
public  voidaddPercentage(int addition)
     Adds the specified amount to the percentage property.
public  voidaddProgressListener(ProgressListener listener)
     Adds (registers) a progress listener to this progrss object.
public  StringgetDetail()
     Returns the value of the detail property.
public  intgetPercentage()
     Returns the value of the percentage property.
public  StringgetTitle()
     Returns the value of the title property.
public  booleanisCanceled()
     Returns the value of the canceled property.
protected  voidnotifyListeners()
     Notifies the registered listeners that one or more of the progress' properties has changed.
public  voidremoveProgressListener(ProgressListener listener)
     Removes (unregisters) a progress listener from this progress object.
public  voidreverseSynchronizeFrom(Progress progress)
     Sets up the reverse synchronization of this progress object from the specified source.
public  voidreverseSynchronizeTo(Progress progress)
     Sets up the reverse synchronization of this progress object to the specified target.
public  voidsetCanceled(boolean canceled)
     Sets the value of the canceled property.
public  voidsetDetail(String detail)
     Sets the value of the detail property.
public  voidsetPercentage(int percentage)
     Sets the value of the percentage property.
public  voidsetPercentage(long percentage)
     Sets the value of the percentage property.
public  voidsetTitle(String title)
     Sets the value of the title property.
public  voidsynchronizeFrom(Progress progress)
     Sets up the synchronization of this progress object from the specified source.
public  voidsynchronizeTo(Progress progress)
     Sets up the synchronization of this progress object to the specified target.

Field Detail
COMPLETE
final public static int COMPLETE(Code)
The final (maximum) value of a progress' percentage.



ERROR_WRONG_PERCENTAGE
final public static String ERROR_WRONG_PERCENTAGE(Code)
The error message which will be displayed when a user tries to set an invalid percentage.



START
final public static int START(Code)
The initial (minimum) value of a progress' percentage.



canceled
protected boolean canceled(Code)
A flag which indicates whether or not the progress has been canceled. It is expected that the updater of the progress will check the value of this flag and act accordingly. It should be used to establish some basic communication between the invoker of a lengthy operation and the code which actually performs the operation.



detail
protected String detail(Code)
The detailed status of the progress. As opposed to the title, the detail is expected to change with every couple changes in the procentage.



percentage
protected int percentage(Code)
The current state of the progress expressed in percents. Obviously the most often changed property of the progress.



title
protected String title(Code)
The title (i.e. human readable description) of the progress. The title is expected not to change often during the course of the progress.




Constructor Detail
Progress
public Progress()(Code)
Creates a new Progress instance. The new instance has its title and detail set to empty strings, percentage to Progress.START and canceled to false.



Progress
public Progress(ProgressListener initialListener)(Code)
Creates a new Progress instance and registers the supplied listener.

It's important to remember that listeners in progress are not implemented via weak references and hence should be handled with care. The most common case would be to dump the complete progresses tree together with all listeners. However if it's not the case, be sure to remove the listener with the Progress.removeProgressListener(ProgressListener) method.
Parameters:
  initialListener - A progress listener to register upon progresscreation.
See Also:   Progress.Progress()
See Also:   Progress.removeProgressListener(ProgressListener)





Method Detail
addPercentage
public void addPercentage(int addition)(Code)
Adds the specified amount to the percentage property. The added amount can be either positive or negative. Teh percentage value will be updated only if the result of the addition is different from the current percentage. Also the listeners are notified only is the update actually took place.
Parameters:
  addition - The amount to add to the percentage property. {@link IllegalArgumentException} if the supplied percentage cannot be added.



addProgressListener
public void addProgressListener(ProgressListener listener)(Code)
Adds (registers) a progress listener to this progrss object. If the argument is null, no action will be performed.

In most cases a single Progress instance will have only one listener, so it is feasible to use the specialized constructor overlod instead of this method.
Parameters:
  listener - A progress listener to add.
See Also:   ProgressListener
See Also:   Progress.Progress(ProgressListener)




getDetail
public String getDetail()(Code)
Returns the value of the detail property. The value of the detail property.



getPercentage
public int getPercentage()(Code)
Returns the value of the percentage property. The value of the percentage property.



getTitle
public String getTitle()(Code)
Returns the value of the title property. The value of the title property.



isCanceled
public boolean isCanceled()(Code)
Returns the value of the canceled property. The value of the canceled property.



notifyListeners
protected void notifyListeners()(Code)
Notifies the registered listeners that one or more of the progress' properties has changed.
See Also:   ProgressListener



removeProgressListener
public void removeProgressListener(ProgressListener listener)(Code)
Removes (unregisters) a progress listener from this progress object. If the argument is null or is not present in the listeners list, no action will be performed.
Parameters:
  listener - A progress listener to remove.
See Also:   ProgressListener



reverseSynchronizeFrom
public void reverseSynchronizeFrom(Progress progress)(Code)
Sets up the reverse synchronization of this progress object from the specified source.

This method is very similar to the Progress.synchronizeFrom(Progress) method. The only difference is in that instead of setting the percentage of this progress object to the percentage of the source, it is set to the difference between Progress.COMPLETE and the source's percentage.

In order to remove the synchronization link on this progress, just supply null as the parameter.
Parameters:
  progress - A progress object from which to set up the synchronization,or null to cancel the synchronization.
See Also:   Progress.synchronizeFrom(Progress)




reverseSynchronizeTo
public void reverseSynchronizeTo(Progress progress)(Code)
Sets up the reverse synchronization of this progress object to the specified target. This method just calls Progress.reverseSynchronizeFrom(Progress) on the target progress, supplying itself as the parameter.
Parameters:
  progress - A progress object to which to set up the synchronization.
See Also:   Progress.reverseSynchronizeFrom(Progress)



setCanceled
public void setCanceled(boolean canceled)(Code)
Sets the value of the canceled property. The value is updated only if the supplied value is different from the current. Also the progress listeners are notified only if the update actually took place.

If the progress is in being synchronized from another progress. The cancelled status will be propagated to the synchronization source.
Parameters:
  canceled - The new value for the canceled property.




setDetail
public void setDetail(String detail)(Code)
Sets the value of the detail property. The value is updated only if the supplied detail is different from the current. Also the progress listeners are notified only if the update actually took place.
Parameters:
  detail - The new value for the detail property.



setPercentage
public void setPercentage(int percentage)(Code)
Sets the value of the percentage property. The value is updated only if the supplied percentage is different from the current. Also the progress listeners are notified only if the update actually took place.
Parameters:
  percentage - The new value for the percentage property. {@link IllegalArgumentException} if the supplied percentage cannot be set.



setPercentage
public void setPercentage(long percentage)(Code)
Sets the value of the percentage property. This method is the same as the Progress.setPercentage(int) one, with the only difference that it accepts a long parameter. The parameter is converted to an int and the corresponding method is called.
Parameters:
  percentage - The new value for the percentage property. {@link IllegalArgumentException} if the supplied percentage cannot be set.



setTitle
public void setTitle(String title)(Code)
Sets the value of the title property. The value is updated only if the supplied title is different from the current. Also the progress listeners are notified only if the update actually took place.
Parameters:
  title - The new value for the title property.



synchronizeFrom
public void synchronizeFrom(Progress progress)(Code)
Sets up the synchronization of this progress object from the specified source. If there was a synchronization link already set up, it is removed.

Once the synchronization is established, the methods that set the core progress properties do not have any effect - the properties will be correctly set, but will be overwritten with the next source update.

In order to remove the synchronization link on this progress, just supply null as the parameter.
Parameters:
  progress - A progress object from which to set up the synchronization,or null to cancel the synchronization.




synchronizeTo
public void synchronizeTo(Progress progress)(Code)
Sets up the synchronization of this progress object to the specified target. This method just calls Progress.synchronizeFrom(Progress) on the target progress, supplying itself as the parameter.
Parameters:
  progress - A progress object to which to set up the synchronization.
See Also:   Progress.synchronizeFrom(Progress)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.