Package be.gaudry.swing.utils
Class ProgressInfoRenderer
java.lang.Object
be.gaudry.swing.utils.ProgressInfoRenderer
This class allows visual rendering of information returned by long running Swing processes.
A set of styles is associated with the values of EProgressInfo by default, but it is possible to override certain styles.
- Author:
- Steph GAUDRY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStyle(Color forground, Color background, EProgressInfo epi)
void
void
void
print(JTextPane consoleTextPane, ProgressResult result, boolean addNewLineBreak)
Displays in a JTextPane a message resulting from a long Swing process.void
print(JTextPane consoleTextPane, ProgressResult result, int progressPercent, boolean addNewLineBreak)
Displays in a JTextPane a message resulting from a long Swing process.void
print(JTextPane consoleTextPane, String info, boolean addNewLineBreak, EProgressInfo epi)
Displays in a JTextPane a message resulting from a long Swing process.
-
Constructor Details
-
ProgressInfoRenderer
public ProgressInfoRenderer()
-
-
Method Details
-
clearStyles
public void clearStyles() -
addStyle
-
addStyle
public void addStyle(Color forground, Color background, Boolean bold, Boolean italic, EProgressInfo epi)- Parameters:
forground
-background
-bold
- true to force bold, false to force disabling bold, null to keep default font weightitalic
- true to force italic, false to force disabling italic, null to keep default fontepi
-
-
print
public void print(JTextPane consoleTextPane, String info, boolean addNewLineBreak, EProgressInfo epi)Displays in a JTextPane a message resulting from a long Swing process. It is preferable that this JTextPane is included in a JScrollPane so that when the message is inserted, a scroll effect is automatically applied by this method to display the last message- Parameters:
consoleTextPane
- Component in which messages are displayed.info
-epi
-
-
print
Displays in a JTextPane a message resulting from a long Swing process. It is preferable that this JTextPane is included in a JScrollPane so that when the message is inserted, a scroll effect is automatically applied by this method to display the last message- Parameters:
consoleTextPane
- Component in which messages are displayed.result
-
-
print
public void print(JTextPane consoleTextPane, ProgressResult result, int progressPercent, boolean addNewLineBreak)Displays in a JTextPane a message resulting from a long Swing process. It is preferable that this JTextPane is included in a JScrollPane so that when the message is inserted, a scroll effect is automatically applied by this method to display the last message- Parameters:
consoleTextPane
- Component in which messages are displayed.result
-
-