1 package jp.co.areaweb.tools.gui;
\r
4 @SuppressWarnings("serial")
\r
5 public class AboutDialog extends Dialog
\r
8 java.awt.Label label1;
\r
9 java.awt.Button okButton;
\r
10 java.awt.Label label2;
\r
13 // Used for addNotify redundency check.
\r
14 boolean fComponentsAdjusted = false;
\r
16 class SymWindow extends java.awt.event.WindowAdapter
\r
18 public void windowClosing(java.awt.event.WindowEvent event)
\r
20 Object object = event.getSource();
\r
21 if (object == AboutDialog.this)
\r
22 AboutDialog_WindowClosing(event);
\r
26 class SymAction implements java.awt.event.ActionListener
\r
28 public void actionPerformed(java.awt.event.ActionEvent event)
\r
30 Object object = event.getSource();
\r
31 if (object == okButton)
\r
32 okButton_Clicked(event);
\r
36 public AboutDialog(Frame parent, boolean modal)
\r
38 super(parent, modal);
\r
40 // This code is automatically generated by Visual Cafe when you add
\r
41 // components to the visual environment. It instantiates and initializes
\r
42 // the components. To modify the code, only use code syntax that matches
\r
43 // what Visual Cafe can generate, or Visual Cafe may be unable to back
\r
44 // parse your Java file into its visual environment.
\r
51 label1 = new java.awt.Label(Manager.PROGRAM_NAME +" Version "+ Manager.PROGRAM_VARSION +" ("+ Manager.PROGRAM_UPDATE +")", Label.CENTER);
\r
52 label1.setBounds(10,10,340,20);
\r
54 okButton = new java.awt.Button();
\r
55 okButton.setLabel("OK");
\r
56 okButton.setBounds(145,65,66,27);
\r
58 label2 = new java.awt.Label("All rights reserved.Copyright(c) 2006,, TDOS.",Label.CENTER);
\r
59 label2.setBounds(10,40,340,20);
\r
61 setTitle("AboutDialog");
\r
64 //{{REGISTER_LISTENERS
\r
65 SymWindow aSymWindow = new SymWindow();
\r
66 this.addWindowListener(aSymWindow);
\r
67 SymAction lSymAction = new SymAction();
\r
68 okButton.addActionListener(lSymAction);
\r
73 public AboutDialog(Frame parent, String title, boolean modal)
\r
75 this(parent, modal);
\r
79 public void addNotify()
\r
81 // Record the size of the window prior to calling parents addNotify.
\r
85 // Only do this once.
\r
86 if (fComponentsAdjusted)
\r
89 // Adjust components according to the insets
\r
90 setSize(getInsets().left + getInsets().right + getSize().width, getInsets().top + getInsets().bottom + getSize().height);
\r
91 Component components[] = getComponents();
\r
92 for (int i = 0; i < components.length; i++)
\r
94 Point p = components[i].getLocation();
\r
95 p.translate(getInsets().left, getInsets().top);
\r
96 components[i].setLocation(p);
\r
99 // Used for addNotify check.
\r
100 fComponentsAdjusted = true;
\r
104 * Shows or hides the component depending on the boolean flag b.
\r
105 * @param b if true, show the component; otherwise, hide the component.
\r
106 * @see java.awt.Component#isVisible
\r
108 public void setVisible(boolean b)
\r
112 Rectangle bounds = getParent().getBounds();
\r
113 Rectangle abounds = getBounds();
\r
114 setLocation(bounds.x + (bounds.width - abounds.width)/ 2,
\r
115 bounds.y + (bounds.height - abounds.height)/2);
\r
117 super.setVisible(b);
\r
120 void AboutDialog_WindowClosing(java.awt.event.WindowEvent event)
\r
125 void okButton_Clicked(java.awt.event.ActionEvent event)
\r
128 // Clicked from okButton Hide the Dialog
\r