📄 splashscreen.java
字号:
/*
* This file is part of Caliph & Emir.
*
* Caliph & Emir is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Caliph & Emir is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Caliph & Emir; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Copyright statement:
* --------------------
* (c) 2002-2004 by Mathias Lux (mathias@juggle.at)
* http://www.juggle.at
*/
package at.lux.splash;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.Properties;
import java.io.FileOutputStream;
import java.io.File;
import java.io.IOException;
/**
* @author Mathias Lux, mathias@juggle.at
* Date: 01.04.2004
* Time: 13:57:32
*/
public class SplashScreen extends JDialog {
private JTextArea text;
private JButton okay, cancel;
private JCheckBox accept;
public static final String LICENSE_ACCEPTED_FILENAME = "license.properties";
private static String license = "This program is part of Caliph & Emir.\n" +
"\n" +
"Caliph & Emir is free software; you can redistribute it and/or modify\n" +
"it under the terms of the GNU General Public License as published by\n" +
"the Free Software Foundation; either version 2 of the License, or\n" +
"(at your option) any later version.\n" +
"\n" +
"Caliph & Emir is distributed in the hope that it will be useful,\n" +
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +
"GNU General Public License for more details.\n" +
"\n" +
"You should have received a copy of the GNU General Public License\n" +
"along with Caliph & Emir; if not, write to the Free Software\n" +
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n" +
"-------------------------------------------------------------------------\n\n" +
"\t\t GNU GENERAL PUBLIC LICENSE\n" +
"\t\t Version 2, June 1991\n" +
"\n" +
" Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n" +
" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n" +
" Everyone is permitted to copy and distribute verbatim copies\n" +
" of this license document, but changing it is not allowed.\n" +
"\n" +
"\t\t\t Preamble\n" +
"\n" +
" The licenses for most software are designed to take away your\n" +
"freedom to share and change it. By contrast, the GNU General Public\n" +
"License is intended to guarantee your freedom to share and change free\n" +
"software--to make sure the software is free for all its users. This\n" +
"General Public License applies to most of the Free Software\n" +
"Foundation's software and to any other program whose authors commit to\n" +
"using it. (Some other Free Software Foundation software is covered by\n" +
"the GNU Library General Public License instead.) You can apply it to\n" +
"your programs, too.\n" +
"\n" +
" When we speak of free software, we are referring to freedom, not\n" +
"price. Our General Public Licenses are designed to make sure that you\n" +
"have the freedom to distribute copies of free software (and charge for\n" +
"this service if you wish), that you receive source code or can get it\n" +
"if you want it, that you can change the software or use pieces of it\n" +
"in new free programs; and that you know you can do these things.\n" +
"\n" +
" To protect your rights, we need to make restrictions that forbid\n" +
"anyone to deny you these rights or to ask you to surrender the rights.\n" +
"These restrictions translate to certain responsibilities for you if you\n" +
"distribute copies of the software, or if you modify it.\n" +
"\n" +
" For example, if you distribute copies of such a program, whether\n" +
"gratis or for a fee, you must give the recipients all the rights that\n" +
"you have. You must make sure that they, too, receive or can get the\n" +
"source code. And you must show them these terms so they know their\n" +
"rights.\n" +
"\n" +
" We protect your rights with two steps: (1) copyright the software, and\n" +
"(2) offer you this license which gives you legal permission to copy,\n" +
"distribute and/or modify the software.\n" +
"\n" +
" Also, for each author's protection and ours, we want to make certain\n" +
"that everyone understands that there is no warranty for this free\n" +
"software. If the software is modified by someone else and passed on, we\n" +
"want its recipients to know that what they have is not the original, so\n" +
"that any problems introduced by others will not reflect on the original\n" +
"authors' reputations.\n" +
"\n" +
" Finally, any free program is threatened constantly by software\n" +
"patents. We wish to avoid the danger that redistributors of a free\n" +
"program will individually obtain patent licenses, in effect making the\n" +
"program proprietary. To prevent this, we have made it clear that any\n" +
"patent must be licensed for everyone's free use or not licensed at all.\n" +
"\n" +
" The precise terms and conditions for copying, distribution and\n" +
"modification follow.\n" +
"\f\n" +
"\t\t GNU GENERAL PUBLIC LICENSE\n" +
" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n" +
"\n" +
" 0. This License applies to any program or other work which contains\n" +
"a notice placed by the copyright holder saying it may be distributed\n" +
"under the terms of this General Public License. The \"Program\", below,\n" +
"refers to any such program or work, and a \"work based on the Program\"\n" +
"means either the Program or any derivative work under copyright law:\n" +
"that is to say, a work containing the Program or a portion of it,\n" +
"either verbatim or with modifications and/or translated into another\n" +
"language. (Hereinafter, translation is included without limitation in\n" +
"the term \"modification\".) Each licensee is addressed as \"you\".\n" +
"\n" +
"Activities other than copying, distribution and modification are not\n" +
"covered by this License; they are outside its scope. The act of\n" +
"running the Program is not restricted, and the output from the Program\n" +
"is covered only if its contents constitute a work based on the\n" +
"Program (independent of having been made by running the Program).\n" +
"Whether that is true depends on what the Program does.\n" +
"\n" +
" 1. You may copy and distribute verbatim copies of the Program's\n" +
"source code as you receive it, in any medium, provided that you\n" +
"conspicuously and appropriately publish on each copy an appropriate\n" +
"copyright notice and disclaimer of warranty; keep intact all the\n" +
"notices that refer to this License and to the absence of any warranty;\n" +
"and give any other recipients of the Program a copy of this License\n" +
"along with the Program.\n" +
"\n" +
"You may charge a fee for the physical act of transferring a copy, and\n" +
"you may at your option offer warranty protection in exchange for a fee.\n" +
"\n" +
" 2. You may modify your copy or copies of the Program or any portion\n" +
"of it, thus forming a work based on the Program, and copy and\n" +
"distribute such modifications or work under the terms of Section 1\n" +
"above, provided that you also meet all of these conditions:\n" +
"\n" +
" a) You must cause the modified files to carry prominent notices\n" +
" stating that you changed the files and the date of any change.\n" +
"\n" +
" b) You must cause any work that you distribute or publish, that in\n" +
" whole or in part contains or is derived from the Program or any\n" +
" part thereof, to be licensed as a whole at no charge to all third\n" +
" parties under the terms of this License.\n" +
"\n" +
" c) If the modified program normally reads commands interactively\n" +
" when run, you must cause it, when started running for such\n" +
" interactive use in the most ordinary way, to print or display an\n" +
" announcement including an appropriate copyright notice and a\n" +
" notice that there is no warranty (or else, saying that you provide\n" +
" a warranty) and that users may redistribute the program under\n" +
" these conditions, and telling the user how to view a copy of this\n" +
" License. (Exception: if the Program itself is interactive but\n" +
" does not normally print such an announcement, your work based on\n" +
" the Program is not required to print an announcement.)\n" +
"\f\n" +
"These requirements apply to the modified work as a whole. If\n" +
"identifiable sections of that work are not derived from the Program,\n" +
"and can be reasonably considered independent and separate works in\n" +
"themselves, then this License, and its terms, do not apply to those\n" +
"sections when you distribute them as separate works. But when you\n" +
"distribute the same sections as part of a whole which is a work based\n" +
"on the Program, the distribution of the whole must be on the terms of\n" +
"this License, whose permissions for other licensees extend to the\n" +
"entire whole, and thus to each and every part regardless of who wrote it.\n" +
"\n" +
"Thus, it is not the intent of this section to claim rights or contest\n" +
"your rights to work written entirely by you; rather, the intent is to\n" +
"exercise the right to control the distribution of derivative or\n" +
"collective works based on the Program.\n" +
"\n" +
"In addition, mere aggregation of another work not based on the Program\n" +
"with the Program (or with a work based on the Program) on a volume of\n" +
"a storage or distribution medium does not bring the other work under\n" +
"the scope of this License.\n" +
"\n" +
" 3. You may copy and distribute the Program (or a work based on it,\n" +
"under Section 2) in object code or executable form under the terms of\n" +
"Sections 1 and 2 above provided that you also do one of the following:\n" +
"\n" +
" a) Accompany it with the complete corresponding machine-readable\n" +
" source code, which must be distributed under the terms of Sections\n" +
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -