クラス org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame

すべてのメンバ一覧

説明

This class defines a GuiExceptionFrame

作者:
Nicolas Modrzyk
バージョン:
1.0

GuiExceptionFrame.java59 行で定義されています。

Public メソッド

 GuiExceptionFrame (JFrame gui)
void showException (Exception e)
void actionPerformed (ActionEvent e)

変数

JTextField errorMessage
JTextField classMessage
JTextArea traceMessage
JTextAreaWriter writer
PrintWriter printWriter
JButton showMe

スタティック変数

final int FRAME_WIDTH = 500
final int SHORT_HEIGHT = 200
final int LONG_HEIGHT = 400

Private メソッド

void setShowMeToShow ()
void setShowMeToHide ()

Private 変数

JScrollPane scrollPane


コンストラクタとデストラクタ

org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame JFrame  gui  ) 
 

Creates a new GuiExceptionFrame.java object

引数:
gui the parent frame
GuiExceptionFrame.java77 行で定義されています。

参照先 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.classMessage, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.errorMessage, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.FRAME_WIDTH, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.LONG_HEIGHT, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.printWriter, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.scrollPane, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.setShowMeToShow(), org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.SHORT_HEIGHT, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showMe, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.traceMessage, と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.writer.

00078 { 00079 super(gui, true); 00080 setTitle(GuiTranslate.get("frame.exception.title")); 00081 00082 Toolkit toolkit = Toolkit.getDefaultToolkit(); 00083 Dimension dim = toolkit.getScreenSize(); 00084 int screenHeight = dim.height; 00085 int screenWidth = dim.width; 00086 int frameWidth = FRAME_WIDTH; 00087 int frameHeight = SHORT_HEIGHT; 00088 setBounds((screenWidth - frameWidth) / 2, (screenHeight - frameHeight) / 2, 00089 frameWidth, frameHeight); 00090 validate(); 00091 setVisible(false); 00092 00093 getContentPane().setLayout(new BorderLayout()); 00094 00095 GridLayout layout = new GridLayout(6, 1); 00096 JPanel messagePanel = new JPanel(layout); 00097 messagePanel.add(new JLabel(GuiTranslate.get("frame.exception.error.type"))); 00098 classMessage = new JTextField(0); 00099 classMessage.setBackground(Color.white); 00100 classMessage.setAlignmentX(CENTER_ALIGNMENT); 00101 classMessage.setEditable(false); 00102 messagePanel.add(classMessage); 00103 00104 messagePanel.add(new JLabel(GuiTranslate.get("frame.exception.error.message"))); 00105 errorMessage = new JTextField(0); 00106 errorMessage.setBackground(Color.white); 00107 errorMessage.setAlignmentX(CENTER_ALIGNMENT); 00108 errorMessage.setEditable(false); 00109 messagePanel.add(errorMessage); 00110 00111 // Trace 00112 JLabel label = new JLabel(GuiTranslate.get("frame.exception.stack.trace")); 00113 // Show/hide trace 00114 showMe = new JButton(); 00115 showMe.addActionListener(this); 00116 setShowMeToShow(); 00117 00118 messagePanel.add(label); 00119 messagePanel.add(showMe); 00120 00121 traceMessage = new JTextArea(); 00122 traceMessage.setVisible(false); 00123 traceMessage.setAlignmentX(CENTER_ALIGNMENT); 00124 traceMessage.setEditable(false); 00125 traceMessage.setFont(GuiConstants.CENTER_PANE_FONT); 00126 traceMessage.setPreferredSize(new Dimension(FRAME_WIDTH, LONG_HEIGHT / 2)); 00127 writer = new JTextAreaWriter(traceMessage); 00128 printWriter = new PrintWriter(writer); 00129 scrollPane = new JScrollPane(); 00130 scrollPane.getViewport().add(traceMessage); 00131 scrollPane.setVisible(false); 00132 00133 // on the left 00134 JButton iconPane = new JButton(); 00135 Icon icon = GuiIcons.FRAME_ERROR_ICON; 00136 iconPane.setIcon(icon); 00137 Dimension dime = new Dimension(icon.getIconWidth(), icon.getIconHeight()); 00138 iconPane.setMaximumSize(dime); 00139 iconPane.setPreferredSize(dime); 00140 iconPane.setActionCommand(GuiCommands.COMMAND_HIDE_ERROR_FRAME); 00141 iconPane.addActionListener(this); 00142 getContentPane().add(iconPane, BorderLayout.EAST); 00143 00144 // on the center 00145 getContentPane().add(messagePanel, BorderLayout.CENTER); 00146 00147 // on the right 00148 getContentPane().add(scrollPane, BorderLayout.SOUTH); 00149 00150 setVisible(false); 00151 setBackground(Color.white); 00152 setDefaultCloseOperation(HIDE_ON_CLOSE); 00153 validate(); 00154 }


メソッド

void org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.actionPerformed ActionEvent  e  ) 
 

参照:
java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
GuiExceptionFrame.java197 行で定義されています。

参照先 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.FRAME_WIDTH, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.LONG_HEIGHT, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.scrollPane, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.setShowMeToHide(), org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.setShowMeToShow(), org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.SHORT_HEIGHT, と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.traceMessage.

00198 { 00199 if (e.getActionCommand().equals(GuiCommands.COMMAND_HIDE_ERROR_FRAME)) 00200 { 00201 scrollPane.setVisible(false); 00202 this.setVisible(false); 00203 } 00204 else if (e.getActionCommand().equals(GuiCommands.COMMAND_SHOW_ERROR_TRACE)) 00205 { 00206 setSize(FRAME_WIDTH, LONG_HEIGHT); 00207 traceMessage.setVisible(true); 00208 scrollPane.setVisible(true); 00209 validate(); 00210 repaint(); 00211 scrollPane.repaint(); 00212 setShowMeToHide(); 00213 } 00214 else if (e.getActionCommand().equals(GuiCommands.COMMAND_HIDE_ERROR_TRACE)) 00215 { 00216 setSize(FRAME_WIDTH, SHORT_HEIGHT); 00217 traceMessage.setVisible(false); 00218 scrollPane.setVisible(false); 00219 validate(); 00220 repaint(); 00221 scrollPane.repaint(); 00222 setShowMeToShow(); 00223 } 00224 }

void org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.setShowMeToHide  )  [private]
 

GuiExceptionFrame.java186 行で定義されています。

参照先 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showMe.

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.actionPerformed().

00187 { 00188 showMe.setText(GuiTranslate.get("frame.exception.hide.trace")); 00189 showMe.setActionCommand(GuiCommands.COMMAND_HIDE_ERROR_TRACE); 00190 showMe.validate(); 00191 showMe.repaint(); 00192 }

void org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.setShowMeToShow  )  [private]
 

GuiExceptionFrame.java178 行で定義されています。

参照先 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showMe.

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.actionPerformed(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame().

00179 { 00180 showMe.setText(GuiTranslate.get("frame.exception.show.trace")); 00181 showMe.setActionCommand(GuiCommands.COMMAND_SHOW_ERROR_TRACE); 00182 showMe.validate(); 00183 showMe.repaint(); 00184 }

void org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showException Exception  e  ) 
 

Show the exception in a dialog box

引数:
e the exception
GuiExceptionFrame.java161 行で定義されています。

参照先 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.classMessage, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.errorMessage, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.printWriter, org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.traceMessage, と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.writer.

00162 { 00163 errorMessage.setText(e.getMessage()); 00164 classMessage.setText(e.getClass().getName()); 00165 traceMessage.setText(""); 00166 e.printStackTrace(printWriter); 00167 try 00168 { 00169 writer.flush(); 00170 } 00171 catch (IOException e1) 00172 { 00173 // can't show, do not show 00174 } 00175 setVisible(true); 00176 }


変数

JTextField org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.classMessage [package]
 

GuiExceptionFrame.java62 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showException().

JTextField org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.errorMessage [package]
 

GuiExceptionFrame.java61 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showException().

final int org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.FRAME_WIDTH = 500 [static, package]
 

GuiExceptionFrame.java67 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.actionPerformed(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame().

final int org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.LONG_HEIGHT = 400 [static, package]
 

GuiExceptionFrame.java69 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.actionPerformed(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame().

PrintWriter org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.printWriter [package]
 

GuiExceptionFrame.java65 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showException().

JScrollPane org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.scrollPane [private]
 

GuiExceptionFrame.java70 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.actionPerformed(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame().

final int org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.SHORT_HEIGHT = 200 [static, package]
 

GuiExceptionFrame.java68 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.actionPerformed(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame().

JButton org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showMe [package]
 

GuiExceptionFrame.java66 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame(), org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.setShowMeToHide(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.setShowMeToShow().

JTextArea org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.traceMessage [package]
 

GuiExceptionFrame.java63 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.actionPerformed(), org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showException().

JTextAreaWriter org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.writer [package]
 

GuiExceptionFrame.java64 行で定義されています。

参照元 org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.GuiExceptionFrame(), と org.objectweb.cjdbc.console.gui.frames.GuiExceptionFrame.showException().


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0.4に対してTue Oct 12 15:16:21 2004に生成されました。 doxygen 1.3.8