Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

ClientsViewer.java

00001 /**
00002  * C-JDBC: Clustered JDBC.
00003  * Copyright (C) 2002-2004 French National Institute For Research In Computer
00004  * Science And Control (INRIA).
00005  * Contact: c-jdbc@objectweb.org
00006  * 
00007  * This library is free software; you can redistribute it and/or modify it
00008  * under the terms of the GNU Lesser General Public License as published by the
00009  * Free Software Foundation; either version 2.1 of the License, or any later
00010  * version.
00011  * 
00012  * This library is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
00015  * for more details.
00016  * 
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with this library; if not, write to the Free Software Foundation,
00019  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00020  *
00021  * Initial developer(s): Emmanuel Cecchet.
00022  * Contributor(s): Mathieu Peltier.
00023  */
00024 
00025 package org.objectweb.cjdbc.console.views;
00026 
00027 import org.objectweb.cjdbc.common.i18n.Translate;
00028 
00029 /**
00030  * Graphical statistics viewer. Quick and dirty implementation.
00031  * 
00032  * @author <a href="mailto:Mathieu.Peltier@inrialpes.fr">Mathieu Peltier</a>
00033  * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet</a>
00034  * @version 1.0
00035  */
00036 public class ClientsViewer extends InfoViewer
00037 {
00038   static final int COLUMNS = 8;
00039 
00040   /**
00041    * Create a Client viewer
00042    * 
00043    * @param data Stats to display in the table
00044    */
00045   public ClientsViewer(Object[][] data)
00046   {
00047     super(data);
00048   }
00049 
00050   protected Object[][] getDataTypes(Object[][] stats)
00051   {
00052     int iSize = stats.length;
00053     Object[][] ret = new Object[iSize][];
00054     for (int i = 0; i < iSize; i++)
00055     {
00056       String[] aStat = (String[]) stats[i];
00057       int jSize = aStat.length;
00058       ret[i] = new Object[jSize];
00059       ret[i][0] = aStat[0];
00060       for (int j = 1; j < jSize; j++)
00061       {
00062         if (j == 0 ||j == 1)
00063           ret[i][j] = new String(aStat[j]);
00064         else if (j == 2 ||j == 3)
00065           ret[i][j] = new Integer(aStat[j]);
00066         else if (j == 4)
00067           ret[i][j] = new Boolean(aStat[j]);
00068         else if (j == 5 || j==6 || j==7)
00069           ret[i][j] = new Long(aStat[j]);
00070       }
00071     }
00072     return ret;
00073   }
00074 
00075   /**
00076    * @see InfoViewer#getColumnNames()
00077    */
00078   public String[] getColumnNames()
00079   {
00080     String[] columnNames = new String[COLUMNS];
00081     columnNames[0] = Translate.get("console.infoviewer.clients.column.0");
00082     columnNames[1] = Translate.get("console.infoviewer.clients.column.1");
00083     columnNames[2] = Translate.get("console.infoviewer.clients.column.2");
00084     columnNames[3] = Translate.get("console.infoviewer.clients.column.3");
00085     columnNames[4] = Translate.get("console.infoviewer.clients.column.4");
00086     columnNames[5] = Translate.get("console.infoviewer.clients.column.5");
00087     columnNames[6] = Translate.get("console.infoviewer.clients.column.6");
00088     columnNames[7] = Translate.get("console.infoviewer.clients.column.7");
00089     return columnNames;
00090   }
00091 
00092   /**
00093    * @see InfoViewer#setLabels()
00094    */
00095   public void setLabels()
00096   {
00097     frameTitle = Translate.get("console.infoviewer.clients.frame.title");
00098     infoViewerMenuBarString = Translate.get("console.infoviewer.clients.menubar");
00099     actionToolTipText = Translate
00100         .get("console.infoviewer.clients.action.tooltiptext");
00101     actionErrorMessage = Translate
00102         .get("console.infoviewer.clients.action.error.message");
00103     actionSuccessMessage = Translate
00104         .get("console.infoviewer.clients.action.success.message");
00105     tableHeaderToolTipText = Translate
00106         .get("console.infoviewer.table.tooltip.text");
00107   }
00108 
00109 }

Generated on Mon Apr 11 22:01:30 2005 for C-JDBC by  doxygen 1.3.9.1