📄 oyoahacompactor.java
字号:
/* ====================================================================
* Copyright (c) 2001-2003 OYOAHA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. The names "OYOAHA" must not be used to endorse or promote products
* derived from this software without prior written permission.
* For written permission, please contact email@oyoaha.com.
*
* 3. Products derived from this software may not be called "OYOAHA",
* nor may "OYOAHA" appear in their name, without prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL OYOAHA OR ITS CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.oyoaha.swing.plaf.oyoaha.editor;
import java.io.*;
import java.util.*;
import java.util.zip.*;
public class OyoahaCompactor
{
protected File target;
protected File source;
protected boolean rManifest;
protected boolean rTree;
protected boolean rExamples;
protected boolean rFilechooser;
protected boolean rInternalFrame;
protected boolean rMenu;
protected boolean rOptionPane;
protected boolean rSound;
protected boolean rSplitPane;
protected boolean rTabbedPane;
protected boolean rTable;
protected boolean rColorchooser;
protected boolean rApplet;
protected boolean rJavaFile;
protected boolean rDebug = true;
protected boolean rEditor = true;
protected boolean rJava1_2;
protected boolean rJava1_3;
public void setSourceFile(File source)
{
this.source = source;
}
public File getSourceFile()
{
return source;
}
public void setTargetFile(File target)
{
this.target = target;
}
public File getTargetFile()
{
return target;
}
public void setrManifest(boolean bool)
{
rManifest=bool;
}
public void setrTree(boolean bool)
{
rTree=bool;
}
public void setrExamples(boolean bool)
{
rExamples=bool;
}
public void setrFilechooser(boolean bool)
{
rFilechooser=bool;
}
public void setrInternalFrame(boolean bool)
{
rInternalFrame=bool;
}
public void setrJava1_2(boolean bool)
{
rJava1_2=bool;
}
public void setrJava1_3(boolean bool)
{
rJava1_3=bool;
}
public void setrMenu(boolean bool)
{
rMenu=bool;
}
public void setrOptionPane(boolean bool)
{
rOptionPane=bool;
}
public void setrSound(boolean bool)
{
rSound=bool;
}
public void setrSplitPane(boolean bool)
{
rSplitPane=bool;
}
public void setrTabbedPane(boolean bool)
{
rTabbedPane=bool;
}
public void setrTable(boolean bool)
{
rTable=bool;
}
public void setrColorchooser(boolean bool)
{
rColorchooser=bool;
}
public void setrJavaFile(boolean bool)
{
rJavaFile=bool;
}
public void setrApplet(boolean bool)
{
rApplet=bool;
}
public void setrDebug(boolean bool)
{
rDebug=bool;
}
public void setrEditor(boolean bool)
{
rEditor=bool;
}
public boolean getrManifest()
{
return rManifest;
}
public boolean getrTree()
{
return rTree;
}
public boolean getrExamples()
{
return rExamples;
}
public boolean getrFilechooser()
{
return rFilechooser;
}
public boolean getrInternalFrame()
{
return rInternalFrame;
}
public boolean getrJava1_2()
{
return rJava1_2;
}
public boolean getrJava1_3()
{
return rJava1_3;
}
public boolean getrMenu()
{
return rMenu;
}
public boolean getrOptionPane()
{
return rOptionPane;
}
public boolean getrSound()
{
return rSound;
}
public boolean getrSplitPane()
{
return rSplitPane;
}
public boolean getrTabbedPane()
{
return rTabbedPane;
}
public boolean getrTable()
{
return rTable;
}
public boolean getrColorchooser()
{
return rColorchooser;
}
public boolean getrJavaFile()
{
return rJavaFile;
}
public boolean getrApplet()
{
return rApplet;
}
public void loadConfiguration(File f)
{
Properties conf = new Properties();
try
{
conf.load(new FileInputStream(f));
}
catch(Exception e)
{
}
if (source==null)
{
String p = conf.getProperty("source");
if(p!=null)
source = new File(p);
}
if (target==null)
{
String p = conf.getProperty("target");
if(p!=null)
target = new File(p);
}
rManifest = getBoolean(conf.getProperty("rManifest", "false"));
rTree = getBoolean(conf.getProperty("rTree", "false"));
rExamples = getBoolean(conf.getProperty("rExamples", "false"));
rFilechooser = getBoolean(conf.getProperty("rFilechooser", "false"));
rInternalFrame = getBoolean(conf.getProperty("rInternalFrame", "false"));
rJava1_2 = getBoolean(conf.getProperty("rJava1_2", "false"));
rJava1_3 = getBoolean(conf.getProperty("rJava1_3", "false"));
rMenu = getBoolean(conf.getProperty("rMenu", "false"));
rOptionPane = getBoolean(conf.getProperty("rOptionPane", "false"));
rSound = getBoolean(conf.getProperty("rSound", "false"));
rSplitPane = getBoolean(conf.getProperty("rSplitPane", "false"));
rTabbedPane = getBoolean(conf.getProperty("rTabbedPane", "false"));
rTable = getBoolean(conf.getProperty("rTable", "false"));
rColorchooser = getBoolean(conf.getProperty("rColorchooser", "false"));
rJavaFile = getBoolean(conf.getProperty("rJavaFile", "false"));
rApplet = getBoolean(conf.getProperty("rApplet", "false"));
}
protected boolean getBoolean(String string)
{
try
{
return Boolean.valueOf(string).booleanValue();
}
catch(Exception e)
{
}
return false;
}
public void saveConfiguration(File f, boolean saveSource, boolean saveTarget)
{
Properties conf = new Properties();
if (source!=null && saveSource)
{
conf.put("source", source.getPath());
}
if (target!=null && saveTarget)
{
conf.put("target", target.getPath());
}
conf.put("rManifest", String.valueOf(rManifest));
conf.put("rTree", String.valueOf(rTree));
conf.put("rExamples", String.valueOf(rExamples));
conf.put("rFilechooser", String.valueOf(rFilechooser));
conf.put("rInternalFrame", String.valueOf(rInternalFrame));
conf.put("rJava1_2", String.valueOf(rJava1_2));
conf.put("rJava1_3", String.valueOf(rJava1_3));
conf.put("rMenu", String.valueOf(rMenu));
conf.put("rOptionPane", String.valueOf(rOptionPane));
conf.put("rSound", String.valueOf(rSound));
conf.put("rSplitPane", String.valueOf(rSplitPane));
conf.put("rTabbedPane", String.valueOf(rTabbedPane));
conf.put("rTable", String.valueOf(rTable));
conf.put("rColorchooser", String.valueOf(rColorchooser));
conf.put("rJavaFile", String.valueOf(rJavaFile));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -