1 package osm.jp.gpx.matchtime.gui;
4 @SuppressWarnings("serial")
5 public class AboutDialog extends Dialog
9 java.awt.Button okButton;
10 java.awt.Label label2;
13 // Used for addNotify redundency check.
14 boolean fComponentsAdjusted = false;
16 class SymWindow extends java.awt.event.WindowAdapter
19 public void windowClosing(java.awt.event.WindowEvent event) {
20 Object object = event.getSource();
21 if (object == AboutDialog.this) {
22 AboutDialog_WindowClosing(event);
27 class SymAction implements java.awt.event.ActionListener
30 public void actionPerformed(java.awt.event.ActionEvent event) {
31 Object object = event.getSource();
32 if (object == okButton) {
33 okButton_Clicked(event);
38 @SuppressWarnings("OverridableMethodCallInConstructor")
39 public AboutDialog(Frame parent, boolean modal) {
42 // This code is automatically generated by Visual Cafe when you add
43 // components to the visual environment. It instantiates and initializes
44 // the components. To modify the code, only use code syntax that matches
45 // what Visual Cafe can generate, or Visual Cafe may be unable to back
46 // parse your Java file into its visual environment.
53 label1 = new java.awt.Label(AdjustTime.PROGRAM_NAME +" Version "+ AdjustTime.PROGRAM_VARSION +" ("+ AdjustTime.PROGRAM_UPDATE +")", Label.CENTER);
54 label1.setBounds(10,10,340,20);
56 okButton = new java.awt.Button();
57 okButton.setLabel("OK");
58 okButton.setBounds(145,65,66,27);
60 label2 = new java.awt.Label("Copyright(C) 2014,2018, yuuhayashi \n The MIT License (MIT).",Label.RIGHT);
61 label2.setBounds(10,40,340,20);
63 setTitle("About... "+ AdjustTime.PROGRAM_NAME);
66 //{{REGISTER_LISTENERS
67 SymWindow aSymWindow = new SymWindow();
68 this.addWindowListener(aSymWindow);
69 SymAction lSymAction = new SymAction();
70 okButton.addActionListener(lSymAction);
74 @SuppressWarnings("OverridableMethodCallInConstructor")
75 public AboutDialog(Frame parent, String title, boolean modal) {
81 public void addNotify() {
82 // Record the size of the window prior to calling parents addNotify.
87 if (fComponentsAdjusted) {
91 // Adjust components according to the insets
92 setSize(getInsets().left + getInsets().right + getSize().width, getInsets().top + getInsets().bottom + getSize().height);
93 Component components[] = getComponents();
94 for (Component component : components) {
95 Point p = component.getLocation();
96 p.translate(getInsets().left, getInsets().top);
97 component.setLocation(p);
100 // Used for addNotify check.
101 fComponentsAdjusted = true;
105 * Shows or hides the component depending on the boolean flag b.
106 * @param b if true, show the component; otherwise, hide the component.
107 * @see java.awt.Component#isVisible
110 public void setVisible(boolean b) {
112 Rectangle bounds = getParent().getBounds();
113 Rectangle abounds = getBounds();
114 setLocation(bounds.x + (bounds.width - abounds.width)/ 2,
115 bounds.y + (bounds.height - abounds.height)/2);
120 void AboutDialog_WindowClosing(java.awt.event.WindowEvent event) {
124 void okButton_Clicked(java.awt.event.ActionEvent event) {
126 // Clicked from okButton Hide the Dialog