java.lang.Object
org.autogui.base.log.GuiLogEntryProgress
- All Implemented Interfaces:
Closeable,AutoCloseable,GuiLogEntry
- Direct Known Subclasses:
GuiSwingLogEntryProgress
a log-entry for progress:
[time] minimum|=========value - - - - |maximum : valueP %, message
or
[time] |- - - indeterminate - - - | message
=>
[time] message
[endTime] 100%
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classan exception thrown by checking-interruption -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddListener(Consumer<GuiLogEntryProgress> listener) addValue(int n) it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedExceptionaddValueP(double p) it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedExceptionvoidif the current thread is equal to the thread of the progress, and the thread is interrupted, it causesGuiLogEntryProgress.GuiLogEntryProgressInterruptedException.voidclose()voidfinish()it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException.voidnotifies to listeners.intintgetTime()intgetValue()doublebooleanisActive()booleanbooleanremoveListener(Consumer<GuiLogEntryProgress> listener) setEndTime(Instant endTime) setIndeterminate(boolean indeterminate) it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException.setMaximum(int maximum) it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException.setMessage(String message) it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException.setMinimum(int minimum) it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException.voidcopy fields of p.setValue(int n) it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedExceptionif the value is actually changed, it causes a notification to listenerssetValueP(double p) it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedExceptiontoString()
-
Field Details
-
minimum
protected int minimum -
maximum
protected int maximum -
value
protected int value -
indeterminate
protected boolean indeterminate -
message
-
time
-
endTime
-
thread
-
listeners
-
-
Constructor Details
-
GuiLogEntryProgress
public GuiLogEntryProgress()
-
-
Method Details
-
setState
copy fields of p. p can be null- Parameters:
p- copied state
-
addListener
- Parameters:
listener- the listener will receive the progress when its valueP is updated- Returns:
- this
-
removeListener
-
getListeners
-
fireChange
public void fireChange()notifies to listeners. this is automatically called from setter methods -
setMinimum
it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException. it also causes a notification to listeners when the minimum value is actually changed.- Parameters:
minimum- the minimum value of the progress to be set: if the value is smaller than the maximum, then the intermediate flag becomes false- Returns:
- this
-
setMaximum
it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException. it also causes a notification to listeners when the maximum value is actually changed.- Parameters:
maximum- the maximum value of the progress to be set: if the value is larger than the minimum then the intermediate flag becomes false- Returns:
- this
-
setValueP
it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException- Parameters:
p- 0 to 1.0- Returns:
- this
- See Also:
-
setValue
it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedExceptionif the value is actually changed, it causes a notification to listeners- Parameters:
n- the progress value- Returns:
- this
-
addValueP
it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException- Parameters:
p- 0 to 1.0- Returns:
- this
- See Also:
-
addValue
it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException- Parameters:
n- added value to the progress- Returns:
- this
- See Also:
-
setIndeterminate
it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException. if the flag is actually changed, it causes a notification to listeners- Parameters:
indeterminate- the intermediate flag to be set- Returns:
- this
-
setMessage
it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException. the method will never cause a notification- Parameters:
message- the new message- Returns:
- this
-
setEndTime
-
setTime
-
isIndeterminate
public boolean isIndeterminate() -
getMaximum
public int getMaximum() -
getMinimum
public int getMinimum() -
getValue
public int getValue() -
getValueP
public double getValueP() -
getTime
-
getMessage
-
isFinished
public boolean isFinished()- Returns:
- true if endTime is set
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
finish
public void finish()it might causeGuiLogEntryProgress.GuiLogEntryProgressInterruptedException. endTime will be set. value becomes maximum -
getEndTime
-
setThread
-
getThread
- Returns:
- by default, the current thread of constructor sender
-
checkInterruption
public void checkInterruption()if the current thread is equal to the thread of the progress, and the thread is interrupted, it causesGuiLogEntryProgress.GuiLogEntryProgressInterruptedException. -
isActive
public boolean isActive()- Specified by:
isActivein interfaceGuiLogEntry- Returns:
- true if the record is running and updating
-
toString
-