|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectappli.sqlplayer.util.Mediator
Title:
Description: Mediateur suivant le "mediator pattern" pour gerer la communication entre les composants d'une interface
Copyright: Copyright (c) 2003
Company:
Field Summary | |
private AppProperties |
appProperties
|
private javax.swing.JTree |
catTree
|
private CComboBox |
cbDatabase
|
private javax.swing.JCheckBox |
chbExecTime
|
private javax.swing.JCheckBox |
chbNbRows
|
private javax.swing.JCheckBox |
chbSQLCmd
|
private javax.swing.JCheckBox |
chbSQLCmdDescr
|
private static Chrono |
chrono
|
private Sqlcmd |
curSqlcmd
|
private Database |
database
|
private java.awt.Frame |
mainFrame
|
private static Mediator |
mediator
|
private int |
nbRows
|
private CFontDefinitionPanel |
pFont
|
private javax.swing.JRadioButton |
rbTable
|
private javax.swing.JRadioButton |
rbTree
|
private javax.swing.JTable |
resTable
|
private javax.swing.tree.DefaultMutableTreeNode |
root
|
private java.lang.String |
sqlcmdExecuted
|
private SqlCommands |
sqlCommands
|
private javax.swing.JTable |
sqlTable
|
private javax.swing.JTable |
sqlTable2
|
private CTabbedPane |
tabbedPane
|
Constructor Summary | |
private |
Mediator()
Constructor. |
Method Summary | |
void |
addSons(java.util.ArrayList listCat,
java.lang.String father,
javax.swing.tree.DefaultMutableTreeNode node)
Ajout des categories (noeuds fils) d'un arbre |
void |
calcColumnWidths(javax.swing.JTable table)
Calcul de la taille ideale pour les colonnes d'une table. |
void |
clearResultTable(javax.swing.JTable table)
Effacement des donnees d'une JTable dont le contenu repose sur un modele ResultSet |
void |
clearTable(javax.swing.JTable table)
Effacement des donnees d'une JTable dont le contenu repose sur un modele |
void |
displayPartResultTable(javax.swing.JTable table,
java.sql.ResultSet rs,
int beg,
int end)
Affichage d'une partie des resultats dans une JTable |
void |
displayResultTable(javax.swing.JTable table,
java.sql.ResultSet rs)
Affichage de la totalite des resultats dans une JTable |
void |
displayResultText(javax.swing.JTextArea txtArea,
DisplayResultFormat drf,
int nbToDisplay,
java.lang.Object resQuery)
Affichage des resultats de la commande SQL au format texte dans une zone de texte |
void |
displayResultText(javax.swing.JTextArea txtArea,
DisplayResultFormat drf,
java.lang.Object resQuery)
Affichage des resultats de la commande SQL au format texte dans une zone de texte |
void |
displayTable(javax.swing.JTable table,
SqlCommands sqlcommands)
Affichage de la liste des commandes sous forme d'une table |
void |
displayTree(SqlCommands sqlcommands)
Creation of the category tree |
void |
executeAndDisplay()
Execution de la commande SQL courante et affichage du resultat |
java.lang.Object |
executeCommand(java.lang.String cmdSQL)
Execution d'une commande SQL |
AppProperties |
getAppProperties()
Get application properties |
javax.swing.JCheckBox |
getChbExecTime()
|
javax.swing.JCheckBox |
getChbNbRows()
|
javax.swing.JCheckBox |
getChbSQLCmd()
|
javax.swing.JCheckBox |
getChbSQLCmdDescr()
|
Chrono |
getChrono()
get the stop watch |
Sqlcmd |
getCurSqlcmd()
|
Database |
getDatabase()
|
java.awt.Frame |
getMainFrame()
Get the main frame |
static Mediator |
getMediator()
Acquire the (unique) mediator. |
int |
getNbRows()
|
CFontDefinitionPanel |
getPFont()
|
private int |
getPreferredRowHeight(javax.swing.JTable table,
int rowIndex,
int margin)
Calcule la hauteur ideale pour une table et une ligne donnees. |
javax.swing.JRadioButton |
getRbTable()
Get the command table display Radio button |
javax.swing.JRadioButton |
getRbTree()
Get the SQL command tree display Radio button |
javax.swing.JTable |
getResTable()
|
javax.swing.tree.DefaultMutableTreeNode |
getRoot()
|
java.lang.String |
getSqlcmdExecuted()
|
SqlCommands |
getSqlCommands()
|
javax.swing.JTable |
getSqlTable()
|
javax.swing.JTable |
getSQLTable2()
|
CTabbedPane |
getTabbedPane()
Get TabbedPane |
java.util.ArrayList |
getValueList(java.lang.String sqlRequest)
Queries the database with the submitted command. |
void |
packRows(javax.swing.JTable table,
int margin)
La hauteur de chaque ligne de la table est positionnee en fonction de la hauteur ideale de la plus haute cellule dans cette ligne. |
void |
packRows(javax.swing.JTable table,
int start,
int end,
int margin)
Pour chaque ligne de l'intervalle specifie par start et end, la hauteur est positionnee en fonction de la hauteur ideale de la plus haute cellule dans cette ligne. |
void |
registerAppProperties(AppProperties appProperties)
Register application properties |
void |
registerCatTree(javax.swing.JTree catTree)
|
void |
registerCbDatabase(CComboBox cbDatabase)
|
void |
registerChbExecTime(javax.swing.JCheckBox chbExecTime)
Register execution time display checkbox |
void |
registerChbNbRows(javax.swing.JCheckBox chbNbRows)
Register row number display checkbox |
void |
registerChbSQLCmd(javax.swing.JCheckBox chbSQLCmd)
Register SQL Command display checkbox |
void |
registerChbSQLCmdDescr(javax.swing.JCheckBox chbSQLCmdDescr)
Register SQL Command description checkbox |
void |
registerDatabase(Database database)
|
void |
registerJTable(javax.swing.JTable table)
|
void |
registerMainFrame(java.awt.Frame fr)
Register the application main frame |
void |
registerNbRows(int nbrows)
Register number of rows to display simultaneously |
void |
registerPFont(CFontDefinitionPanel pfont)
Register font definition panel |
void |
registerRbTable(javax.swing.JRadioButton rbTable)
Register SQL command table display Radio button |
void |
registerRbTree(javax.swing.JRadioButton rbTree)
Register SQL command tree display Radio button |
void |
registerResTable(javax.swing.JTable resTable)
|
void |
registerRoot(javax.swing.tree.DefaultMutableTreeNode root)
|
void |
registerSqlCommands(SqlCommands sqlCommands)
|
void |
registerSqlTable2(javax.swing.JTable sqlTable2)
|
void |
registerTabbedPane(CTabbedPane tabbedPane)
Register the main tabbed pane |
void |
setCurSqlcmd(Sqlcmd curSqlcmd)
|
void |
setDatabase(Database database)
|
void |
setSqlcmdExecuted(java.lang.String sqlcmdExecuted)
|
void |
setSqlCommands(SqlCommands sqlCommands)
|
void |
writeResultText(java.io.OutputStream output,
DisplayResultFormat drf,
java.lang.Object resQuery)
Affichage des resultats de la commande SQL au format texte dans une sortie outputstream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static Mediator mediator
private java.awt.Frame mainFrame
private AppProperties appProperties
private static Chrono chrono
private javax.swing.JRadioButton rbTable
private javax.swing.JRadioButton rbTree
private javax.swing.JCheckBox chbSQLCmdDescr
private javax.swing.JCheckBox chbSQLCmd
private javax.swing.JCheckBox chbExecTime
private javax.swing.JCheckBox chbNbRows
private CFontDefinitionPanel pFont
private int nbRows
private CTabbedPane tabbedPane
private javax.swing.JTable sqlTable
private javax.swing.JTable sqlTable2
private javax.swing.JTable resTable
private CComboBox cbDatabase
private javax.swing.JTree catTree
private javax.swing.tree.DefaultMutableTreeNode root
private Database database
private SqlCommands sqlCommands
private Sqlcmd curSqlcmd
private java.lang.String sqlcmdExecuted
Constructor Detail |
private Mediator()
Method Detail |
public static Mediator getMediator()
public void registerAppProperties(AppProperties appProperties)
appProperties
- application propertiespublic AppProperties getAppProperties()
public void registerMainFrame(java.awt.Frame fr)
fr
- framepublic java.awt.Frame getMainFrame()
public Chrono getChrono()
public void registerTabbedPane(CTabbedPane tabbedPane)
tabbedPane
- general tabbed pane, containing all the tabspublic CTabbedPane getTabbedPane()
public void registerRbTable(javax.swing.JRadioButton rbTable)
rbTable
- radio buttonpublic javax.swing.JRadioButton getRbTable()
public void registerRbTree(javax.swing.JRadioButton rbTree)
rbTree
- radio buttonpublic javax.swing.JRadioButton getRbTree()
public void registerChbSQLCmdDescr(javax.swing.JCheckBox chbSQLCmdDescr)
chbSQLCmdDescr
- SQL Command description checkboxpublic javax.swing.JCheckBox getChbSQLCmdDescr()
public void registerChbSQLCmd(javax.swing.JCheckBox chbSQLCmd)
chbSQLCmd
- SQL Command display checkboxpublic javax.swing.JCheckBox getChbSQLCmd()
public void registerChbExecTime(javax.swing.JCheckBox chbExecTime)
chbExecTime
- execution time display checkboxpublic javax.swing.JCheckBox getChbExecTime()
public void registerChbNbRows(javax.swing.JCheckBox chbNbRows)
chbNbRows
- row number display checkboxpublic javax.swing.JCheckBox getChbNbRows()
public void registerPFont(CFontDefinitionPanel pfont)
pfont
- font definition panelpublic CFontDefinitionPanel getPFont()
public void registerNbRows(int nbrows)
nbrows
- number of rows to display simultaneouslypublic int getNbRows()
public void registerCbDatabase(CComboBox cbDatabase)
public void registerJTable(javax.swing.JTable table)
public void registerCatTree(javax.swing.JTree catTree)
public void registerSqlTable2(javax.swing.JTable sqlTable2)
public void registerRoot(javax.swing.tree.DefaultMutableTreeNode root)
public void registerDatabase(Database database)
public void registerSqlCommands(SqlCommands sqlCommands)
public void registerResTable(javax.swing.JTable resTable)
public Database getDatabase()
public SqlCommands getSqlCommands()
public javax.swing.JTable getSqlTable()
public javax.swing.JTable getSQLTable2()
public javax.swing.tree.DefaultMutableTreeNode getRoot()
public Sqlcmd getCurSqlcmd()
public javax.swing.JTable getResTable()
public java.lang.String getSqlcmdExecuted()
public void setSqlCommands(SqlCommands sqlCommands)
public void setDatabase(Database database)
public void setCurSqlcmd(Sqlcmd curSqlcmd)
public void setSqlcmdExecuted(java.lang.String sqlcmdExecuted)
public void displayTable(javax.swing.JTable table, SqlCommands sqlcommands)
table
- table dans laquelle sont affichees les commandessqlcommands
- commandes SQL a afficherpublic void clearTable(javax.swing.JTable table)
table
- JTable dont on veut effacer les donneespublic void clearResultTable(javax.swing.JTable table)
table
- JTable dont on veut effacer les donneespublic void displayTree(SqlCommands sqlcommands)
sqlcommands
- SqlCommands object used to display the treepublic void addSons(java.util.ArrayList listCat, java.lang.String father, javax.swing.tree.DefaultMutableTreeNode node)
listCat
- liste des categoriesfather
- chemin du noeud pere auquel sont rattaches les noeuds filsnode
- noeud perepublic java.lang.Object executeCommand(java.lang.String cmdSQL)
cmdSQL
- commande SQL a executer
public void displayResultText(javax.swing.JTextArea txtArea, DisplayResultFormat drf, java.lang.Object resQuery)
txtArea
- zone de texte dans laquelle est effectue l'affichagedrf
- strategie d'affichageresQuery
- objet a afficherpublic void displayResultText(javax.swing.JTextArea txtArea, DisplayResultFormat drf, int nbToDisplay, java.lang.Object resQuery)
txtArea
- zone de texte dans laquelle est effectue l'affichagedrf
- display modenbToDisplay
- number of objects to displayresQuery
- result set to displaypublic void displayResultTable(javax.swing.JTable table, java.sql.ResultSet rs)
table
- JTable dans laquelle sont affiches les resultatspublic void displayPartResultTable(javax.swing.JTable table, java.sql.ResultSet rs, int beg, int end)
table
- JTable dans laquelle sont affiches les resultatsbeg
- indice de debut d'affichageend
- indice de fin d'affichagepublic void calcColumnWidths(javax.swing.JTable table)
table
- table dont on veut dimensionner les colonnespublic void packRows(javax.swing.JTable table, int margin)
table
- JTable pour laquelle on veut connaitre la hauteur idealemargin
- marge pour les lignespublic void packRows(javax.swing.JTable table, int start, int end, int margin)
table
- JTable pour laquelle on veut connaitre la hauteur idealestart
- indice de la 1ere ligne a traiterend
- indice de la derniere ligne a traiter (non comprise)margin
- marge pour les lignesprivate int getPreferredRowHeight(javax.swing.JTable table, int rowIndex, int margin)
table
- JTable pour laquelle on veut connaitre la hauteur idealerowIndex
- ligne pour laquelle on veut connaitre la hauteur idealemargin
- marge pour la ligne
public void writeResultText(java.io.OutputStream output, DisplayResultFormat drf, java.lang.Object resQuery)
output
- OutputStream for writingdrf
- strategie d'affichageresQuery
- objet a afficherpublic void executeAndDisplay()
public java.util.ArrayList getValueList(java.lang.String sqlRequest)
sqlRequest
- SQL command. Its result MUST be a list of single items
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |