KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > console > gui > CjdbcGuiLoader


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk
22  * Contributor(s): ______________________.
23  */

24
25 package org.objectweb.cjdbc.console.gui;
26
27 import java.awt.BorderLayout JavaDoc;
28 import java.awt.Color JavaDoc;
29 import java.awt.Dimension JavaDoc;
30 import java.awt.GridLayout JavaDoc;
31 import java.awt.Point JavaDoc;
32 import java.awt.Toolkit JavaDoc;
33 import java.io.File JavaDoc;
34 import java.io.IOException JavaDoc;
35 import java.net.URL JavaDoc;
36 import java.util.Hashtable JavaDoc;
37
38 import javax.swing.JDesktopPane JavaDoc;
39 import javax.swing.JFrame JavaDoc;
40 import javax.swing.JInternalFrame JavaDoc;
41 import javax.swing.JLabel JavaDoc;
42 import javax.swing.JMenu JavaDoc;
43 import javax.swing.JMenuBar JavaDoc;
44 import javax.swing.JMenuItem JavaDoc;
45 import javax.swing.JPanel JavaDoc;
46 import javax.swing.JScrollPane JavaDoc;
47 import javax.swing.JSplitPane JavaDoc;
48 import javax.swing.JTabbedPane JavaDoc;
49 import javax.swing.JTable JavaDoc;
50 import javax.swing.JTextArea JavaDoc;
51 import javax.swing.JTextPane JavaDoc;
52 import javax.swing.ProgressMonitor JavaDoc;
53
54 import org.objectweb.cjdbc.common.i18n.GuiTranslate;
55 import org.objectweb.cjdbc.console.gui.constants.GuiCommands;
56 import org.objectweb.cjdbc.console.gui.constants.GuiConstants;
57 import org.objectweb.cjdbc.console.gui.constants.GuiIcons;
58 import org.objectweb.cjdbc.console.gui.dnd.listeners.BackendTransferListener;
59 import org.objectweb.cjdbc.console.gui.dnd.listeners.ControllerTransferListener;
60 import org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame;
61 import org.objectweb.cjdbc.console.gui.frames.GuiNewControllerFrame;
62 import org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter;
63 import org.objectweb.cjdbc.console.gui.model.JNewList;
64 import org.objectweb.cjdbc.console.gui.popups.ControllerListPopUpMenu;
65 import org.objectweb.cjdbc.console.gui.popups.LoggingPopUpMenu;
66 import org.objectweb.cjdbc.console.gui.popups.XmlEditPopUpMenu;
67 import org.objectweb.cjdbc.console.gui.session.GuiSession;
68 import org.objectweb.cjdbc.console.gui.threads.GuiParsingThread;
69
70 /**
71  * This class defines a CjdbcGuiLoader
72  *
73  * @author <a HREF="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a>
74  * @version 1.0
75  */

76 public class CjdbcGuiLoader implements Runnable JavaDoc
77 {
78   static final int TOTAL_LOAD_METHOD = 9;
79   private CjdbcGui gui;
80
81   /**
82    * Creates a new <code>CjdbcGuiLoader.java</code> object
83    *
84    * @param gui the main gui
85    */

86   public CjdbcGuiLoader(CjdbcGui gui)
87   {
88     this.gui = gui;
89   }
90
91   /**
92    * @see java.lang.Runnable#run()
93    */

94   public void run()
95   {
96     // Define progress monitor
97
ProgressMonitor JavaDoc pm = new ProgressMonitor JavaDoc(gui, GuiTranslate
98         .get("gui.init.loading"), "", 0, 100);
99     pm.setMillisToDecideToPopup(0);
100     pm.setMillisToPopup(0);
101
102     pm.setNote(GuiTranslate.get("gui.init.variables"));
103     pm.setProgress(getProgress(0));
104     defineMembers();
105
106     pm.setNote(GuiTranslate.get("gui.init.size"));
107     pm.setProgress(getProgress(1));
108     defineSize();
109
110     pm.setNote(GuiTranslate.get("gui.init.left.pane"));
111     pm.setProgress(getProgress(2));
112     defineLeftPane();
113
114     pm.setNote(GuiTranslate.get("gui.init.center.pane"));
115     pm.setProgress(getProgress(3));
116     defineCenterPane();
117
118     pm.setNote(GuiTranslate.get("gui.init.right.pane"));
119     pm.setProgress(getProgress(4));
120     // defineRightPane();
121

122     pm.setNote(GuiTranslate.get("gui.init.frame.controller"));
123     pm.setProgress(getProgress(5));
124     defineNewControllerFrame();
125
126     pm.setNote(GuiTranslate.get("gui.init.frame.menu"));
127     pm.setProgress(getProgress(6));
128     defineMenu();
129
130     pm.setNote(GuiTranslate.get("gui.init.session"));
131     pm.setProgress(getProgress(7));
132     defineSession();
133
134     pm.setNote(GuiTranslate.get("gui.init.rendering"));
135     pm.setProgress(getProgress(8));
136     defineMainFrame();
137
138   }
139
140   private int getProgress(int index)
141   {
142     return (index + 1) * 100 / TOTAL_LOAD_METHOD;
143   }
144
145   private void defineMembers()
146   {
147
148     // Initialize private members
149
gui.guiSession = new GuiSession();
150     gui.backendsState = new Hashtable JavaDoc();
151     gui.backendList = new Hashtable JavaDoc();
152     gui.databaseMBeans = new Hashtable JavaDoc();
153     gui.controllerMBeans = new Hashtable JavaDoc();
154     gui.databaseList = new Hashtable JavaDoc();
155     gui.controllerList = new Hashtable JavaDoc();
156     gui.jmxClients = new Hashtable JavaDoc();
157
158     // Define transfer handlers
159
gui.backendTransferListener = new BackendTransferListener(gui);
160     gui.configurationFileTransferListener = new ControllerTransferListener(gui);
161
162     // Define mouse listeners
163
gui.controllerListPopUpMenu = new ControllerListPopUpMenu(gui);
164     gui.guiActionListener = new CjdbcGuiListener(gui);
165
166     // Define exception frame
167
gui.exceptionFrame = new GuiExceptionFrame(gui);
168   }
169
170   private void defineSize()
171   {
172     // Initialize basic layout properties
173
gui.setBackground(Color.lightGray);
174     gui.getContentPane().setLayout(new BorderLayout JavaDoc());
175     // Set the frame's display to be WIDTH x HEIGHT in the middle of the screen
176
Toolkit JavaDoc toolkit = Toolkit.getDefaultToolkit();
177     Dimension JavaDoc dim = toolkit.getScreenSize();
178     int screenHeight = dim.height;
179     int screenWidth = dim.width;
180     gui.setBounds((screenWidth - GuiConstants.MAIN_FRAME_WIDTH) / 2,
181         (screenHeight - GuiConstants.MAIN_FRAME_HEIGHT) / 2,
182         GuiConstants.MAIN_FRAME_WIDTH, GuiConstants.MAIN_FRAME_HEIGHT);
183
184   }
185
186   private void defineMenu()
187   {
188     // /////////////////////////////////////////////////////////////////////////
189
// Define main menu
190
// /////////////////////////////////////////////////////////////////////////
191
Color JavaDoc toolBarColor = Color.white;
192     JMenuBar JavaDoc menuBar = new JMenuBar JavaDoc();
193     JMenu JavaDoc menu = new JMenu JavaDoc(GuiTranslate.get("gui.menu.action"));
194     JMenuItem JavaDoc item1 = new JMenuItem JavaDoc(GuiCommands.COMMAND_QUIT);
195     item1.setBackground(toolBarColor);
196     JMenuItem JavaDoc item2 = new JMenuItem JavaDoc(GuiCommands.COMMAND_ADD_CONFIG_FILE);
197     item2.setBackground(toolBarColor);
198     JMenuItem JavaDoc item3 = new JMenuItem JavaDoc(GuiCommands.COMMAND_ADD_CONTROLLER);
199     item3.setBackground(toolBarColor);
200     JMenuItem JavaDoc item4 = new JMenuItem JavaDoc(GuiCommands.COMMAND_SAVE_CONFIGURATION_FILE);
201     item4.setBackground(toolBarColor);
202     JMenuItem JavaDoc item5 = new JMenuItem JavaDoc(GuiCommands.COMMAND_CLEAN_DEBUG_BUFFER);
203     item5.setBackground(toolBarColor);
204     JMenuItem JavaDoc item6 = new JMenuItem JavaDoc(GuiCommands.COMMAND_REFRESH_LOGS);
205     item6.setBackground(toolBarColor);
206     JMenuItem JavaDoc item7 = new JMenuItem JavaDoc(GuiCommands.COMMAND_CLEAN_LOGGING_PANEL);
207     item7.setBackground(toolBarColor);
208     JMenuItem JavaDoc item8 = new JMenuItem JavaDoc(
209         GuiCommands.COMMAND_MONITOR_CURRENT_CONTROLLER);
210     item8.setBackground(toolBarColor);
211     menu.add(item2).addActionListener(gui.guiActionListener);
212     menu.add(item3).addActionListener(gui.guiActionListener);
213     menu.add(item4).addActionListener(gui.guiActionListener);
214     menu.add(item5).addActionListener(gui.guiActionListener);
215     menu.add(item6).addActionListener(gui.guiActionListener);
216     menu.add(item7).addActionListener(gui.guiActionListener);
217     menu.add(item8).addActionListener(gui.guiActionListener);
218     menu.addSeparator();
219     menu.add(item1).addActionListener(gui.guiActionListener);
220     menu.setVisible(true);
221     menu.setBackground(toolBarColor);
222     menuBar.add(menu);
223     menuBar.setBackground(toolBarColor);
224     gui.setJMenuBar(menuBar);
225   }
226
227   private void defineSession()
228   {
229     // /////////////////////////////////////////////////////////////////////////
230
// Loading gui session
231
// /////////////////////////////////////////////////////////////////////////
232
try
233     {
234       gui.guiSession.loadSessionFromFile(new File JavaDoc(
235           GuiConstants.CJDBC_DEFAULT_SESSION_FILE));
236     }
237     catch (IOException JavaDoc e)
238     {
239       gui.appendDebugText(e.getMessage());
240     }
241     gui.actionLoadXmlList();
242     gui.publicActionLoadControllerList();
243   }
244
245   private void defineMainFrame()
246   {
247     // Put the final touches to the JFrame object
248
gui.publicActionRefreshCursorShape();
249     gui.validate();
250     gui.setVisible(true);
251     gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
252   }
253
254   private void defineLeftPane()
255   {
256     // /////////////////////////////////////////////////////////////////////////
257
// Define controller panel
258
// /////////////////////////////////////////////////////////////////////////
259
gui.controllerListPanel = new JPanel JavaDoc(new GridLayout JavaDoc(1, 1));
260     gui.controllerListPanel.setAlignmentX(JPanel.LEFT_ALIGNMENT);
261     gui.controllerListPanel.setName(GuiConstants.LIST_CONTROLLER);
262     gui.controllerListPanel.addMouseListener(gui.controllerListPopUpMenu);
263     JScrollPane JavaDoc controllerScroll = new JScrollPane JavaDoc();
264     controllerScroll.getViewport().add(gui.controllerListPanel);
265     JPanel JavaDoc controllerPane = new JPanel JavaDoc(new BorderLayout JavaDoc());
266     controllerPane.add(controllerScroll, BorderLayout.CENTER);
267     controllerPane.add(new JLabel JavaDoc(GuiTranslate.get("gui.panel.controllers")),
268         BorderLayout.NORTH);
269
270     // /////////////////////////////////////////////////////////////////////////
271
// Define virtual database panel
272
// /////////////////////////////////////////////////////////////////////////
273
gui.vdbListPanel = new JPanel JavaDoc(new GridLayout JavaDoc(1, 1));
274     gui.vdbListPanel.setAlignmentX(JPanel.LEFT_ALIGNMENT);
275     gui.vdbListPanel.setName(GuiConstants.LIST_DATABASE);
276     JScrollPane JavaDoc vdbScroll = new JScrollPane JavaDoc();
277     vdbScroll.getViewport().add(gui.vdbListPanel);
278     JPanel JavaDoc vdbPane = new JPanel JavaDoc(new BorderLayout JavaDoc());
279     vdbPane.add(vdbScroll, BorderLayout.CENTER);
280     vdbPane.add(new JLabel JavaDoc(GuiTranslate.get("gui.panel.virtualdatabases")),
281         BorderLayout.NORTH);
282
283     // /////////////////////////////////////////////////////////////////////////
284
// Define configuration files panel
285
// /////////////////////////////////////////////////////////////////////////
286
gui.fileListPanel = new JPanel JavaDoc(new GridLayout JavaDoc(1, 1));
287     // gui.fileListPanel.setMaximumSize(new Dimension(200, gui.getHeight()));
288
// gui.fileListPanel.setPreferredSize(new Dimension(200, gui.getHeight()));
289
// gui.fileListPanel.setAlignmentX(JPanel.LEFT_ALIGNMENT);
290
gui.fileListPanel.setName(GuiConstants.LIST_FILES);
291     gui.fileListPanel.setVisible(true);
292
293     gui.fileScroll = new JScrollPane JavaDoc();
294     gui.fileScroll
295         .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
296     gui.fileScroll
297         .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
298     gui.fileScroll.getViewport().add(gui.fileListPanel);
299     JPanel JavaDoc filePane = new JPanel JavaDoc(new BorderLayout JavaDoc());
300     filePane.add(gui.fileScroll, BorderLayout.CENTER);
301     filePane.add(new JLabel JavaDoc(GuiTranslate.get("gui.panel.configuration.files")),
302         BorderLayout.NORTH);
303
304     // /////////////////////////////////////////////////////////////////////////
305
// Define logo panel
306
// /////////////////////////////////////////////////////////////////////////
307
JPanel JavaDoc logo = new JPanel JavaDoc();
308     logo.setBackground(Color.white);
309     JLabel JavaDoc logoImg = new JLabel JavaDoc();
310     logoImg.setIcon(GuiIcons.CJDBC_LOGO);
311     logoImg.setMinimumSize(new Dimension JavaDoc(GuiIcons.CJDBC_LOGO.getIconWidth(),
312         GuiIcons.CJDBC_LOGO.getIconHeight()));
313     logo.add(logoImg);
314
315     // /////////////////////////////////////////////////////////////////////////
316
// Define left panel
317
// /////////////////////////////////////////////////////////////////////////
318
// Get the left pane for controllers and virtual databases
319
JPanel JavaDoc leftPane = new JPanel JavaDoc(new GridLayout JavaDoc(4, 1));
320     leftPane.setMaximumSize(new Dimension JavaDoc(250, gui.getHeight()));
321     leftPane.setPreferredSize(new Dimension JavaDoc(250, gui.getHeight()));
322
323     leftPane.add(controllerPane);
324     leftPane.add(vdbPane);
325     leftPane.add(filePane);
326     leftPane.add(logo);
327     // Add it to the main frame
328
gui.getContentPane().add(leftPane, BorderLayout.WEST);
329   }
330
331   private void defineNewControllerFrame()
332   {
333     // ////////////////////////////////////////////////////////////////////////
334
// Define new controller frame
335
// /////////////////////////////////////////////////////////////////////////
336
gui.newControllerFrame = new GuiNewControllerFrame(gui.guiActionListener);
337   }
338
339   private void defineCenterPane()
340   {
341
342     // ////////////////////////////////////////////////////////////////////////
343
// Define center panel
344
// /////////////////////////////////////////////////////////////////////////
345
gui.centerPane = new JTabbedPane JavaDoc();
346     gui.centerPane.setTabPlacement(JTabbedPane.TOP); // or
347
// BOTTOM,
348
// LEFT,
349
// RIGHT,TOP
350

351     // ////////////////////////////////////////////////////////////////////////
352
// Define jmx panel
353
// /////////////////////////////////////////////////////////////////////////
354
gui.jmxPanel = new JDesktopPane JavaDoc();
355     gui.jmxPanel.addFocusListener(gui.guiActionListener);
356     gui.mbeanList = new JNewList();
357     gui.mbeanList.addListSelectionListener(gui.guiActionListener);
358     gui.jmxScroll = new JScrollPane JavaDoc(gui.mbeanList);
359
360     // Mbean List frame
361
gui.mbeanFrame = new JInternalFrame JavaDoc("Jmx MBeans List", true);
362     gui.mbeanFrame.setBackground(Color.WHITE);
363     gui.mbeanFrame.getContentPane().add(gui.jmxScroll);
364     gui.mbeanFrame.setSize(300, 400);
365     gui.mbeanFrame.setVisible(true);
366     
367     gui.jmxPanel.add(gui.mbeanFrame);
368
369     // Attribute List frame
370
gui.attributeFrame = new JInternalFrame JavaDoc("Jmx MBean Attributes", true);
371     gui.attributeFrame.setBackground(Color.WHITE);
372     gui.attributeTable = new JTable JavaDoc();
373     gui.attributeTable.setName(GuiConstants.TABLE_JMX_ATTRIBUTES);
374     gui.attributeTable.addMouseListener(gui.guiActionListener);
375     gui.attributePane = new JScrollPane JavaDoc(gui.attributeTable);
376     gui.attributeFrame.getContentPane().add(gui.attributePane);
377     gui.attributeFrame.setSize(300, 400);
378     Point JavaDoc point = ((Point JavaDoc) gui.jmxPanel.getLocation().clone());
379     point.move(300, 0);
380     gui.attributeFrame.setLocation(point);
381     gui.attributeFrame.setVisible(true);
382     gui.attributeFrame.validate();
383     gui.jmxPanel.add(gui.attributeFrame);
384
385     // Operation List frame
386
gui.operationFrame = new JInternalFrame JavaDoc("Jmx MBean Operations", true);
387     gui.operationFrame.setBackground(Color.WHITE);
388     gui.operationTable = new JTable JavaDoc();
389     gui.operationTable.setName(GuiConstants.TABLE_JMX_OPERATIONS);
390     gui.operationTable.addMouseListener(gui.guiActionListener);
391     gui.operationPane = new JScrollPane JavaDoc(gui.operationTable);
392     gui.operationFrame.getContentPane().add(gui.operationPane);
393     gui.operationFrame.setSize(300, 400);
394     Point JavaDoc point2 = ((Point JavaDoc) gui.jmxPanel.getLocation().clone());
395     point2.move(600, 0);
396     gui.operationFrame.setLocation(point2);
397     gui.operationFrame.setVisible(true);
398     gui.operationFrame.validate();
399     gui.jmxPanel.add(gui.operationFrame);
400
401     // ////////////////////////////////////////////////////////////////////////
402
// Define debug panel
403
// /////////////////////////////////////////////////////////////////////////
404
gui.debugScroll = new JScrollPane JavaDoc();
405     gui.debugText = "";
406     gui.debugTextPane = new JTextArea JavaDoc();
407     gui.debugTextPane.setFont(GuiConstants.CENTER_PANE_FONT);
408     gui.debugTextPane.setEditable(false);
409     gui.debugTextPane.setText(gui.debugText);
410     gui.debugTextPane.setBackground(Color.white);
411
412     gui.debugTraceTextPane = new JTextArea JavaDoc();
413     gui.debugTraceTextPane.setFont(GuiConstants.CENTER_PANE_FONT);
414     gui.debugTraceTextPane.setEditable(false);
415     gui.debugTraceTextPane.setBackground(Color.white);
416     gui.traceWriter = new JTextAreaWriter(gui.debugTraceTextPane);
417
418     JSplitPane JavaDoc pane = new JSplitPane JavaDoc(JSplitPane.HORIZONTAL_SPLIT, false,
419         gui.debugTextPane, gui.debugTraceTextPane);
420     gui.debugScroll.getViewport().add(pane);
421
422     // ////////////////////////////////////////////////////////////////////////
423
// Define backend panel
424
// /////////////////////////////////////////////////////////////////////////
425
gui.actionLoadBackendPane(true);
426
427     // ////////////////////////////////////////////////////////////////////////
428
// Define help panel
429
// /////////////////////////////////////////////////////////////////////////
430
gui.helpScroll = new JScrollPane JavaDoc();
431     gui.xmlTextPane = new JTextPane JavaDoc();
432     JTextPane JavaDoc helpPanel = new JTextPane JavaDoc();
433     URL JavaDoc localUrl = this.getClass().getResource("/userGuide.html");
434     if (localUrl != null)
435     {
436       try
437       {
438         helpPanel.setPage(localUrl);
439       }
440       catch (IOException JavaDoc e)
441       {
442         gui.appendDebugText("Failed to load local help...", e);
443         helpPanel.setEnabled(false);
444       }
445     }
446     else
447     {
448       gui.appendDebugText("Failed to load local help...");
449       try
450       {
451         URL JavaDoc url = new URL JavaDoc(GuiConstants.CJDBC_URL_DOC);
452         helpPanel.setPage(url);
453       }
454       catch (Exception JavaDoc e)
455       {
456         helpPanel.setText("Could not load online help...");
457         helpPanel.setEnabled(false);
458       }
459     }
460     helpPanel.setEditable(false);
461     gui.helpScroll = new JScrollPane JavaDoc();
462     gui.helpScroll.getViewport().add(helpPanel);
463
464     // ////////////////////////////////////////////////////////////////////////
465
// Define xml panel
466
// /////////////////////////////////////////////////////////////////////////
467
gui.xmlScroll = new JScrollPane JavaDoc();
468     gui.xmlTextPane = new JTextPane JavaDoc();
469     gui.xmlTextPane.setText(gui.actionLoadXmlText(null));
470     gui.xmlTextPane.setFont(GuiConstants.CENTER_PANE_FONT);
471     gui.xmlTextPane.setBackground(Color.white);
472     gui.xmlTextPane.setEditable(true);
473     gui.xmlTextPane.addMouseListener(new XmlEditPopUpMenu(gui));
474     gui.xmlScroll.getViewport().add(gui.xmlTextPane);
475     // Parsing thread
476
gui.parsingThread = new GuiParsingThread(gui.xmlTextPane);
477     gui.parsingThread.start();
478     gui.xmlTextPane.addKeyListener(gui.parsingThread);
479
480     // ////////////////////////////////////////////////////////////////////////
481
// Define logging panel
482
// /////////////////////////////////////////////////////////////////////////
483
gui.loggingScroll = new JScrollPane JavaDoc();
484     gui.loggingTextPane = new JTextArea JavaDoc();
485     gui.loggingTextPane.setFont(GuiConstants.CENTER_PANE_FONT);
486     gui.loggingTextPane.setEditable(false);
487     gui.loggingTextPane.addMouseListener(new LoggingPopUpMenu(gui));
488     gui.loggingTextPane.setBackground(Color.white);
489     gui.loggingScroll.getViewport().add(gui.loggingTextPane);
490
491     // ////////////////////////////////////////////////////////////////////////
492
// Define info panel
493
// /////////////////////////////////////////////////////////////////////////
494
gui.infoScroll = new JScrollPane JavaDoc();
495     gui.infoTextPane = new JTextPane JavaDoc();
496     gui.infoTextPane.setFont(GuiConstants.CENTER_PANE_FONT);
497     gui.infoTextPane.setEditable(false);
498     gui.infoTextPane.setBackground(Color.white);
499     gui.infoScroll.getViewport().add(gui.infoTextPane);
500
501     // ////////////////////////////////////////////////////////////////////////
502
// Define log configuration panel
503
// /////////////////////////////////////////////////////////////////////////
504
gui.logConfigScroll = new JScrollPane JavaDoc();
505     gui.logConfigTextPane = new JTextPane JavaDoc();
506     gui.logConfigTextPane.setFont(GuiConstants.CENTER_PANE_FONT);
507     gui.logConfigTextPane.setEditable(true);
508     gui.logConfigTextPane.setBackground(Color.white);
509     gui.logConfigScroll.getViewport().add(gui.logConfigTextPane);
510
511     // ////////////////////////////////////////////////////////////////////////
512
// Add tabs to panel and add tabbed panel to main frame
513
// /////////////////////////////////////////////////////////////////////////
514
gui.centerPane.addTab(GuiTranslate.get("gui.panel.backends"),
515         GuiIcons.BACKEND_PANEL_ICON, gui.backendPanel);
516
517     gui.centerPane.addFocusListener(gui.guiActionListener);
518
519     gui.centerPane.addTab(GuiTranslate.get("gui.panel.jmx"),
520         GuiIcons.JMX_PANEL_ICON, gui.jmxPanel);
521
522     gui.centerPane.addTab(GuiTranslate.get("gui.panel.xml"),
523         GuiIcons.XML_PANEL_ICON, gui.xmlScroll);
524     gui.centerPane.addTab(GuiTranslate.get("gui.panel.info"),
525         GuiIcons.INFO_PANEL_ICON, gui.infoScroll);
526     gui.centerPane.addTab(GuiTranslate.get("gui.panel.logging"),
527         GuiIcons.LOGGING_PANEL_ICON, gui.loggingScroll);
528     gui.centerPane.addTab(GuiTranslate.get("gui.panel.log.config"),
529         GuiIcons.LOG_CONFIG_PANEL_ICON, gui.logConfigScroll);
530     gui.getContentPane().add(gui.centerPane, BorderLayout.CENTER);
531     gui.centerPane.addTab(GuiTranslate.get("gui.panel.debug"),
532         GuiIcons.DEBUG_PANEL_ICON, gui.debugScroll);
533     gui.centerPane.addTab(GuiTranslate.get("gui.panel.help"),
534         GuiIcons.HELP_PANEL_ICON, gui.helpScroll);
535   }
536
537   // private void defineRightPane()
538
// {
539
// ///////////////////////////////////////////////////////////////////////////
540
// // Define right panel
541
// ///////////////////////////////////////////////////////////////////////////
542
// JPanel rightPane = new JPanel(new BorderLayout());
543
// rightPane.setSize(150, 480);
544
// JTextPane rightTextPane = new JTextPane();
545
// Font rightPaneFont = new Font("Verdana", Font.PLAIN, 9);
546
// rightTextPane.setFont(rightPaneFont);
547
// rightTextPane.setForeground(Color.red);
548
// rightPane.add(rightTextPane, BorderLayout.CENTER);
549
// gui.parsingThread.setOutputPane(rightTextPane);
550
// gui.getContentPane().add(rightPane, BorderLayout.EAST);
551
// }
552
}
Popular Tags