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 public AboutDialog(Frame parent, boolean modal) {
41 // This code is automatically generated by Visual Cafe when you add
42 // components to the visual environment. It instantiates and initializes
43 // the components. To modify the code, only use code syntax that matches
44 // what Visual Cafe can generate, or Visual Cafe may be unable to back
45 // parse your Java file into its visual environment.
52 label1 = new java.awt.Label(AdjustTerra.PROGRAM_NAME +" Version "+ AdjustTerra.PROGRAM_VARSION +" ("+ AdjustTerra.PROGRAM_UPDATE +")", Label.CENTER);
53 label1.setBounds(10,10,340,20);
55 okButton = new java.awt.Button();
56 okButton.setLabel("OK");
57 okButton.setBounds(145,65,66,27);
59 label2 = new java.awt.Label("Copyright(C) 2014,2018,2020 yuuhayashi \n The MIT License (MIT).",Label.RIGHT);
60 label2.setBounds(10,40,340,20);
62 setTitle("About... "+ AdjustTerra.PROGRAM_NAME);
65 //{{REGISTER_LISTENERS
66 SymWindow aSymWindow = new SymWindow();
67 this.addWindowListener(aSymWindow);
68 SymAction lSymAction = new SymAction();
69 okButton.addActionListener(lSymAction);
73 public AboutDialog(Frame parent, String title, boolean modal) {
79 public void addNotify() {
80 // Record the size of the window prior to calling parents addNotify.
85 if (fComponentsAdjusted) {
89 // Adjust components according to the insets
90 setSize(getInsets().left + getInsets().right + getSize().width, getInsets().top + getInsets().bottom + getSize().height);
91 Component components[] = getComponents();
92 for (Component component : components) {
93 Point p = component.getLocation();
94 p.translate(getInsets().left, getInsets().top);
95 component.setLocation(p);
98 // Used for addNotify check.
99 fComponentsAdjusted = true;
103 * Shows or hides the component depending on the boolean flag b.
104 * @param b if true, show the component; otherwise, hide the component.
105 * @see java.awt.Component#isVisible
108 public void setVisible(boolean b) {
110 Rectangle bounds = getParent().getBounds();
111 Rectangle abounds = getBounds();
112 setLocation(bounds.x + (bounds.width - abounds.width)/ 2,
113 bounds.y + (bounds.height - abounds.height)/2);
118 void AboutDialog_WindowClosing(java.awt.event.WindowEvent event) {
122 void okButton_Clicked(java.awt.event.ActionEvent event) {
124 // Clicked from okButton Hide the Dialog