Interface DetailViewer


public interface DetailViewer
Defines an interface for nodes to display detailed information about themselves. Methods are provided for simple text markup (heading-value pairs) and addition of deferred-constructions panels for custom display of relevant data.
Author:
Mark Taylor (Starlink)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addKeyedItem(String name, boolean value)
    Adds a key-value paired information item for boolean data.
    void
    addKeyedItem(String name, double value)
    Adds a key-value paired information item for double data.
    void
    addKeyedItem(String name, float value)
    Adds a key-value paired information item for float data.
    void
    addKeyedItem(String name, int value)
    Adds a key-value paired information item for int data.
    void
    addKeyedItem(String name, long value)
    Adds a key-value paired information item for long data.
    void
    addKeyedItem(String name, Object value)
    Adds a key-value paired information item for Object data.
    void
    addKeyedItem(String name, String value)
    Adds a key-value paired information item for string data.
    void
    addPane(String title, Component comp)
    Adds a component for optional display within this viewer.
    void
    addPane(String title, ComponentMaker maker)
    Adds a deferred-construction component for optional display within this viewer.
    void
    Adds a new deferred-construction component which will draw itself at a size appropriate to the size of its container.
    void
    Adds a visible separator to the display.
    void
    Adds a small amount of space to the overview display.
    void
    Adds a subheading to the display.
    void
    Adds unformatted text to the display.
    void
    Adds a top-level title to the display.
    void
    Logs an error in supplying data in some visible fashion.
  • Method Details

    • addTitle

      void addTitle(String title)
      Adds a top-level title to the display.
      Parameters:
      title - title text
    • addSubHead

      void addSubHead(String text)
      Adds a subheading to the display.
      Parameters:
      text - subheading text
    • addKeyedItem

      void addKeyedItem(String name, String value)
      Adds a key-value paired information item for string data.
      Parameters:
      name - key text
      value - value
    • addKeyedItem

      void addKeyedItem(String name, Object value)
      Adds a key-value paired information item for Object data.
      Parameters:
      name - key text
      value - value
    • addKeyedItem

      void addKeyedItem(String name, double value)
      Adds a key-value paired information item for double data.
      Parameters:
      name - key text
      value - value
    • addKeyedItem

      void addKeyedItem(String name, float value)
      Adds a key-value paired information item for float data.
      Parameters:
      name - key text
      value - value
    • addKeyedItem

      void addKeyedItem(String name, long value)
      Adds a key-value paired information item for long data.
      Parameters:
      name - key text
      value - value
    • addKeyedItem

      void addKeyedItem(String name, int value)
      Adds a key-value paired information item for int data.
      Parameters:
      name - key text
      value - value
    • addKeyedItem

      void addKeyedItem(String name, boolean value)
      Adds a key-value paired information item for boolean data.
      Parameters:
      name - key text
      value - value
    • logError

      void logError(Throwable err)
      Logs an error in supplying data in some visible fashion.
      Parameters:
      err - error
    • addSeparator

      void addSeparator()
      Adds a visible separator to the display.
    • addSpace

      void addSpace()
      Adds a small amount of space to the overview display.
    • addText

      void addText(String text)
      Adds unformatted text to the display.
      Parameters:
      text - text
    • addPane

      void addPane(String title, Component comp)
      Adds a component for optional display within this viewer.
      Parameters:
      title - title of the new component
      comp - component
    • addPane

      void addPane(String title, ComponentMaker maker)
      Adds a deferred-construction component for optional display within this viewer. The component will draw itself at a fixed size and will be contained within scrollbars if necessary.
      Parameters:
      title - title of the new component
      maker - component deferred factory
    • addScalingPane

      void addScalingPane(String title, ComponentMaker maker)
      Adds a new deferred-construction component which will draw itself at a size appropriate to the size of its container. The JComponent returned by maker should generally have a paintComponent method which senses its actual size and draws itself accordingly, something like this:
           protected void paintComponent( Graphics g ) {
               super.paintComponent( g );
               doScaledPainting( getSize() );
           }
       
      or, perhaps for efficiency, more like this:
           private Dimension lastSize;
           protected void paintComponent( Graphics g ) {
               super.paintComponent( g );
               Dimension size = getSize();
               if ( ! size.equals( lastSize ) ) {
                   setPreferredSize( size );
                   reconfigureComponentToSize( size );
               }
               doPainting();
           }
       
      Parameters:
      title - title of the new component
      maker - component deferred factory