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

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

      • addTitle

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

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

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

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

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

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

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

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

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

        void logError​(java.lang.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​(java.lang.String text)
        Adds unformatted text to the display.
        Parameters:
        text - text
      • addPane

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

        void addPane​(java.lang.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​(java.lang.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