Class AbstractDetailsPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public abstract class AbstractDetailsPanel extends JPanel
Abstract class that defines a panel for displaying name/value pairs with html-formatting.
See Also:
  • Field Details

  • Constructor Details

    • AbstractDetailsPanel

      public AbstractDetailsPanel()
  • Method Details

    • createFieldAttributes

      protected abstract void createFieldAttributes()
      Sets attributes for the different pieces of information being displayed in this panel.
    • createAttributeSet

      protected SimpleAttributeSet createAttributeSet(String fontFamily, int fontSize, boolean bold, Color color)
      Returns a new SimpleAttributeSet with all attributes set by the caller.
      Parameters:
      fontFamily - the font to use
      fontSize - the font size
      bold - if true, render text bold
      color - the foreground text color
      Returns:
      a new attribute set
    • createAttributeSet

      protected SimpleAttributeSet createAttributeSet(Color color)
      Returns a new SimpleAttributeSet with the following default attributes set:
      • FontFamily: "Tahoma"
      • FontSize: 11
      • Bold: True
      Parameters:
      color - the foreground text color
      Returns:
      a new attribute set
    • clear

      protected void clear()
      Clears the text in the details pane.
    • createMainPanel

      protected void createMainPanel()
      Creates the main dialog components.
    • insertRowTitle

      protected void insertRowTitle(StringBuilder buffer, String rowName)
      Inserts an html-formatted string into the given buffer. This is meant to be used for inserting the name of each row in the description text.
      Parameters:
      buffer - the string buffer to add to
      rowName - the name of the row to add
    • insertRowValue

      protected void insertRowValue(StringBuilder buffer, String value, SimpleAttributeSet attributes)
      Inserts an html-formatted string into the given buffer. This is meant to be used for inserting the value of each row in the description text.
      Parameters:
      buffer - the string buffer to add to
      value - the text to add
      attributes - the structure containing formatting information
    • insertHTMLString

      protected void insertHTMLString(StringBuilder buffer, String string, SimpleAttributeSet attributes)
      Adds text to a string buffer as an html-formatted string, adding formatting information as specified.
      Parameters:
      buffer - the string buffer to add to
      string - the string to add
      attributes - the formatting instructions
    • insertHTMLLine

      protected void insertHTMLLine(StringBuilder buffer, String string, SimpleAttributeSet attributes)
      Inserts a single line of html into a StringBuffer, with the given attributes.
      Parameters:
      buffer - the string buffer
      string - the string to insert
      attributes - the attributes to apply