Package jexer.help

Class THelpText

  • All Implemented Interfaces:
    java.lang.Comparable<TWidget>, Scrollable

    public class THelpText
    extends TScrollableWidget
    THelpText displays help text with clickable links in a scrollable text area. It reflows automatically on resize.
    • Constructor Detail

      • THelpText

        public THelpText​(THelpWindow parent,
                         Topic topic,
                         int x,
                         int y,
                         int width,
                         int height)
        Public constructor.
        Parameters:
        parent - parent widget
        topic - the topic to display
        x - column relative to parent
        y - row relative to parent
        width - width of text area
        height - height of text area
    • Method Detail

      • setWidth

        public void setWidth​(int width)
        Override TWidget's width: we need to set child widget widths.
        Overrides:
        setWidth in class TWidget
        Parameters:
        width - new widget width
      • setHeight

        public void setHeight​(int height)
        Override TWidget's height: we need to set child widget heights. time.
        Overrides:
        setHeight in class TWidget
        Parameters:
        height - new widget height
      • onMouseDown

        public void onMouseDown​(TMouseEvent mouse)
        Handle mouse press events.
        Overrides:
        onMouseDown in class TWidget
        Parameters:
        mouse - mouse button press event
      • onKeypress

        public void onKeypress​(TKeypressEvent keypress)
        Handle keystrokes.
        Overrides:
        onKeypress in class TWidget
        Parameters:
        keypress - keystroke event
      • placeScrollbars

        protected void placeScrollbars()
        Place the scrollbars on the edge of this widget, and adjust bigChange to match the new size. This is called by onResize().
        Overrides:
        placeScrollbars in class TScrollableWidget
      • reflowData

        public void reflowData()
        Resize text and scrollbars for a new width/height.
        Overrides:
        reflowData in class TScrollableWidget
      • draw

        public void draw()
        Draw the text box.
        Overrides:
        draw in class TWidget
      • setTopic

        public void setTopic​(Topic topic)
        Set the topic.
        Parameters:
        topic - new topic to display
      • setTopic

        public void setTopic​(Topic topic,
                             boolean separator)
        Set the topic.
        Parameters:
        topic - new topic to display
        separator - if true, separate paragraphs