home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / SOURCE.BIN / ScrollingText.java < prev    next >
Encoding:
Java Source  |  1997-06-19  |  19.9 KB  |  826 lines

  1. package symantec.itools.multimedia;
  2.  
  3. import java.awt.*;
  4. import java.applet.Applet;
  5. import java.applet.AppletContext;
  6. import java.net.URL;
  7.  
  8. /**
  9.  * Scrolling text component.  Forms a text banner that scrolls specified
  10.  * text horizontally.  The component allows multiple messages and links.
  11.  *
  12.  * @version 1.0, Feb 2, 1997
  13.  * @author Symantec
  14.  */
  15.  
  16. //     02/02/97    RKM    Checked it in
  17. //     02/07/97    RKM    Fixed bug in paint where the font was noit being set up in the offscreen image (thanks Dave)
  18.  
  19. public class ScrollingText
  20.     extends Canvas
  21.     implements Runnable
  22. {
  23.     // Enums
  24.  
  25.     /**
  26.      * Constant which indicates that the banner should scroll from right to left
  27.      */
  28.  
  29.     public static final int SCROLL_LEFT = 0;
  30.  
  31.     /**
  32.      * Constant which indicates that the banner should scroll from left to right
  33.      */
  34.  
  35.     public static final int SCROLL_RIGHT = 1;
  36.  
  37.     // Property variables
  38.  
  39.     /**
  40.      * Current scroll direction. Default value SCROLL_LEFT.
  41.      */
  42.     protected int scrollDirection;
  43.  
  44.     /**
  45.      * Distance to scroll on each update.  Distance is in pixels. Default value 10.
  46.      */
  47.     protected int scrollUnit;                            //the incremental scrolling distance in pixels
  48.  
  49.     /**
  50.      * Controls the speed of the scroll. Default value 150.
  51.      */
  52.     protected int sleepTime;                            //controls the speed of the scroll
  53.  
  54.     /**
  55.      * Color for highlighted text. Default value is red.
  56.      */
  57.  
  58.     protected Color hiliteColor;
  59.  
  60.     /**
  61.      * List of messages to scroll across the banner.
  62.      */
  63.     protected String[] messageList;
  64.  
  65.  
  66.     /**
  67.      * URL links which correspond with messages.
  68.      */
  69.     protected URL[] linkToList;
  70.  
  71.     /**
  72.      * Location in browser to show linked HTML pages.
  73.      * Valid values are "_self" to show in the current frame;
  74.      * "_parent" show in the parent frame;
  75.      * "_top" show in the topmost frame;
  76.      * "_blank" show in a new unnamed top-level window;
  77.      * name show in a new top-level window named name.
  78.      */
  79.     protected String frame;
  80.  
  81.     // Internal variables
  82.  
  83.     /**
  84.      * If used in an applet, this is the applet's context.
  85.      */
  86.     protected AppletContext context;
  87.  
  88.     /**
  89.      * Thread which runs the scrolling animation.
  90.      */
  91.     protected Thread scrollThread = null;
  92.  
  93.     /**
  94.      * State of scrolling animation.
  95.      */
  96.     protected boolean suspended = false;
  97.  
  98.     /**
  99.      * Current horizontal text position.
  100.      */
  101.     protected int textX;
  102.  
  103.     /**
  104.      * Current vertical text position.
  105.      */
  106.     protected int textY;
  107.  
  108.     /**
  109.      * Width of current message text.
  110.      */
  111.     protected int textWidth;
  112.  
  113.     /**
  114.      * Height of current message text.
  115.      */
  116.     protected int textHeight;
  117.  
  118.  
  119.     /**
  120.      * Mouse over message text.
  121.      */
  122.     protected boolean isMouseOver = false;
  123.  
  124.     /**
  125.      * Last mouse cursor position.
  126.      */
  127.     protected int lastMouseX,lastMouseY;
  128.  
  129.     /**
  130.      * Status of mouse position.
  131.      */
  132.     protected boolean wasMouseOverText = false;
  133.  
  134.     /**
  135.      * Previous status message.
  136.      */
  137.     protected String wasStatusMessage = "";
  138.  
  139.  
  140.     /**
  141.      * Current message text.
  142.      */
  143.     protected String currMessage;
  144.  
  145.     /**
  146.      * Current URL link.
  147.      */
  148.     protected URL currLinkTo;
  149.  
  150.     /**
  151.      * Index of current message text and URL
  152.      */
  153.     protected int currIndex;
  154.  
  155.     // Constructor
  156.  
  157.     /**
  158.      * Construct default scrolling text banner.
  159.      */
  160.  
  161.     public ScrollingText()
  162.     {
  163.         super();
  164.  
  165.         //Set defaults for properties
  166.         scrollDirection = SCROLL_LEFT;
  167.         scrollUnit = 10;
  168.         sleepTime = 150;
  169.         hiliteColor = Color.red;
  170.         messageList = new String[0];
  171.         linkToList = new URL[0];
  172.         frame = null;
  173.  
  174.         //Init current message variables
  175.         currMessage = "";
  176.         currLinkTo = null;
  177.         currIndex = -1;
  178.     }
  179.  
  180.     // Getters/Setters
  181.  
  182.     /**
  183.      * Set sleep time between scroll steps.  This function controls
  184.      * the speed of scrolling.  A lower number indicates a faster speed.
  185.      *
  186.      * @param speed number of milliseconds to sleep between scroll steps.  The smaller the
  187.      *              number the faster the scroll.  Minimum value of 30.
  188.      */
  189.  
  190.     public void setScrollInterval(int speed)
  191.     {
  192.         if (speed < 30)
  193.             sleepTime = 30;
  194.         else
  195.             sleepTime = speed;
  196.     }
  197.  
  198.     /**
  199.      * Obtain the current scroll interval.  This is the number of milliseconds
  200.      * that the scroll thread will sleep between scroll steps.
  201.      *
  202.      * @return current scroll delay setting, in milliseconds
  203.      */
  204.  
  205.     public int getScrollInterval()
  206.     {
  207.         return sleepTime;
  208.     }
  209.  
  210.  
  211.     /**
  212.      * Specify the size of each scroll step.
  213.      *
  214.      * @param unit the number of pixels to move the text on each scroll step
  215.      *
  216.      */
  217.  
  218.     public void setScrollUnit(int unit)
  219.     {
  220.         if (unit < 1)
  221.             scrollUnit = 1;
  222.         else
  223.             scrollUnit = unit;
  224.     }
  225.  
  226.     /**
  227.      * Obtain the current size of the scroll step.
  228.      *
  229.      * @return the number of pixels that text moves on each scroll step
  230.      *
  231.      */
  232.  
  233.     public int getScrollUnit()
  234.     {
  235.         return (scrollUnit < 0) ? -scrollUnit : scrollUnit;
  236.     }
  237.  
  238.  
  239.     /**
  240.      * Specify the banner's current scroll direction.
  241.      *
  242.      * @param dir direction to scroll. Valid values are SCROLL_LEFT and SCROLL_RIGHT
  243.      */
  244.  
  245.     public void setScrollDirection(int dir)
  246.     {
  247.         scrollDirection = dir;
  248.     }
  249.  
  250.     /**
  251.      * Obtain the current direction of scrolling.
  252.      *
  253.      * @return the current direction, either SCROLL_LEFT or SCROLL_RIGHT
  254.      */
  255.  
  256.     public int getScrollDirection()
  257.     {
  258.         return scrollDirection;
  259.     }
  260.  
  261.  
  262.     /**
  263.      * Set the highlight color for text.  Text is highlighted in this color when the mouse cursor is over
  264.      * it and it contains a non-null link.
  265.      *
  266.      * @param newHiliteColor color for highlighted text.
  267.      */
  268.  
  269.     public void setHiliteColor(Color newHiliteColor)
  270.     {
  271.         hiliteColor = newHiliteColor;
  272.     }
  273.  
  274.  
  275.     /**
  276.      * Obtain the current color for text highlighting
  277.      *
  278.      * @return current highlight color
  279.      */
  280.  
  281.     public Color getHiliteColor()
  282.     {
  283.         return hiliteColor;
  284.     }
  285.  
  286.  
  287.     /**
  288.      * Specify the current list of messages.  These messages scroll sequentially
  289.      * through the banner.
  290.      *
  291.      * @param list list of messages to display
  292.      */
  293.    public void setMessageList(String[] list)
  294.     {
  295.         messageList = list;
  296.         updateCurrentMessage(false);
  297.     }
  298.  
  299.  
  300.     /**
  301.      * Obtain the current list of messages.
  302.      *
  303.      * @return the current list of messages being displayed
  304.      */
  305.  
  306.     public String[] getMessageList()
  307.     {
  308.         return messageList;
  309.     }
  310.  
  311.  
  312.     /**
  313.      * Specify the list of URLs for message links.
  314.      * Each link corresponds with a message in the message list.
  315.      * If a message has no link, a null URL should be included for that message.
  316.      *
  317.      * @param list list of URL links
  318.      */
  319.  
  320.     public void setLinkToList(URL[] list)
  321.     {
  322.         linkToList = list;
  323.         updateCurrentMessage(false);
  324.     }
  325.  
  326.  
  327.     /**
  328.      * Obtain the current set of URL links.
  329.      *
  330.      * @return list of URL links.  Each URL corresponds to the message of the same index in the message list
  331.      */
  332.     public URL[] getLinkToList()
  333.     {
  334.         return linkToList;
  335.     }
  336.  
  337.  
  338.     /**
  339.      * Specify the display location of linked pages.  If the ScrollingText is in an applet this
  340.      * method determines where the linked pages are displayed.
  341.      *
  342.      * @param f where to display the linked documents.
  343.      * Valid values are "_self" to show in the current frame;
  344.      * "_parent" show in the parent frame;
  345.      * "_top" show in the topmost frame;
  346.      * "_blank" show in a new unnamed top-level window;
  347.      * <name> show in a new top-level window named name
  348.      */
  349.     public void setFrame(String f)
  350.     {
  351.         frame = f;
  352.     }
  353.  
  354.  
  355.     /**
  356.      * Obtain the display location of linked pages.  If the ScrollingText is in an applet this
  357.      * method returns where the linked pages are displayed.
  358.      *
  359.      * @return Place to display the linked documents.
  360.      * Valid values are "_self" to show in the current frame;
  361.      * "_parent" show in the parent frame;
  362.      * "_top" show in the topmost frame;
  363.      * "_blank" show in a new unnamed top-level window;
  364.      * <name> show in a new top-level window named name
  365.      */
  366.     public String getFrame()
  367.     {
  368.         return frame;
  369.     }
  370.  
  371.     // Overridden methods
  372.  
  373.  
  374.     /**
  375.      * Tells this component that it has been added to a container.
  376.      * This is a standard Java AWT method which gets called by the AWT when
  377.      * this component is added to a container. Typically, it is used to
  378.      * create this component's peer.
  379.      *
  380.      * It has been overridden here to start the scrolling text thread.
  381.      *
  382.      * @see #removeNotify
  383.      */
  384.     public synchronized void addNotify()
  385.     {
  386.         super.addNotify();
  387.         scrollThread = new Thread(this);
  388.         scrollThread.setPriority(Thread.MIN_PRIORITY);
  389.         scrollThread.start();
  390.     }
  391.  
  392.     /**
  393.      * Tells this component that it is being removed from a container.
  394.      * This is a standard Java AWT method which gets called by the AWT when
  395.      * this component is removed from a container. Typically, it is used to
  396.      * destroy the peers of this component and all its subcomponents.
  397.      *
  398.      * It has been overridden here to stop the scrolling text thread.
  399.      *
  400.      * @see #addNotify
  401.      */
  402.     public synchronized void removeNotify() {
  403.         if (scrollThread != null) {
  404.             scrollThread.stop();
  405.             scrollThread = null;
  406.         }
  407.         super.removeNotify();
  408.     }
  409.  
  410.  
  411.     /**
  412.      * Resumes the animation of the scrolling text.
  413.      */
  414.     public void startScrollingText() {
  415.         suspended = false;
  416.         show();
  417.     }
  418.  
  419.  
  420.     /**
  421.      * Suspends the animation of the scrolling text.
  422.      */
  423.     public void stopScrollingText() {
  424.         suspended = true;
  425.     }
  426.  
  427.  
  428.     /**
  429.      * Makes this component visible.
  430.      * This is a standard Java AWT method which gets called to show this
  431.      * component. If this component was invisible due to a previous hide()
  432.      * call it make this component visible again.
  433.      *
  434.      * @see #hide
  435.      */
  436.     public synchronized void show() {
  437.         super.show();
  438.         if (isVisible()) {
  439.             if (scrollThread != null) {
  440.                 scrollThread.setPriority(Thread.MAX_PRIORITY);
  441.                 scrollThread.resume();
  442.             }
  443.         }
  444.     }
  445.  
  446.  
  447.     /**
  448.      * Makes this component invisible.
  449.      * This is a standard Java AWT method which gets called to hide
  450.      * this component. A hidden component cannot be seen by the user nor
  451.      * does it take up space in its container, but it does continue to
  452.      * exist.
  453.      *
  454.      * @see #show
  455.      */
  456.     public synchronized void hide() {
  457.          super.hide();
  458.          if (!isVisible()) {
  459.              if (scrollThread != null)
  460.                 scrollThread.suspend();
  461.          }
  462.     }
  463.  
  464.  
  465.     /**
  466.      * ScrollingText thread body.  This method is called by the Java virtual
  467.      * machine to when this thread starts.
  468.      */
  469.     public void run()
  470.     {
  471.         createTextParams();
  472.         while (true)
  473.         {
  474.             if (!suspended)
  475.             {
  476.                 nextPos();
  477.                 try
  478.                 {
  479.                     Thread.sleep(sleepTime);
  480.                 }
  481.                 catch(Exception e)
  482.                 {
  483.                 }
  484.             }
  485.         }
  486.     }
  487.  
  488.  
  489.     /**
  490.      * Move to next message in message list.  Not usually called directly.
  491.      *
  492.      * @param next if true, move to next message; otherwise reset message with current index
  493.      */
  494.     public void updateCurrentMessage(boolean next)
  495.     {
  496.         //Increase currIndex, try to get message out
  497.         try
  498.         {
  499.             if (next)
  500.                 currIndex++;
  501.             currMessage = messageList[currIndex];
  502.         }
  503.         catch(ArrayIndexOutOfBoundsException e)
  504.         {
  505.             //Index is out of range, reset to zero
  506.             try
  507.             {
  508.                 currIndex = 0;
  509.                 currMessage = messageList[0];
  510.             }
  511.             catch(ArrayIndexOutOfBoundsException e2)
  512.             {
  513.                 //No index is valid at this point
  514.                 currMessage = "";
  515.             }
  516.         }
  517.  
  518.         // Get current link to, if one is there
  519.         try
  520.         {
  521.             currLinkTo = linkToList[currIndex];
  522.         }
  523.         catch(ArrayIndexOutOfBoundsException e)
  524.         {
  525.             currLinkTo = null;
  526.         }
  527.  
  528.         createTextParams();
  529.     }
  530.  
  531.  
  532.     /**
  533.      * Increment scroll step.  Moves to next message as needed. Not usually called directly.
  534.      */
  535.     public synchronized void nextPos()
  536.     {
  537.         Dimension dim = size();
  538.         if (scrollDirection == SCROLL_LEFT)
  539.         {
  540.             textX -= scrollUnit;
  541.             if ((textX + textWidth) < 0)
  542.             {
  543.                 updateCurrentMessage(true);
  544.                 textX = dim.width;
  545.             }
  546.         }
  547.         else
  548.         {
  549.             textX += scrollUnit;
  550.             if (textX > dim.width)
  551.             {
  552.                 updateCurrentMessage(true);
  553.                 textX = -textWidth;
  554.             }
  555.         }
  556.  
  557.         repaint();
  558.     }
  559.  
  560.  
  561.     /**
  562.      * Setup metrics information for current message. Sets textX, textY, textHeight and textWidth.
  563.      */
  564.     protected void createTextParams()
  565.     {
  566.         Font f = getFont();
  567.         if (f != null)
  568.         {
  569.             FontMetrics fm = getFontMetrics(f);
  570.             textHeight = fm.getHeight();
  571.  
  572.             Dimension dim = size();
  573.             textX = dim.width;
  574.             textY = ((dim.height - textHeight) >> 1) + fm.getAscent();
  575.             textWidth = fm.stringWidth(currMessage);
  576.         }
  577.     }
  578.  
  579.     /**
  580.      * Handles redrawing of this component on the screen.
  581.      * This is a standard Java AWT method which gets called by the Java
  582.      * AWT (repaint()) to handle repainting this component on the screen.
  583.      * The graphics context clipping region is set to the bounding rectangle
  584.      * of this component and its <0,0> coordinate is this component's
  585.      * top-left corner.
  586.      * Typically this method paints the background color to clear the
  587.      * component's drawing space, sets graphics context to be the foreground
  588.      * color, and then calls paint() to draw the component.
  589.      *
  590.      * It is overridden here to reduce flicker by eliminating the uneeded
  591.      * clearing of the background.
  592.      *
  593.      * @param g the graphics context
  594.      * @see java.awt.Component#repaint
  595.      * @see #paint
  596.      */
  597.     public void update(Graphics g) {
  598.         //Override update to avoid flashing of text area
  599.         paint(g);
  600.     }
  601.  
  602.  
  603.     /**
  604.      * Determines if the given point is over the current text.
  605.      *
  606.      * @param x horizontal location of point
  607.      * @param y vertical location of point
  608.      *
  609.      * @return true if given point is over the current text
  610.      */
  611.     protected boolean isMouseOverText(int x, int y)
  612.     {
  613.         if (isMouseOver)
  614.         {
  615.             if (x >= textX && x <= textX + textWidth)
  616.             {
  617.                 if (y >= textY - textHeight && y <= textY)
  618.                     return true;
  619.             }
  620.         }
  621.  
  622.         return false;
  623.     }
  624.  
  625.  
  626.     /**
  627.      * Paints this component using the given graphics context.
  628.      * This is a standard Java AWT method which typically gets called
  629.      * by the AWT to handle painting this component. It paints this component
  630.      * using the given graphics context. The graphics context clipping region
  631.      * is set to the bounding rectangle of this component and its <0,0>
  632.      * coordinate is this component's top-left corner.
  633.      *
  634.      * @param g the graphics context used for painting
  635.      * @see java.awt.Component#repaint
  636.      * @see #update
  637.      */
  638.     public void paint(Graphics g)
  639.     {
  640.         //Create an image the size of the component
  641.         Dimension dim = size();
  642.         Image textImage = createImage(dim.width, dim.height);
  643.         Graphics textGC = textImage.getGraphics();
  644.  
  645.         //Draw the background color
  646.         textGC.setColor(getBackground());
  647.         textGC.fillRect(0, 0, dim.width, dim.height);
  648.  
  649.         textGC.setFont(getFont());
  650.  
  651.         //Determine where the mouse is
  652.         boolean mouseOverText = isMouseOverText(lastMouseX, lastMouseY);
  653.         if (mouseOverText != wasMouseOverText)
  654.         {
  655.             if (context != null)
  656.             {
  657.                 String newStatusMessage;
  658.                 if (wasMouseOverText || currLinkTo == null)
  659.                     newStatusMessage = "";
  660.                 else
  661.                     newStatusMessage = currLinkTo.toString();
  662.  
  663.                 //Update status, only if something has changed
  664.                 if (!wasStatusMessage.equals(newStatusMessage))
  665.                 {
  666.                     context.showStatus(newStatusMessage);
  667.                     wasStatusMessage = newStatusMessage;
  668.                 }
  669.             }
  670.  
  671.             wasMouseOverText = mouseOverText;
  672.         }
  673.  
  674.         //Draw the text
  675.         textGC.setColor(mouseOverText && currLinkTo != null ? hiliteColor : getForeground());
  676.         textGC.drawString(currMessage, textX, textY);
  677.         g.drawImage(textImage, 0, 0, this);
  678.  
  679.         //Don't wait for the gc, we know textImage is trash
  680.         textImage.flush();
  681.     }
  682.  
  683.  
  684.     /**
  685.      * Processes MOUSE_MOVE events.
  686.      * This is a standard Java AWT method which gets called by the AWT
  687.      * method handleEvent() in response to receiving a MOUSE_MOVE
  688.      * event. These events occur when the mouse is moved around inside this
  689.      * component while the button is NOT pressed.
  690.      *
  691.      * @param evt the event
  692.      * @param x the component-relative horizontal coordinate of the mouse
  693.      * @param y the component-relative vertical coordinate of the mouse
  694.      *
  695.      * @return always true since the event was handled
  696.      *
  697.      * @see java.awt.Component#mouseDrag
  698.      * @see java.awt.Component#handleEvent
  699.      */
  700.     public boolean mouseMove(Event evt, int x, int y) {
  701.         isMouseOver = true;
  702.  
  703.         //Use this later to determine if the mouse is over the text
  704.         lastMouseX = x;
  705.         lastMouseY = y;
  706.  
  707.         return true;
  708.     }
  709.  
  710.  
  711.     /**
  712.      * Processes MOUSE_EXIT events.
  713.      * This is a standard Java AWT method which gets called by the AWT
  714.      * method handleEvent() in response to receiving a MOUSE_EXIT
  715.      * event. These events occur when the mouse first leaves this
  716.      * component.
  717.      *
  718.      * @param e the event
  719.      * @param x the component-relative horizontal coordinate of the mouse
  720.      * @param y the component-relative vertical coordinate of the mouse
  721.      *
  722.      * @return always true since the event was handled
  723.      *
  724.      * @see java.awt.Component#mouseEnter
  725.      * @see java.awt.Component#handleEvent
  726.      */
  727.     public boolean mouseExit(Event evt, int x, int y) {
  728.         isMouseOver = false;
  729.  
  730.         return true;
  731.     }
  732.  
  733.  
  734.     /**
  735.      * Processes MOUSE_DOWN events.
  736.      * This is a standard Java AWT method which gets called by the AWT
  737.      * method handleEvent() in response to receiving a MOUSE_DOWN
  738.      * event. These events occur when the mouse button is pressed while
  739.      * inside this component.
  740.      *
  741.      * @param e the event
  742.      * @param x the component-relative horizontal coordinate of the mouse
  743.      * @param y the component-relative vertical coordinate of the mouse
  744.      *
  745.      * @return always true since the event was handled
  746.      *
  747.      * @see java.awt.Component#mouseUp
  748.      * @see java.awt.Component#handleEvent
  749.      */
  750.     public boolean mouseDown(Event evt, int x, int y) {
  751.         //If we have somewhere to go and the mouse is over the text
  752.         if (currLinkTo != null && isMouseOverText(x, y))
  753.         {
  754.             if (context != null)
  755.             {
  756.                 if (frame == null || frame.length() == 0)
  757.                     context.showDocument(currLinkTo);
  758.                 else
  759.                     context.showDocument(currLinkTo,frame);
  760.             }
  761.         }
  762.  
  763.         return true;
  764.     }
  765.  
  766.  
  767.     /**
  768.      * Ensures that this component is laid out properly, as needed.
  769.      * This is a standard Java AWT method which gets called by the AWT to
  770.      * make sure this component and its subcomponents have a valid layout.
  771.      * If this component was made invalid with a call to invalidate(), then
  772.      * it is laid out again.
  773.      *
  774.      * It is overridden here to also find the containing applet at validation time.
  775.      *
  776.      * @see java.awt.Component#invalidate
  777.      */
  778.     public void validate()
  779.     {
  780.         // On validation, try to find the containing applet.  If we can find
  781.         // it, we don't bother doing the link...
  782.         Container c = getParent();
  783.  
  784.         while (c != null)
  785.         {
  786.             if (c instanceof Applet)
  787.             {
  788.                 setAppletContext(((Applet) c).getAppletContext());
  789.                 break;
  790.             }
  791.  
  792.             c = c.getParent();
  793.         }
  794.     }
  795.  
  796.  
  797.     /**
  798.      * Specify the current applet context.
  799.      *
  800.      * @param c new applet context
  801.      */
  802.     protected void setAppletContext(AppletContext c)
  803.     {
  804.         context = c;
  805.     }
  806.  
  807.  
  808.     /**
  809.      * Moves and/or resizes this component.
  810.      * This is a standard Java AWT method which gets called to move and/or
  811.      * resize this component. Components that are in containers with layout
  812.      * managers should not call this method, but rely on the layout manager
  813.      * instead.
  814.      *
  815.      * @param x horizontal position in the parent's coordinate space
  816.      * @param y vertical position in the parent's coordinate space
  817.      * @param width the new width
  818.      * @param height the new height
  819.      */
  820.     public synchronized void reshape(int x, int y, int width, int height) {
  821.         super.reshape(x,y,width,height);
  822.  
  823.         createTextParams();
  824.     }
  825. }
  826.