Class ProgressInfoRenderer

java.lang.Object
be.gaudry.swing.utils.ProgressInfoRenderer

public class ProgressInfoRenderer extends Object
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 Details

    • ProgressInfoRenderer

      public ProgressInfoRenderer()
  • Method Details

    • clearStyles

      public void clearStyles()
    • addStyle

      public void addStyle(Color forground, Color background, EProgressInfo epi)
    • 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 weight
      italic - true to force italic, false to force disabling italic, null to keep default font
      epi -
    • 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

      public void print(JTextPane consoleTextPane, ProgressResult result, 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 -
    • 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 -