Class Hyperlink


  • public class Hyperlink
    extends HotSpot
    Handles hot spots of type "http://nnn" and "ftp://nnn".
    Author:
    Christopher Mindus
    • Constructor Summary

      Constructors 
      Constructor Description
      Hyperlink()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate​(TerminalWindow tw)
      Called when the hot spot is activated.
      int check​(char[] line, java.util.List<HotSpot> hotSpots, int begin, int end)
      Checks if a hot spot is found.
      boolean continueChecking​(char[] line, char ch, int begin, int end)
      Checks if it is OK to keep on checking.
      void fillCharBackground​(java.awt.Graphics g, int xPos, int yPos, int x, int y, int cx, int cy)
      Gets the background for drawing on the screen of the hot spot.
      void initialize​(java.lang.String setup, boolean active)
      Performs initialization from the setup data.
      void setTextColor​(java.awt.Graphics g, int xPos, int yPos, int x, int y, int cx, int cy)
      Sets the color to use for the text (character) using g.setColor(nnn).
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Hyperlink

        public Hyperlink()
    • Method Detail

      • initialize

        public void initialize​(java.lang.String setup,
                               boolean active)
        Performs initialization from the setup data. Each hyperlink entry in the setup string (that is comma separated) contains the initial string.
        Specified by:
        initialize in class HotSpot
        Parameters:
        setup - encoded definitions
        active - initial status of the function
      • continueChecking

        public boolean continueChecking​(char[] line,
                                        char ch,
                                        int begin,
                                        int end)
        Checks if it is OK to keep on checking.
        Specified by:
        continueChecking in class HotSpot
      • check

        public int check​(char[] line,
                         java.util.List<HotSpot> hotSpots,
                         int begin,
                         int end)
        Checks if a hot spot is found. If it is, the position returned should be directly after the new hot spot.
        Specified by:
        check in class HotSpot
        Parameters:
        line - current line to check
        hotSpots - list of active hotspots to check
        begin - check start position
        end - check end position
        Returns:
        int position checked to
      • fillCharBackground

        public void fillCharBackground​(java.awt.Graphics g,
                                       int xPos,
                                       int yPos,
                                       int x,
                                       int y,
                                       int cx,
                                       int cy)
        Gets the background for drawing on the screen of the hot spot.
        Overrides:
        fillCharBackground in class HotSpot
        Parameters:
        g - graphic resource
        xPos -
        yPos -
        x -
        y -
        cx -
        cy -
      • setTextColor

        public void setTextColor​(java.awt.Graphics g,
                                 int xPos,
                                 int yPos,
                                 int x,
                                 int y,
                                 int cx,
                                 int cy)
        Sets the color to use for the text (character) using g.setColor(nnn).
        Overrides:
        setTextColor in class HotSpot
        Parameters:
        g - graphic resource
        xPos -
        yPos -
        x -
        y -
        cx -
        cy -
      • activate

        public void activate​(TerminalWindow tw)
        Called when the hot spot is activated.
        Specified by:
        activate in class HotSpot
        Parameters:
        tw - The terminal window