Class DOMDisplay

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, TextSupporter, VariablesInspectionHandler, VariableChangeListener, Actor, ClearableDisplay, DisplayTypeSupporter, ErrorHandler, InputConsumer, ComponentSupplier, DisplayPanelProvider, TextSupplier, MenuBarProvider, SendToActionSupporter, Serializable, Comparable

    public class DOMDisplay
    extends AbstractGraphicalDisplay
    implements DisplayPanelProvider, TextSupplier
    Displays a DOM node object as tree structure.

    Input/output:
    - accepts:
       org.w3c.dom.Node


    Valid options are:

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: XMLDisplay
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -short-title <boolean> (property: shortTitle)
        If enabled uses just the name for the title instead of the actor's full 
        name.
        default: false
     
    -width <int> (property: width)
        The width of the dialog.
        default: 800
        minimum: -1
     
    -height <int> (property: height)
        The height of the dialog.
        default: 600
        minimum: -1
     
    -x <int> (property: x)
        The X position of the dialog (>=0: absolute, -1: left, -2: center, -3: right
        ).
        default: -1
        minimum: -3
     
    -y <int> (property: y)
        The Y position of the dialog (>=0: absolute, -1: top, -2: center, -3: bottom
        ).
        default: -1
        minimum: -3
     
    -writer <adams.gui.print.JComponentWriter> (property: writer)
        The writer to use for generating the graphics output.
        default: adams.gui.print.NullWriter
     
    -preview <boolean> (property: preview)
        If enabled, a table is shown that displays the attributes of the Node object 
        associated with the currently selected node in the tree.
        default: false
     
    -expand <boolean> (property: expand)
        If enabled, the tree gets fully expanded.
        default: false
     
    -splitter-pos <int> (property: splitterPosition)
        The initial position of the splitter in the viewer panel.
        default: 500
        minimum: 1
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Preview

        protected boolean m_Preview
        whether to offer preview.
      • m_Expand

        protected boolean m_Expand
        whether to fully expand the tree.
      • m_SplitterPosition

        protected int m_SplitterPosition
        the position of the splitter.
    • Constructor Detail

      • DOMDisplay

        public DOMDisplay()
    • Method Detail

      • setPreview

        public void setPreview​(boolean value)
        Sets whether to show a preview table for the attributes.
        Parameters:
        value - if true then preview table is displayed
      • getPreview

        public boolean getPreview()
        Returns whether to show a preview table for the attributes.
        Returns:
        true if preview table is displayed
      • previewTipText

        public String previewTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setExpand

        public void setExpand​(boolean value)
        Sets whether to fully expand the tree or not.
        Parameters:
        value - if true then the tree gets fully expanded
      • getExpand

        public boolean getExpand()
        Returns whether to fully expand the tree or not.
        Returns:
        true if text area is displayed
      • expandTipText

        public String expandTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultSplitterPosition

        protected int getDefaultSplitterPosition()
        Returns the default position for the splitter.
      • setSplitterPosition

        public void setSplitterPosition​(int value)
        Sets the initial position of the splitter in the viewer panel.
        Parameters:
        value - the position
      • getSplitterPosition

        public int getSplitterPosition()
        Returns the initial position of the splitter in the viewer panel.
        Returns:
        the position
      • splitterPositionTipText

        public String splitterPositionTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Returns:
        the Class of objects that can be processed
      • display

        protected void display​(Token token)
        Displays the token (the panel and dialog have already been created at this stage).
        Specified by:
        display in class AbstractDisplay
        Parameters:
        token - the token to display
      • createDisplayPanel

        public DisplayPanel createDisplayPanel​(Token token)
        Creates a new display panel for the token.
        Specified by:
        createDisplayPanel in interface DisplayPanelProvider
        Parameters:
        token - the token to display in a new panel, can be null
        Returns:
        the generated panel
      • displayPanelRequiresScrollPane

        public boolean displayPanelRequiresScrollPane()
        Returns whether the created display panel requires a scroll pane or not.
        Specified by:
        displayPanelRequiresScrollPane in interface DisplayPanelProvider
        Returns:
        true if the display panel requires a scroll pane