org.objectweb.cjdbc.console.views
Class InfoViewer

java.lang.Object
  extended byorg.objectweb.cjdbc.console.views.InfoViewer
Direct Known Subclasses:
BackendViewer, CacheStatsViewer, CacheViewer, ClientsViewer, ControllerLoadViewer, DatabasesViewer, RecoveryLogViewer, SchedulerViewer, SQLStatViewer

public abstract class InfoViewer
extends java.lang.Object

Graphical SQL statistics viewer. Quick and dirty implementation.

Version:
1.0
Author:
Mathieu Peltier , Emmanuel Cecchet

Nested Class Summary
protected  class InfoViewer.ExportAction
          InfoViewer export action.
(package private)  class InfoViewer.InfoTableModel
          This class defines a InfoTableModel
protected  class InfoViewer.InfoViewerMenuBar
          SQLStatViewer menu bar.
 
Field Summary
protected  java.lang.String actionErrorMessage
           
protected  java.lang.String actionSuccessMessage
           
protected  java.lang.String actionToolTipText
           
private  java.lang.String[] columnNames
           
private  java.lang.Object[][] data
           
private  javax.swing.JFrame frame
           
protected  java.lang.String frameTitle
           
protected  java.lang.String infoViewerMenuBarString
           
private  InfoViewer.InfoTableModel model
           
private  javax.swing.JPanel panel
           
private  InfoTableSorter sorter
           
protected  java.lang.String tableHeaderToolTipText
           
 
Constructor Summary
InfoViewer(java.lang.Object[][] data)
          Create a InfoViewer
 
Method Summary
private  void createAndShowGUI()
          For thread safety, this method should be invoked from the event-dispatching thread.
 void display()
          Create the GUI and show it.
 java.lang.String displayText(java.lang.Object[][] data)
          Display text.
 java.lang.String displayText(java.lang.String[][] data)
          Format data for text consoles
abstract  java.lang.String[] getColumnNames()
          Get column names
 java.lang.Object[][] getData()
           
protected abstract  java.lang.Object[][] getDataTypes(java.lang.Object[][] stats)
          Subclasses should overide this method to get coherent sorting
 java.lang.String getFrameTitle()
           
 int[] getTraceableColumns()
          Return the list of traceable data for this viewer
abstract  void setLabels()
          Set the labels for the frame
 void updateData(java.lang.Object[][] data)
          Update the data in the InfoTableModel and refresh the frame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sorter

private InfoTableSorter sorter

panel

private javax.swing.JPanel panel

frame

private javax.swing.JFrame frame

model

private InfoViewer.InfoTableModel model

columnNames

private java.lang.String[] columnNames

frameTitle

protected java.lang.String frameTitle

infoViewerMenuBarString

protected java.lang.String infoViewerMenuBarString

actionToolTipText

protected java.lang.String actionToolTipText

actionErrorMessage

protected java.lang.String actionErrorMessage

actionSuccessMessage

protected java.lang.String actionSuccessMessage

tableHeaderToolTipText

protected java.lang.String tableHeaderToolTipText

data

private java.lang.Object[][] data
Constructor Detail

InfoViewer

public InfoViewer(java.lang.Object[][] data)
Create a InfoViewer

Parameters:
data - Stats to display in the table
Method Detail

getDataTypes

protected abstract java.lang.Object[][] getDataTypes(java.lang.Object[][] stats)
Subclasses should overide this method to get coherent sorting

Parameters:
stats - to display
Returns:
same sized objects array but with proper types default is strings only

getColumnNames

public abstract java.lang.String[] getColumnNames()
Get column names

Returns:
a array of strings

getTraceableColumns

public int[] getTraceableColumns()
Return the list of traceable data for this viewer

Returns:
an array of names

setLabels

public abstract void setLabels()
Set the labels for the frame


updateData

public void updateData(java.lang.Object[][] data)
Update the data in the InfoTableModel and refresh the frame

Parameters:
data - fresh and new

createAndShowGUI

private void createAndShowGUI()
For thread safety, this method should be invoked from the event-dispatching thread.


displayText

public java.lang.String displayText(java.lang.Object[][] data)
Display text. This allows to show text without loading graphic contents

Parameters:
data - to display
Returns:
a formatted String

displayText

public java.lang.String displayText(java.lang.String[][] data)
Format data for text consoles

Parameters:
data - to display
Returns:
a formatted string with tabs and end of line

display

public void display()
Create the GUI and show it.


getFrameTitle

public java.lang.String getFrameTitle()
Returns:
Returns the frameTitle.

getData

public java.lang.Object[][] getData()
Returns:
Returns the data.


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.