001 /** 002 * Copyright (c) 2003 Daffodil Software Ltd all rights reserved, 003 * Modifications Copyright (c) 2008 Regiscope Digital Imaging Co, LLC, All rights reserved. 004 * This program is free software; you can redistribute it and/or modify 005 * it under the terms of version 2 of the GNU General Public License as 006 * published by the Free Software Foundation. 007 * There are special exceptions to the terms and conditions of the GPL 008 * as it is applied to this software. See the GNU General Public License for more details. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License 016 * along with this program; if not, write to the Free Software 017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 018 */ 019 020 package org.dbreplicator.repconsole; 021 022 import java.awt.*; 023 import java.awt.event.*; 024 import javax.swing.*; 025 026 public class AboutReplicator extends JDialog 027 { 028 029 static boolean packFrame = false; 030 031 public AboutReplicator(JFrame frame) 032 { 033 super(frame, "DBReplicator Help", true); 034 ImageIcon img = new ImageIcon( (getClass().getResource( 035 "/icons/aboutreplicator.gif"))); 036 JPanel pan = new JPanel(); 037 // pan.setBorder(new LineBorder(Color.BLACK)); 038 JLabel b = new JLabel(img); 039 pan.add(b, BorderLayout.CENTER); 040 pan.setBackground(Color.WHITE); 041 setBounds( (int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth() - 042 img.getIconWidth()) / 2, 043 (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight() - 044 img.getIconHeight()) / 2, img.getIconWidth() + 2, 045 img.getIconHeight() + 70); 046 getContentPane().add(pan, BorderLayout.CENTER); 047 JButton jButton1 = new JButton(); 048 //350,250 049 jButton1.setBounds( (int) (Toolkit.getDefaultToolkit().getScreenSize(). 050 getWidth() - 051 img.getIconWidth()) / 2 + 300, 052 (int) (Toolkit.getDefaultToolkit().getScreenSize(). 053 getHeight() - 054 img.getIconHeight()) / 2 + 200 + 10, 80, 80); 055 jButton1.setDebugGraphicsOptions(0); 056 jButton1.setText("Ok"); 057 jButton1.addActionListener(new AboutReplicator_jButton1_actionAdapter(this)); 058 pan.add(jButton1, null); 059 try 060 { 061 jbInit(); 062 } 063 catch (Exception e) 064 { 065 JOptionPane.showMessageDialog(this, e, "Error Message", 066 JOptionPane.ERROR_MESSAGE); 067 return; 068 } 069 070 } 071 072 public void Show() 073 { 074 super.show(); 075 } 076 077 public void Dispose() 078 { 079 super.dispose(); 080 } 081 082 void jButton1_actionPerformed(ActionEvent e) 083 { 084 this.dispose(); 085 } 086 087 private void jbInit() throws Exception 088 { 089 } 090 } 091 092 class AboutReplicator_jButton1_actionAdapter implements java.awt.event.ActionListener 093 { 094 AboutReplicator adaptee; 095 096 AboutReplicator_jButton1_actionAdapter(AboutReplicator adaptee) 097 { 098 this.adaptee = adaptee; 099 } 100 101 public void actionPerformed(ActionEvent e) 102 { 103 adaptee.jButton1_actionPerformed(e); 104 } 105 }

