home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / un2maiq4 / pjjava / src / pj / awt / tabnotebook.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  23.7 KB  |  785 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.     Written by the Personal Journal developers of Dow Jones & Company, Inc.
  4.  
  5.     Dow Jones makes no representations or warranties about 
  6.     the suitability of this software, either express or 
  7.     implied, including but not limited to the implied warranties 
  8.     of merchantability, fitness for a particular purpose, 
  9.     or non-infringement.  Dow Jones will not be liable for 
  10.     any damages suffered by a user as a result of using, 
  11.     modifying or distributing this software or its derivatives.
  12.  
  13.  
  14.     @(#)TabNotebook.java  0.00 05-Jan-96
  15.  
  16.         An implementation of Notebook using NotebookTabBar.
  17.  
  18.     Authors:
  19.  
  20.         rphall   Rick Hall
  21.         jlee     James Lee
  22.  
  23.     Version Ident:
  24.  
  25.         $Header: /PjJavaClient/src/pj/awt/TabNotebook.java 3     1/22/96 10:24p Rphall $
  26.  
  27.     History:
  28.  
  29.         0.00 05-Jan-96  rphall      Initial Creation
  30.         0.01 23-Feb-96  Ted S.      Changes to PaperView Interface
  31.               4-Mar-96  jlee        Major change: got rid of Checkbox, replaced custom made Tab
  32.                                     cleaned up the functionality according the change.
  33.                                     changed class name from "CheckboxNb" to "TabNotebook"
  34.                                     changed class name from "CheckboxTabBar" to "NotebookTabBar"
  35.                                     changed class name from "CheckboxTab" to "NotebookTab"
  36.                                     placed NotebookTabBar[CheckboxTabBar]
  37.                                     and NotebookTab[CheckboxTab] in this file instead in separate files.
  38.              12-Mar-96  jlee        Changed layout to make small gap at the bottom.
  39.              21-Mar-96  Ted S.      Update the view index on goto page by name.  So when user clicks
  40.                                     on a tab, the notebook updates which view it is on.
  41.              25-Mar-96  jlee        Modified layoutCOntainer so that it dosn't repeat the same layout change.
  42.              26-mAR-96  Ted S.      Changes to get rid of screen flashing and keep better track
  43.                                     of the current view.
  44. ---------------------------------------------------------------------------*/
  45.  
  46. package pj.awt;
  47.  
  48. import pj.awt.Divider;
  49. import pj.awt.Notebook;
  50. import pj.awt.NotebookTabBar;
  51. import pj.awt.Page;
  52. import pj.awt.PageStack;
  53. import pj.awt.PjFinals;
  54. import pj.awt.StringTabSpec;
  55.  
  56. import collections.ImplementationError;
  57. import java.awt.Canvas;
  58. import java.awt.Color;
  59. import java.awt.Component;
  60. import java.awt.Container;
  61. import java.awt.Dimension;
  62. import java.awt.Graphics;
  63. import java.awt.Insets;
  64. import java.awt.LayoutManager;
  65. import java.awt.Panel;
  66. import java.awt.Rectangle;
  67. import java.lang.String;
  68. import java.lang.Thread;
  69.  
  70. /**
  71.  * An implementation of Notebook using NotebookTabBar.
  72.  *
  73.  * @see     pj.awt.NotebookTabBar
  74.  * @version 0.00 05-Jan-96
  75.  * @author  rphall
  76. */
  77. public class TabNotebook extends Page implements Notebook
  78.     {
  79.  
  80.     /*
  81.      * Note: most navigational operations are implemented via page()
  82.      * in order to guarantee that divider tabs are properly selected.
  83.     */
  84.  
  85.  
  86.     // --- Instance variables
  87.  
  88.     /** The pages displayed to the user */
  89.     protected PageStack   stack;
  90.  
  91.     /** The tab bar */
  92.     NotebookTabBar  tabbar;
  93.  
  94.     // --- Public constructors
  95.  
  96.     /**
  97.      * Create an empty notebook.
  98.     */
  99.     public TabNotebook()
  100.         {
  101.         setLayout( new TabNbPanelLayout( 2, 5 ) );
  102.  
  103.         add( new Notebook3DBorder( Notebook3DBorder.EAST ) );
  104.         add( new Notebook3DBorder( Notebook3DBorder.WEST ) );
  105.         add( new Notebook3DBorder( Notebook3DBorder.NORTH ) );
  106.         add( new Notebook3DBorder( Notebook3DBorder.SOUTH ) );
  107.  
  108.         stack  = new PageStack();
  109.         tabbar = new NotebookTabBar(this);
  110.  
  111.         add( tabbar );
  112.         add( stack );
  113.         System.out.println("Debug-TabNotebook:constructed");
  114.         }
  115.  
  116.     /**
  117.      * Create a notebook with the specified pages.
  118.      * @param pages An array of pages and dividers.
  119.     */
  120.     public TabNotebook(Page[] pages)
  121.         {
  122.         this();
  123.  
  124.         for (int i=0; i<pages.length; i++)
  125.             appendPage(pages[i]);
  126.  
  127.         firstPage();
  128.         }
  129.  
  130.     // --- Public operations
  131.  
  132.     /**
  133.      * Append a page as the last page in a notebook.
  134.      * If name specifies a page that is a divider, the a notebook
  135.      * guarantees that the divider will appear as "tabbed" in the
  136.      * notebook if the tab specification of the divider is an
  137.      * instance of StringTabSpec. (Otherwise the divider is treated
  138.      * as an ordinary page.)
  139.      *
  140.      * @param page  The page to be added.
  141.      * @param ImplementationError thrown if the tab specification of a
  142.      * divider is not
  143.     */
  144.     public void appendPage(Page page)
  145.         {
  146.         stack.appendPage(page);
  147.         if (page instanceof Divider
  148.             && ((Divider)page).getTabSpec() instanceof StringTabSpec )
  149.             {
  150.             Divider d = (Divider)page;
  151.             StringTabSpec sts = (StringTabSpec)d.getTabSpec();
  152.             tabbar.appendTab(sts);
  153.             }
  154.  
  155.         } // appendPage
  156.  
  157.  
  158.     /**
  159.      * @return The count of pages in this notebook.
  160.     */
  161.     public int countPages()
  162.         {
  163.         return stack.countPages();
  164.         }
  165.  
  166.     // --- Public operations: sequential access
  167.  
  168.     /**
  169.      * Make the first page topmost in a stack of pages.
  170.      * If the first page is a divider, a notebook should
  171.      * guarantee that the tab associated with the divider appears selected.
  172.      * If the notebook contains no pages, this operation does nothing.
  173.     */
  174.     public void firstPage()
  175.         {
  176.         String name = stack.firstPage().getName();
  177.  
  178.         page( name );
  179.  
  180.         // Goto the first view of the current page.
  181.         stack.page().firstView();
  182.         tabbar.selectTab( name );
  183.         }
  184.  
  185.     /**
  186.      * Make the next page (after the currently visible page)
  187.      * topmost in a stack of pages.
  188.      * If the next page is a divider, a notebook should
  189.      * guarantee that the tab associated with the divider appears selected.
  190.      * If the last page is already displayed, this operation does nothing.
  191.     */
  192.     public void nextPage()
  193.         {
  194.         String name = stack.nextPage().getName();
  195.  
  196.         page( name );
  197.  
  198.         // Goto the first view of the current page.
  199.         stack.page().firstView();
  200.         tabbar.selectTab( name );
  201.  
  202.         }
  203.  
  204.     /**
  205.      * Make the last page topmost in a stack of pages.
  206.      * If last page is a divider, a notebook should
  207.      * guarantee that the tab associated with the divider appears selected.
  208.      * If the notebook contains no pages, this operation does nothing.
  209.     */
  210.     public void lastPage()
  211.         {
  212.         String name = stack.lastPage().getName();
  213.  
  214.         //page( name );
  215.         tabbar.selectTab( name );
  216.         }
  217.  
  218.     /**
  219.      * Make the previous page (before the currently visible page)
  220.      * topmost in a stack of pages.
  221.      * If the previous page is a divider, a notebook should
  222.      * guarantee that the tab associated with the divider appears selected.
  223.      * If the first page is already displayed, this operation does nothing.
  224.     */
  225.     public void previousPage()
  226.         {
  227.         String name = stack.previousPage().getName();
  228.  
  229.         //page( name );
  230.         tabbar.selectTab( name );
  231.         }
  232.  
  233.  
  234.  
  235.     /**
  236.      * Display a page as topmost in a stack of other pages.
  237.      * If name specifies a page that is a divider, a notebook should
  238.      * guarantee that the tab associated with the divider appears selected.
  239.      * If no page exists with the specified name, this operation
  240.      * does nothing.
  241.      * @param name The name of the page to display.
  242.     */
  243.     public void page(String name)
  244.         {
  245.         Page p = stack.page(name);
  246.         if (p instanceof Divider)
  247.             {
  248.             Divider d = (Divider)p;
  249.             StringTabSpec sts = (StringTabSpec)d.getTabSpec();
  250.             tabbar.selectTab(sts.strTabName);
  251.             }
  252.  
  253.         if (p instanceof Notebook)
  254.             {
  255.             ((Notebook)p).firstPage();
  256.             //((Notebook)p).page(name);
  257.             }
  258.  
  259.         // Goto the first view of the current page.
  260.         stack.page().firstView();
  261.  
  262.  
  263.         } // page
  264.  
  265.  
  266.     /**
  267.      * @return The number of views in an implementation instance.
  268.     */
  269.     public int countViews()
  270.         {
  271.         return countPages();
  272.         }
  273.  
  274.  
  275.  
  276.     /**
  277.      * Make the first view the current view.
  278.     */
  279.     public void firstView()
  280.         {
  281.         // Always call the parents method, because it keeps track of where we are.
  282.         super.firstView();
  283.         firstPage();
  284.         }
  285.  
  286.     /**
  287.      * Make the next view (after the current view) the current view.
  288.      *  a false return means you have hit the end.
  289.     */
  290.     public boolean nextView()
  291.         {
  292.         boolean bRet;
  293.  
  294.         // init
  295.         bRet = true;
  296.  
  297.         // If we can't do a next on the current view, then got to the next view
  298.         // in the notebook  - A view can be made up of another bunch of views.
  299.         if ( stack.page().nextView() == false )
  300.             {
  301.             // Make sure we can do another next,
  302.             //  if not return false.
  303.             if ( super.nextView() )
  304.                 {
  305.                 // Show our next view, in this case the next tab.
  306.                 nextPage();
  307.                 }
  308.             else
  309.                 {
  310.                 // For tab notebook allow wrap around.
  311.                 firstPage();
  312.                 }
  313.             }
  314.  
  315.         return bRet;
  316.         }
  317.  
  318.     /**
  319.      * Make the last view the current view.
  320.     */
  321.     public void lastView()
  322.         {
  323.         super.lastView();
  324.                 // Goto the last view in the page we are about to switch to.
  325.         stack.getPage( countViews() ).lastView();
  326.         lastPage();
  327.         }
  328.  
  329.     /**
  330.      * Make the previous view (before current view) the current view.
  331.      *  a false return means you have hit the end.
  332.     */
  333.     public boolean previousView()
  334.         {
  335.         boolean bRet;
  336.  
  337.  
  338.         // init
  339.         bRet = true;
  340.  
  341.         // If we can not do a prev on the current view, then got to the prev page
  342.         // in the notebook  - A view can be made up of another bunch of views.
  343.         if ( stack.page().previousView() == false )
  344.             {
  345.             // Make sure we can do another next,
  346.             //  if not return false.
  347.             if ( super.previousView() )
  348.                 {
  349.                 // Goto the last view in the page we are about to switch to.
  350.                 stack.getPage( currView() - 1  ).lastView();
  351.  
  352.                 // Show our prev view, in this case the next tab.
  353.                 previousPage();
  354.                 }
  355.             else
  356.                 {
  357.                 // For Tabs allow wrap around.
  358.                 lastView();
  359.                 }
  360.             }
  361.  
  362.         return bRet;
  363.         }
  364.  
  365.  
  366.  
  367.  
  368.     /**
  369.      * Make a specific view the current view.
  370.      * @param idx The index of the view to display.
  371.     */
  372.     public void view(int idx)
  373.         {
  374.         super.view( idx );
  375.         }
  376.  
  377.     /**
  378.      * Get the index of the current view.
  379.      * @return The index of the view being displayed.
  380.     */
  381.     public int currView()
  382.         {
  383.                 return stack.PageNameToIndex( stack.page().getName() );
  384.         }
  385.  
  386.     } // TabNotebook
  387.  
  388.  
  389. /*---------------------------------------------------------------------------
  390.  
  391.     Written by the Personal Journal developers of Dow Jones & Company, Inc.
  392.  
  393.     Dow Jones makes no representations or warranties about 
  394.     the suitability of this software, either express or 
  395.     implied, including but not limited to the implied warranties 
  396.     of merchantability, fitness for a particular purpose, 
  397.     or non-infringement.  Dow Jones will not be liable for 
  398.     any damages suffered by a user as a result of using, 
  399.     modifying or distributing this software or its derivatives.
  400.  
  401.  
  402.     @(#)Notebook3DBorder.java   0.00 2-Mar-96
  403.  
  404.         Notebook3DBorder that implements 3D border line.
  405.  
  406.     Authors:
  407.  
  408.         jlee        James Lee
  409.  
  410.     Version Ident:
  411.  
  412.         $Header$
  413.  
  414.     History:
  415.  
  416.          2-Mar-96    jlee   Initial creation.
  417.  
  418. ---------------------------------------------------------------------------*/
  419.  
  420. /**
  421.  * Notebook3DBorder is used to mimic 3D effect as a line.
  422.  * @version     0.00, 2-Mar-96
  423.  * @author      James Lee
  424.  */
  425. class Notebook3DBorder extends Canvas
  426.     {
  427.  
  428.     // --- Class variables
  429.  
  430.     public static final int EAST    = 1;
  431.     public static final int WEST    = 2;
  432.     public static final int NORTH   = 3;
  433.     public static final int SOUTH   = 4;
  434.  
  435.  
  436.  
  437.     // --- Instance variables
  438.  
  439.     private int n3dLinePanelWidth;
  440.     private int n3dLinePanelHeight;
  441.     private int nDirection;
  442.  
  443.  
  444.     // --- Public constructors
  445.     /**
  446.      * Constructs a Notebook3DBorder.
  447.      */
  448.     public Notebook3DBorder( int nDir )
  449.         {
  450.         nDirection = nDir;
  451.         }
  452.  
  453.     // --- Public operations
  454.     /**
  455.      * Paint the canvas with 3D line based on the direction.
  456.      */
  457.     public void paint(Graphics g)
  458.         {
  459.         int i;
  460.  
  461.         switch ( nDirection )
  462.             {
  463.             case EAST:
  464.                 for ( i = 4; i < 6; i++ )
  465.                     {
  466.                     g.setColor( Color.white );
  467.                     g.drawLine( n3dLinePanelWidth - i, 0, n3dLinePanelWidth - i, n3dLinePanelHeight );
  468.                     }
  469.                 break;
  470.  
  471.             case WEST:
  472.                 for ( i = 4; i < 6; i++ )
  473.                     {
  474.                     g.setColor( Color.gray );
  475.                     g.drawLine( i, n3dLinePanelHeight, i, 0 );
  476.                     }
  477.                 break;
  478.  
  479.             case NORTH:
  480.                 for ( i = 4; i < 6; i++ )
  481.                     {
  482.                     g.setColor( Color.gray );
  483.                     g.drawLine( 0, i, n3dLinePanelWidth, i );
  484.                     }
  485.                 break;
  486.  
  487.             case SOUTH:
  488.                 for ( i = 0; i < 4; i++ )
  489.                     {
  490.                     g.setColor( Color.white );
  491.                     g.drawLine( n3dLinePanelWidth, n3dLinePanelHeight - i, 0, n3dLinePanelHeight - i );
  492.                     }
  493.                 break;
  494.             }//switch
  495.         }
  496.  
  497.     /**
  498.      * Overides reshape funxtion so that we can catch size change.
  499.      */
  500.     public synchronized void reshape(int x, int y, int width, int height)
  501.         {
  502.         n3dLinePanelWidth = width;
  503.         n3dLinePanelHeight = height;
  504.  
  505.         super.reshape(x, y, width, height);
  506.  
  507.         repaint();
  508.         }
  509.  
  510.     }//Notebook3DBorder
  511.  
  512. /*---------------------------------------------------------------------------
  513.  
  514.     Written by the Personal Journal developers of Dow Jones & Company, Inc.
  515.  
  516.     Dow Jones makes no representations or warranties about 
  517.     the suitability of this software, either express or 
  518.     implied, including but not limited to the implied warranties 
  519.     of merchantability, fitness for a particular purpose, 
  520.     or non-infringement.  Dow Jones will not be liable for 
  521.     any damages suffered by a user as a result of using, 
  522.     modifying or distributing this software or its derivatives.
  523.  
  524.  
  525.     @(#)TabNbPanelLayout.java   0.00 5-Feb-96
  526.  
  527.          TabNbPanelLayout that manages Tabs Panel layout.
  528.  
  529.     Authors:
  530.  
  531.         jlee        James Lee
  532.  
  533.     Version Ident:
  534.  
  535.         $Header$
  536.  
  537.     History:
  538.  
  539.          2-Mar-96    jlee   Initial creation.
  540.  
  541. ---------------------------------------------------------------------------*/
  542.  
  543. /**
  544.  * TabNbPanelLayout is used to layout Tabs panel and 3D lines in a panel.
  545.  * @version     0.00, 2-Mar-96
  546.  * @author      James Lee
  547.  */
  548. class TabNbPanelLayout implements LayoutManager
  549.     {
  550.  
  551.     // --- Instance variables
  552.  
  553.     private int hgap;
  554.     private int vgap;
  555.  
  556.     private int PanelWidth;
  557.     private int PanelHeight;
  558.  
  559.     private Rectangle recLast = new Rectangle(0, 0, 0, 0);
  560.  
  561.     /**
  562.      * Constructs a new TabNbPanelLayout.
  563.      * Default value for hgap and vgap is 0.
  564.      */
  565.     public TabNbPanelLayout()
  566.         {
  567.         this(0, 0);
  568.         }
  569.  
  570.     /**
  571.      * Constructs a new TabNbPanelLayout with the specified gap values.
  572.      * @param hgap the horizontal gap variable
  573.      * @param vgap the vertical gap variable
  574.      */
  575.     public TabNbPanelLayout(int hgap, int vgap)
  576.         {
  577.         this.hgap = hgap;
  578.         this.vgap = vgap;
  579.         }
  580.  
  581.     /**
  582.      * Adds the specified component to the layout. Not used by this class.
  583.      * @param name the name of the component
  584.      * @param comp the the component to be added
  585.      */
  586.     public void addLayoutComponent(String name, Component comp)
  587.         {
  588.         }
  589.  
  590.     /**
  591.      * Removes the specified component from the layout. Not used by
  592.      * this class.
  593.      * @param comp the component to remove
  594.      */
  595.     public void removeLayoutComponent(Component comp)
  596.         {
  597.         }
  598.  
  599.     /**
  600.      * Returns the preferred dimensions for this layout given the components
  601.      * in the specified target container.
  602.      * @param target the component which needs to be laid out
  603.      * @see Container
  604.      * @see #minimumLayoutSize
  605.      */
  606.     public Dimension preferredLayoutSize(Container target)
  607.         {
  608.         Dimension dim = new Dimension(0, 0);
  609.         int nmembers = target.countComponents();
  610.  
  611.         for (int i = 0 ; i < nmembers ; i++)
  612.             {
  613.             Component m = target.getComponent(i);
  614.  
  615.             if (m.isVisible())
  616.                 {
  617.                 Dimension d = m.preferredSize();
  618.                 dim.height += d.height;
  619.                 dim.width  += d.width;
  620.  
  621.                 if (i > 0)
  622.                     {
  623.                     dim.width += hgap;
  624.                     dim.height += vgap;
  625.                     }
  626.                 }
  627.             }  // for
  628.  
  629.         dim.height /= 3;
  630.         dim.width  /= 4;
  631.  
  632.         Insets insets = target.insets();
  633.         dim.width += insets.left + insets.right + hgap*2;
  634.         dim.height += insets.top + insets.bottom + vgap*2;
  635.  
  636.         return dim;
  637.         }
  638.  
  639.     /**
  640.      * Returns the minimum dimensions needed to layout the components
  641.      * contained in the specified target container.
  642.      * @param target the component which needs to be laid out
  643.      * @see #preferredLayoutSize
  644.      */
  645.     public Dimension minimumLayoutSize(Container target)
  646.         {
  647.         Dimension dim = new Dimension(0, 0);
  648.         int nmembers = target.countComponents();
  649.  
  650.         for (int i = 0 ; i < nmembers ; i++)
  651.             {
  652.             Component m = target.getComponent(i);
  653.  
  654.             if (m.isVisible())
  655.                 {
  656.                 Dimension d = m.minimumSize();
  657.                 dim.height += d.height;
  658.                 dim.width  += d.width;
  659.  
  660.                 if (i > 0)
  661.                     {
  662.                     dim.width += hgap;
  663.                     dim.height += vgap;
  664.                     }
  665.                 }
  666.             }// for
  667.  
  668.         dim.height /= 3;
  669.         dim.width  /= 4;
  670.  
  671.         Insets insets = target.insets();
  672.         dim.width += insets.left + insets.right + hgap*2;
  673.         dim.height += insets.top + insets.bottom + vgap*2;
  674.  
  675.         return dim;
  676.         }
  677.  
  678.  
  679.     /**
  680.      * Lays out the container. This method will actually reshape the
  681.      * components in the target in order to satisfy the constraints of
  682.      * the TabNbPanelLayout object.
  683.      * @param target the specified component being laid out.
  684.      * @see Container
  685.      */
  686.     public void layoutContainer(Container target)
  687.         {
  688.         Thread.currentThread().setPriority( Thread.MAX_PRIORITY );
  689.  
  690.         Insets insets = target.insets();
  691.         Rectangle rec = target.bounds();
  692.  
  693.         if ( target.isValid() &&
  694.              rec.x == recLast.x && rec.y == recLast.y &&
  695.              rec.width == recLast.width && rec.height == recLast.height  )
  696.             return;
  697.         else
  698.             recLast = rec;
  699.  
  700.         PanelWidth  = rec.width;
  701.         PanelHeight = rec.height;
  702.  
  703.         int nBorderMargin   = 4;
  704.         int nBorderWidth    = 6;
  705.  
  706.         int tabWidth    = (rec.width - nBorderMargin * 2) / 6;
  707.         int tabHeight   = PjFinals.nTab3DHeight;
  708.  
  709.         int nStatusBarWidth1    = ( rec.width - nBorderMargin * 2 ) * 21 / 28;
  710.         int nStatusBarWidth2    = rec.width - nBorderMargin * 2 - nStatusBarWidth1 - hgap - 1;
  711.         int nBottomOffset       = PjFinals.nStatusBarHeight + 4;
  712.  
  713.         int nmembers    = target.countComponents();
  714.  
  715.         for (int i = 0 ; i < nmembers ; i++)
  716.             {
  717.             Component m = target.getComponent(i);
  718.  
  719.             if ( m.isVisible() )
  720.                 {
  721.                 if ( i < 4 )
  722.                     {
  723.                     switch ( i )
  724.                         {
  725.                         case 0://East 3d Border
  726.                             m.reshape( rec.width - nBorderWidth - 1, nBorderWidth,
  727.                                        nBorderWidth + 1,
  728.                                        rec.height - tabHeight - nBorderWidth - nBottomOffset - vgap );
  729.                             break;
  730.                         case 1://West 3d Border
  731.                             m.reshape( 0, nBorderMargin,
  732.                                        nBorderWidth - 1,
  733.                                        rec.height - tabHeight - nBorderWidth - nBottomOffset - vgap );
  734.                             break;
  735.                         case 2://North 3d Border
  736.                             m.reshape( nBorderMargin, 0, rec.width - nBorderMargin - nBorderWidth,
  737.                                        nBorderWidth + 1 );
  738.                             break;
  739.                         case 3://South 3d Border
  740.                             m.reshape( nBorderWidth,
  741.                                        rec.height - 2 - tabHeight - nBottomOffset - vgap,
  742.                                        rec.width - nBorderMargin - nBorderWidth, 2 );
  743.                             break;
  744.                         }//switch
  745.                     }  //if
  746.                 else
  747.                 if ( i == 4 ) //TabBar
  748.                     m.reshape( nBorderMargin, rec.height - tabHeight - nBottomOffset - vgap,
  749.                                rec.width - nBorderMargin * 2, tabHeight );
  750.                 else
  751.                 if ( i == 5 ) //Center notebook
  752.                     {
  753.                     m.reshape( nBorderWidth + 2, 36 + nBorderWidth + 2, rec.width - (nBorderWidth + 2) * 2,
  754.                                rec.height - tabHeight - (nBorderWidth + 2) * 2 - 36 - nBottomOffset - vgap );
  755.                     m.validate();
  756.                     }
  757.                 else
  758.                 if ( i == 6 ) //Ticker
  759.                     m.reshape( nBorderWidth + 2, nBorderWidth + 2,
  760.                                rec.width - (nBorderWidth + 2) * 2, 36 );
  761.                 else
  762.                 if ( i == 7 ) //Status bar 1
  763.                     m.reshape( nBorderMargin, rec.height - nBottomOffset,
  764.                                nStatusBarWidth1, PjFinals.nStatusBarHeight );
  765.                 else
  766.                 if ( i == 8 ) //Status bar 2
  767.                     m.reshape( nBorderMargin + nStatusBarWidth1 + hgap,
  768.                                rec.height - nBottomOffset,
  769.                                nStatusBarWidth2,
  770.                                PjFinals.nStatusBarHeight );
  771.                 }//if
  772.             }//for
  773.         }
  774.  
  775.     /**
  776.      * Returns the String representation of this TabNbPanelLayout's values.
  777.      */
  778.     public String toString()
  779.         {
  780.         return  getClass().getName() + "[hgap=" + hgap + ",vgap=" + vgap + "]" +
  781.                 "[width=" + PanelWidth + ",height=" + PanelHeight + "]";
  782.         }
  783.  
  784.     }//TabNbPanelLayout
  785.