0001: /*
0002: * UIUtil.java Copyright (c) 2006,07 Swaroop Belur
0003: *
0004: * This program is free software; you can redistribute it and/or
0005: * modify it under the terms of the GNU General Public License
0006: * as published by the Free Software Foundation; either version 2
0007: * of the License, or (at your option) any later version.
0008:
0009: * This program is distributed in the hope that it will be useful,
0010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0012: * GNU General Public License for more details.
0013:
0014: * You should have received a copy of the GNU General Public License
0015: * along with this program; if not, write to the Free Software
0016: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0017: *
0018: */
0019:
0020: package net.sf.jdec.ui.util;
0021:
0022: import java.awt.BorderLayout;
0023: import java.awt.Color;
0024: import java.awt.Component;
0025: import java.awt.Dimension;
0026: import java.awt.Font;
0027: import java.awt.event.ActionEvent;
0028: import java.awt.event.ActionListener;
0029: import java.awt.event.WindowAdapter;
0030: import java.awt.event.WindowEvent;
0031: import java.awt.event.WindowListener;
0032: import java.io.BufferedReader;
0033: import java.io.BufferedWriter;
0034: import java.io.File;
0035: import java.io.FileInputStream;
0036: import java.io.FileOutputStream;
0037: import java.io.IOException;
0038: import java.io.InputStream;
0039: import java.io.InputStreamReader;
0040: import java.io.OutputStream;
0041: import java.io.OutputStreamWriter;
0042: import java.util.ArrayList;
0043: import java.util.Enumeration;
0044: import java.util.HashMap;
0045: import java.util.Hashtable;
0046: import java.util.Iterator;
0047: import java.util.Map;
0048: import java.util.Properties;
0049: import java.util.ResourceBundle;
0050: import java.util.StringTokenizer;
0051: import java.util.jar.JarFile;
0052: import java.util.zip.ZipEntry;
0053:
0054: import javax.swing.BorderFactory;
0055: import javax.swing.BoxLayout;
0056: import javax.swing.JButton;
0057: import javax.swing.JDialog;
0058: import javax.swing.JEditorPane;
0059: import javax.swing.JLabel;
0060: import javax.swing.JOptionPane;
0061: import javax.swing.JPanel;
0062: import javax.swing.JProgressBar;
0063: import javax.swing.JScrollPane;
0064: import javax.swing.JTabbedPane;
0065: import javax.swing.JViewport;
0066: import javax.swing.text.DefaultEditorKit;
0067: import javax.swing.text.DefaultStyledDocument;
0068: import javax.swing.text.Document;
0069: import javax.swing.text.PlainDocument;
0070: import javax.swing.text.SimpleAttributeSet;
0071: import javax.swing.text.StyleConstants;
0072:
0073: import net.sf.jdec.config.Configuration;
0074: import net.sf.jdec.format.Settings;
0075: import net.sf.jdec.main.ConsoleLauncher;
0076: import net.sf.jdec.ui.adapter.DecompilerBridge;
0077: import net.sf.jdec.ui.core.Console;
0078: import net.sf.jdec.ui.core.FileInfoFrame;
0079: import net.sf.jdec.ui.core.JdecTree;
0080: import net.sf.jdec.ui.core.Manager;
0081: import net.sf.jdec.ui.core.OutputFrame;
0082: import net.sf.jdec.ui.main.UILauncher;
0083: import net.sf.jdec.util.AllExceptionHandler;
0084: import net.sf.jdec.util.Util;
0085:
0086: public class UIUtil {
0087:
0088: public static String jdecFolder = "";
0089:
0090: public static boolean codeReformatted = false;
0091:
0092: public String getMode() {
0093: return mode;
0094: }
0095:
0096: public String getOutputFilePath() {
0097: return outputFilePath;
0098: }
0099:
0100: public String getLogMode() {
0101: return logMode;
0102: }
0103:
0104: public String getLogPath() {
0105: return logPath;
0106: }
0107:
0108: public String getLogLevel() {
0109: return logLevel;
0110: }
0111:
0112: public String getJavaClassFile() {
0113: return javaClassFile;
0114: }
0115:
0116: public String getJarFilePath() {
0117: return jarFilePath;
0118: }
0119:
0120: public String getJDecOption() {
0121: return JDecOption;
0122: }
0123:
0124: public String getShowImport() {
0125: return showImport;
0126: }
0127:
0128: public java.lang.String mode;
0129:
0130: public String getExtension() {
0131: return extension;
0132: }
0133:
0134: public void setExtension(String extension) {
0135: this .extension = extension;
0136: }
0137:
0138: public String getInterpret() {
0139: return interpret;
0140: }
0141:
0142: public void setInterpret(String interpret) {
0143: this .interpret = interpret;
0144: }
0145:
0146: private java.lang.String extension = "jdec";
0147: private java.lang.String outputFilePath = System
0148: .getProperty("user.dir");
0149: private java.lang.String logMode = "file";
0150: private java.lang.String logPath = System.getProperty("user.dir")
0151: + File.separator + "jdeclog.txt";
0152: private java.lang.String logLevel = "1";
0153: private java.lang.String javaClassFile;
0154: private java.lang.String jarFilePath;
0155: private java.lang.String JDecOption = "dc";
0156: private java.lang.String showImport = "true";
0157: private java.lang.String projectTempDir = "";
0158:
0159: public String getUilogfile() {
0160: return uilogfile;
0161: }
0162:
0163: public void setUilogfile(String uilogfile) {
0164: this .uilogfile = uilogfile;
0165: }
0166:
0167: private java.lang.String uilogfile = System.getProperty("user.dir")
0168: + File.separator + "jdecuilog.txt";;
0169: private java.lang.String inlineAnonymous = "false";
0170: private java.lang.String innerDepth = "1";
0171: private java.lang.String interpret = "false";
0172: private static HashMap versionlines = new HashMap();
0173:
0174: public static HashMap getVersionlines() {
0175: return versionlines;
0176: }
0177:
0178: public static void setLinesForVersion(String v, ArrayList lines) {
0179: versionlines.put(v, lines);
0180:
0181: }
0182:
0183: private UIUtil() {
0184: }
0185:
0186: public static UIUtil getUIUtil() {
0187: if (ref == null) {
0188: ref = new UIUtil();
0189: return ref;
0190: } else
0191: return ref;
0192: }
0193:
0194: private static UIUtil ref = null;
0195:
0196: public void reLoadDecompilerConfigParams() {
0197: /*ResourceBundle rb=ResourceBundle.getBundle("tempconfig");
0198: readAllParameters(rb);*/
0199: HashMap values = new HashMap();
0200: BufferedReader br = null;
0201: try {
0202: br = new BufferedReader(
0203: new InputStreamReader(new FileInputStream(System
0204: .getProperty("user.home")
0205: + File.separator + "tempconfig.properties")));
0206: String s = br.readLine();
0207: while (s != null) {
0208: if (s.trim().indexOf("#") != -1) {
0209: s = br.readLine();
0210: } else {
0211: String str = s;
0212: if (str.trim().length() == 0) {
0213: s = br.readLine();
0214: } else {
0215: int eq = str.indexOf("=");
0216: if (eq != -1) {
0217: String key = str.substring(0, eq);
0218: String val = str.substring(eq + 1);
0219:
0220: values.put(key, val);
0221: s = br.readLine();
0222: } else {
0223: s = br.readLine();
0224: }
0225: }
0226: }
0227:
0228: }
0229: } catch (IOException ioe) {
0230: try {
0231:
0232: ioe.printStackTrace();
0233:
0234: } catch (Exception e) {
0235: e.printStackTrace();
0236: }
0237: }
0238: Iterator it = values.entrySet().iterator();
0239: while (it.hasNext()) {
0240: Map.Entry entry = (Map.Entry) it.next();
0241: String k = (String) entry.getKey();
0242: String v = (String) entry.getValue();
0243:
0244: if (k.equals("Output_Mode")) {
0245: mode = v;
0246: }
0247: if (k.equals("Log_Mode")) {
0248: logMode = v;
0249: }
0250: if (k.equals("Output_Folder_Path")) {
0251: outputFilePath = v;
0252:
0253: }
0254:
0255: if (k.equals("Output_File_Extension")) {
0256: extension = v;
0257: }
0258: if (k.equals("LOG_LEVEL")) {
0259: logLevel = v;
0260: }
0261: if (k.equals("Log_File_Path")) {
0262: logPath = v;
0263: }
0264: if (k.equals("UI_LOG_FILE_PATH")) {
0265: uilogfile = v;
0266:
0267: }
0268: if (k.equals("JAVA_CLASS_FILE")) {
0269: javaClassFile = v;
0270: }
0271: if (k.equals("JAR_FILE_PATH")) {
0272: jarFilePath = v;
0273: }
0274: if (k.equals("Show_Imports")) {
0275: showImport = v;
0276: }
0277: if (k.equals("JDec_Option")) {
0278: JDecOption = v;
0279: }
0280:
0281: if (k.equals("Temp_Dir")) {
0282: projectTempDir = v;
0283: }
0284: if (k.equals("Inline_Anonymous_Inner_Class_Content")) {
0285: inlineAnonymous = v;
0286: }
0287: if (k.equals("Inner_Depth")) {
0288: innerDepth = v;
0289: }
0290:
0291: if (k.equals("Interpret_Exception_Table")) {
0292: interpret = v;
0293: }
0294:
0295: if (k.equals("Interpret_Non_ASCII")) {
0296: interpretNonAscii = v;
0297: }
0298:
0299: if (k.equals("Force_Non_ASCII")) {
0300: forceNonAscii = v;
0301: }
0302:
0303: if (k.equals("Skip_Class_Version_Check")) {
0304: skipClassVersionCheck = v;
0305: }
0306:
0307: if (k.equals("Formatting_Show_Flower_Bracket_at_same_line")) {
0308: showFlowerBracketAtSameLine = v;
0309: try {
0310: Settings.setFlowerBracketAtSameLine(new Boolean(v
0311: .trim()).booleanValue());
0312: } catch (Exception e) {
0313: }
0314: }
0315:
0316: }
0317:
0318: //System.out.println("javaClassFile"+javaClassFile);
0319: Configuration.setJavaClassFile(javaClassFile);
0320: Configuration.setJarPath(jarFilePath);
0321: DecompilerBridge bridge = DecompilerBridge.getInstance(this );
0322: bridge.setOption(JDecOption);
0323:
0324: String op = getOutputFilePath();
0325: File f = new File(op);
0326:
0327: String jaroutput = getOutputFilePath() + File.separator
0328: + "JARDECOMPILED";
0329: f = new File(jaroutput);
0330: if (f.exists()) {
0331:
0332: } else {
0333: f.mkdirs();
0334: }
0335:
0336: try {
0337: if (br != null) {
0338: br.close();
0339: }
0340:
0341: } catch (IOException ie) {
0342: } finally {
0343: br = null;
0344: }
0345:
0346: }
0347:
0348: public void registerDecompilerConfigParams() {
0349: try {
0350: ResourceBundle rb = ResourceBundle.getBundle("config");
0351: readAllParameters(rb);
0352: //verifyConfigProperties();
0353: String op = getOutputFilePath();
0354: File f = new File(op);
0355: if (f.exists()) {
0356:
0357: }
0358:
0359: } catch (Exception e) {
0360: AllExceptionHandler handler = new AllExceptionHandler(e);
0361: handler.reportException();
0362: }
0363: }
0364:
0365: private boolean showConfigWindowOnStartUp = false;
0366:
0367: public boolean showConfigWindowOnStartUp() {
0368: return showConfigWindowOnStartUp;
0369: }
0370:
0371: public void setShowConfigWindowOnStartUp(
0372: boolean showConfigWindowOnStartUp) {
0373: this .showConfigWindowOnStartUp = showConfigWindowOnStartUp;
0374: }
0375:
0376: private void readAllParameters(ResourceBundle rb) {
0377:
0378: String temp = null;
0379: temp = rb.getString("Output_Mode");
0380: if (temp != null) {
0381: setMode(temp.trim());
0382: }
0383:
0384: temp = rb.getString("Output_Folder_Path");
0385: if (temp != null) {
0386: if (temp.indexOf("REPLACEME") != -1
0387: || temp.indexOf("REPLACE_ME") != -1) {
0388: setShowConfigWindowOnStartUp(true);
0389: }
0390:
0391: setOutputFilePath(temp.trim());
0392: Configuration.backupOriginalOutputFilePath(temp.trim());
0393:
0394: } else {
0395: setShowConfigWindowOnStartUp(true);
0396: }
0397:
0398: temp = rb.getString("Output_File_Extension");
0399: if (temp != null) {
0400: setExtension(temp.trim());
0401: }
0402: temp = rb.getString("Log_Mode");
0403: if (temp != null) {
0404: setLogMode(temp.trim());
0405: }
0406:
0407: temp = rb.getString("Log_File_Path");
0408: if (temp != null) {
0409: if (temp.indexOf("REPLACEME") != -1
0410: || temp.indexOf("REPLACE_ME") != -1) {
0411: setShowConfigWindowOnStartUp(true);
0412: }
0413: setLogPath(temp.trim());
0414: } else {
0415: setShowConfigWindowOnStartUp(true);
0416: }
0417: temp = rb.getString("LOG_LEVEL");
0418: if (temp != null) {
0419: setLogLevel(temp.trim());
0420: }
0421: temp = rb.getString("JAVA_CLASS_FILE");
0422: if (temp != null) {
0423: setJavaClassFile(temp.trim());
0424:
0425: }
0426: temp = rb.getString("JAR_FILE_PATH");
0427: if (temp != null) {
0428: setJarFilePath(temp.trim());
0429: }
0430: temp = rb.getString("JDec_Option");
0431: if (temp != null) {
0432: setJDecOption(temp.trim());
0433: }
0434: temp = rb.getString("Show_Imports");
0435: if (temp != null) {
0436: setShowImport(temp.trim());
0437: }
0438: temp = rb.getString("Temp_Dir");
0439: if (temp != null) {
0440: setProjectTempDir(temp.trim());
0441: }
0442:
0443: temp = rb.getString("UI_LOG_FILE_PATH");
0444: if (temp != null) {
0445: if (temp.indexOf("REPLACEME") != -1) {
0446: setShowConfigWindowOnStartUp(true);
0447: }
0448: setUilogfile(temp.trim());
0449: } else {
0450:
0451: setShowConfigWindowOnStartUp(true);
0452:
0453: }
0454:
0455: temp = rb.getString("Inline_Anonymous_Inner_Class_Content");
0456: if (temp != null) {
0457: setInlineAnonymous(temp.trim());
0458: }
0459: temp = rb.getString("Inner_Depth");
0460: if (temp != null) {
0461: setInnerDepth(temp.trim());
0462: }
0463: temp = rb.getString("Interpret_Exception_Table");
0464: if (temp != null) {
0465: setInterpret(temp.trim());
0466: }
0467: temp = rb.getString("Interpret_Non_ASCII");
0468: if (temp != null) {
0469: setInterpretNonAscii(temp.trim());
0470: }
0471: temp = rb.getString("Force_Non_ASCII");
0472: if (temp != null) {
0473: setForceNonAscii(temp.trim());
0474: }
0475: temp = rb.getString("Skip_Class_Version_Check");
0476: if (temp != null) {
0477: setSkipClassVersionCheck(temp.trim());
0478: }
0479:
0480: temp = rb
0481: .getString("Formatting_Show_Flower_Bracket_at_same_line");
0482: if (temp != null) {
0483: setShowFlowerBracketAtSameLine(temp.trim());
0484: try {
0485: Settings.setFlowerBracketAtSameLine(new Boolean(temp
0486: .trim()).booleanValue());
0487: } catch (Exception e) {
0488: }
0489: }
0490: if (logPath != null && logPath.trim().length() > 0) {
0491: String s = logPath + File.separator + "console.txt";
0492: setConsoleDetailFile(s);
0493: }
0494: String s = getConsoleDetailFile();
0495: Configuration.setConsoleDetailFile(s);
0496:
0497: //System.out.println("javaClassFile"+javaClassFile);
0498: Configuration.setJavaClassFile(javaClassFile);
0499: Configuration.setJarPath(jarFilePath);
0500: DecompilerBridge bridge = DecompilerBridge.getInstance(this );
0501: bridge.setOption(JDecOption);
0502:
0503: Configuration.setSkipClassVersionCheck(skipClassVersionCheck);
0504:
0505: }
0506:
0507: public static volatile boolean explosionInProgress = false;
0508:
0509: public static ArrayList registeredClasses = null;
0510:
0511: // TODO: FIXME by taking filters and archive settings into account
0512: public java.lang.String explodeJar(File f) {
0513:
0514: if (f == null || !f.exists())
0515: return "";
0516: try {
0517: registeredClasses = new ArrayList();
0518: explosionInProgress = true;
0519: JarFile jarFile = new JarFile(f.getAbsolutePath());
0520:
0521: Enumeration e = jarFile.entries();
0522: if (projectTempDir == null
0523: || projectTempDir.trim().length() == 0)
0524: projectTempDir = System.getProperty("user.dir");
0525:
0526: String name = f.getName();
0527: if (name.indexOf(".") != -1)
0528: name = name.substring(0, name.indexOf("."));
0529: File root = new File(projectTempDir + File.separator + name);
0530: if (root.exists() == false)
0531: root.mkdir();
0532:
0533: while (e.hasMoreElements() && continueToExplode) {
0534:
0535: ZipEntry entry = (ZipEntry) e.nextElement();
0536: File currentDir = null;
0537:
0538: if (entry.isDirectory()) {
0539: currentDir = new File(root.getAbsolutePath()
0540: + File.separator + entry.getName());
0541: if (!currentDir.exists())
0542: currentDir.mkdirs();
0543:
0544: } else {
0545: boolean b = checkFilterSetting(entry);
0546: if (!b)
0547: continue;
0548: if (currentDir == null) {
0549:
0550: currentDir = root;
0551: }
0552: File currentFile = new File(currentDir
0553: + File.separator + entry.getName());
0554: boolean write = false;
0555: try {
0556: //System.out.println("currentFile!!! "+currentFile.getAbsolutePath());
0557: if (currentExplodeEntry != null
0558: && archiveproframedetails != null
0559: && archiveproframe != null) {
0560:
0561: archiveproframedetails
0562: .remove(currentExplodeEntry);
0563: currentExplodeEntry
0564: .setText("Registering Entry "
0565: + entry.getName());
0566: //currentExplodeEntry.setBackground(Color.BLUE);
0567: currentExplodeEntry
0568: .setForeground(Color.BLUE);
0569: archiveproframedetails
0570: .add(currentExplodeEntry);
0571: archiveproframedetails.revalidate();
0572: archiveproframedetails.repaint();
0573: archiveproframe.repaint();
0574:
0575: }
0576: Thread.sleep(500);
0577: currentFile.createNewFile();
0578: write = true;
0579: writeToFile(currentFile, entry, jarFile);
0580: registeredClasses.add(currentFile);
0581: write = false;
0582: } catch (Exception e2) {
0583:
0584: String path = currentFile.getAbsolutePath();
0585: int lastSlash = path
0586: .lastIndexOf(File.separator);
0587: String s = path.substring(0, lastSlash);
0588: File f3 = new File(s);
0589: if (!f3.exists())
0590: f3.mkdirs();
0591: currentFile.createNewFile(); // Should not throw Exception
0592: if (write)
0593: writeToFile(currentFile, entry, jarFile);
0594:
0595: }
0596:
0597: }
0598:
0599: }
0600: if (currentExplodeEntry != null
0601: && archiveproframedetails != null) {
0602: explodeStatus.setText("Finished Scanning Jar");
0603: currentExplodeEntry.setText("");
0604: archiveproframedetails.revalidate();
0605: archiveproframedetails.repaint();
0606: archiveproframe.repaint();
0607: if (archiveproframe != null) {
0608: archiveproframe.setVisible(false);
0609: archiveproframe.dispose();
0610: archiveproframe = null;
0611: }
0612: }
0613: return root.getAbsolutePath();
0614: } catch (Exception e) {
0615:
0616: AllExceptionHandler handler = new AllExceptionHandler(e);
0617: handler.reportException();
0618: JOptionPane
0619: .showMessageDialog(null,
0620: "Error while reading from archive file.\nPlease check the log file");
0621: return "";
0622:
0623: } finally {
0624: UIUtil.continueToExplode = false;
0625: explosionInProgress = false;
0626: }
0627:
0628: }
0629:
0630: private void writeToFile(File currentFile, ZipEntry entry,
0631: JarFile jarFile) {
0632: ArrayList bytes = new ArrayList();
0633: try {
0634: InputStream is = jarFile.getInputStream(entry);
0635: OutputStream os = new FileOutputStream(currentFile
0636: .getAbsolutePath());
0637: //DataOutputStream dos=new DataOutputStream(os);
0638: int x = is.read();
0639: while (x != -1) {
0640: os.write(x);
0641: x = is.read();
0642: }
0643: os.flush();
0644: os.close();
0645:
0646: } catch (IOException ioe) {
0647: try {
0648: LogWriter lg = LogWriter.getInstance();
0649: lg
0650: .writeLog("[ERROR]: Method: writeToFile\n\tClass: UIUtil.class");
0651: lg
0652: .writeLog("------------------------------------------------");
0653: lg.writeLog("Exception Stack Trace");
0654: ioe.printStackTrace(lg.getPrintWriter());
0655: lg.flush();
0656: } catch (Exception e) {
0657: //
0658: }
0659:
0660: }
0661:
0662: }
0663:
0664: public java.lang.String getProjectTempDir() {
0665: return projectTempDir;
0666: }
0667:
0668: public void loadSystemProperties() {
0669: Properties p = System.getProperties();
0670: Enumeration e = p.keys();
0671: while (e.hasMoreElements()) {
0672: Object k = e.nextElement();
0673: propNames.add(k);
0674: propValues.add(p.get(k));
0675: }
0676: SystemProperties props = new SystemProperties(this );
0677: Manager.getManager().setSystemPropRef(props);
0678: }
0679:
0680: public static void setUserProjFol(java.lang.String userProjFol) {
0681: UIUtil.userProjFol = userProjFol;
0682: }
0683:
0684: public static java.lang.String getUserProjFol() {
0685: return userProjFol;
0686: }
0687:
0688: private static java.lang.String userProjFol = null;
0689:
0690: private java.lang.String currentFile = "";
0691:
0692: public void setCurrentOpenFile(java.lang.String str) {
0693: currentFile = str;
0694: }
0695:
0696: public ArrayList propNames = new ArrayList();
0697: public ArrayList propValues = new ArrayList();
0698:
0699: public java.lang.String getCurrentOpenFile() {
0700: return currentFile;
0701: }
0702:
0703: private ArrayList recentfiles = new ArrayList();
0704:
0705: public void addRecentFile(File f) {
0706: recentfiles.add(f);
0707:
0708: }
0709:
0710: public ArrayList getRecentFileList() {
0711: return recentfiles;
0712: }
0713:
0714: public void clearHistory() // Can Extend Later to clear other user things as needed
0715: { // Right now only recent file list
0716:
0717: recentfiles = new ArrayList();
0718: }
0719:
0720: // Used while opening recent File
0721: // Do not use Elsewhere
0722: public java.lang.String fileSelected = null;
0723: public java.lang.String fileSelectedPath = null;
0724: File javaFolder = null;
0725:
0726: public void setJavaFolderPath(File f) {
0727: javaFolder = f;
0728: }
0729:
0730: public String getJavaHomePath() {
0731: if (javaFolder != null)
0732: return javaFolder.getAbsolutePath();
0733: else
0734: return null;
0735: }
0736:
0737: File browserPath = null;
0738:
0739: public void setBrowserPath(File f) {
0740: browserPath = f;
0741: }
0742:
0743: public File getBrowserPath() {
0744: return browserPath;
0745: }
0746:
0747: public void setFileToBeCompiledOrRun(File f) {
0748: compileFile = f;
0749: }
0750:
0751: public File getFileToBeCompiled() {
0752: return compileFile;
0753: }
0754:
0755: private File compileFile = null;
0756: private java.lang.String javacResFile = null;
0757:
0758: public void setJavacResultFile(java.lang.String file) {
0759: javacResFile = file;
0760: }
0761:
0762: public java.lang.String getJavacOutputFile() {
0763: return javacResFile;
0764: }
0765:
0766: private String decompilerPropertyFileComment = "##############################################################################################################\n"
0767: + "# Jdec Property Descriptions #\n"
0768: + "##############################################################################################################\n"
0769: +
0770:
0771: "#Output_Mode ---> Represents the kind of Destination The tool o/p is sent to. Valid values are file and console\n"
0772: + "#File_Path ---> Represents the folder which will contain the output file(If the above mode is file)\n"
0773: + "#Log_Mode ---> Similar to Output-Mode except it represnts log and not output\n"
0774: + "#Log_File_Path ---> Represents the Full path of Log File to which log will be sent\n"
0775: + "#LOG_LEVEL ---> Decides the level of detail to which log is to be created. Valid value: 1 or 2; 2 is for higher log\n"
0776: + "#JAVA_CLASS_FILE -->Represents the input java class file which has to be worked on by this jdec\n"
0777: + "#JAR_FILE_PATH --> Represents the complete path to the jar the user wants to decompile\n"
0778: + "#JDec_Option --> Represents the Option to Run Jdec With\n"
0779: +
0780:
0781: "# [NOTE:] Valid Values For JDec_Option...\n"
0782: + "# 1>decompileClass\n"
0783: + "# 2>disassemble\n"
0784: + "# 3>decompileJar\n"
0785: + "# 4>ConstantPool\n"
0786: + "# 5>localVariables\n"
0787: + "# 6>Skeleton\n"
0788: + "# 7>help\n"
0789: +
0790:
0791: "# [NOTE:] Valid Values For Show_imports\n"
0792: + "# 1>true\n"
0793: + "# 2>false\n"
0794: +
0795:
0796: "IMPORTANT : Please do not use Windows Type Slash for updating values .Example use c:/test.class NOT c:\test.class \n"
0797: + "###############################################################################################################\n";
0798:
0799: public String getDecompilerPropertyFileComment() {
0800: return decompilerPropertyFileComment;
0801: }
0802:
0803: public void setDecompilerPropertyFileComment(
0804: String decompilerPropertyFileComment) {
0805: this .decompilerPropertyFileComment = decompilerPropertyFileComment;
0806: }
0807:
0808: private String gtkClass = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
0809: private String windowsClass = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
0810: private String metalClass = "javax.swing.plaf.metal.MetalLookAndFeel";
0811: private String motifClass = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
0812:
0813: public String getGtkClass() {
0814: return gtkClass;
0815: }
0816:
0817: public String getMetalClass() {
0818: return metalClass;
0819: }
0820:
0821: public String getMotifClass() {
0822: return motifClass;
0823: }
0824:
0825: public String getWindowsClass() {
0826: return windowsClass;
0827: }
0828:
0829: private String currentLNF = "GTKLookAndFeel";
0830:
0831: public String getLookAndFeelClass(String s) {
0832:
0833: if (s.equals("GTKLookAndFeel")) {
0834: return getGtkClass();
0835: } else if (s.equals("WindowsLookAndFeel")) {
0836: return getWindowsClass();
0837: } else if (s.equals("MetalLookAndFeel")) {
0838: return getMetalClass();
0839: } else if (s.equals("MotifLookAndFeel")) {
0840: return getMotifClass();
0841: } else
0842: return getGtkClass();
0843:
0844: }
0845:
0846: public String getCurrentLNF() {
0847: return currentLNF;
0848: }
0849:
0850: public void setCurrentLNF(String currentLNF) {
0851: this .currentLNF = currentLNF;
0852: }
0853:
0854: /* public void performCleanUp(String s)
0855: {
0856: File f=new File(s);
0857: if(f.isDirectory())
0858: {
0859: File list[]=f.listFiles();
0860: for(int i=0;i<list.length;i++)
0861: {
0862: File temp=list[i];
0863: if(temp.isDirectory())
0864: performCleanUp(temp.getAbsolutePath());
0865: else
0866: temp.delete();
0867: }
0868: }
0869: else
0870: f.delete();
0871: }*/
0872:
0873: private java.lang.String consoleDetailFile = null;
0874:
0875: /**
0876: * @return Returns the consoleDetailFile.
0877: */
0878: public java.lang.String getConsoleDetailFile() {
0879: File f = new File(consoleDetailFile);
0880: try {
0881: if (!f.exists()) {
0882: f.createNewFile();
0883:
0884: } else
0885: f.delete();
0886:
0887: }
0888:
0889: catch (Exception e) {
0890:
0891: consoleDetailFile = System.getProperty("user.home")
0892: + File.separator + "console.txt";
0893: }
0894: return consoleDetailFile;
0895: }
0896:
0897: /**
0898: * @param consoleDetailFile The consoleDetailFile to set.
0899: */
0900: public void setConsoleDetailFile(java.lang.String consoleDetailFile) {
0901: this .consoleDetailFile = consoleDetailFile;
0902: }
0903:
0904: public Console getConsoleFrame() {
0905: Manager manager = Manager.getManager();
0906: ArrayList paneList = manager.getCurrentSplitPaneComponents();
0907: Console c = null;
0908: for (int s = 0; s < paneList.size(); s++) {
0909: Object current = paneList.get(s);
0910: if (current instanceof Console) {
0911: c = (Console) current;
0912: break;
0913: }
0914:
0915: }
0916: return c;
0917:
0918: }
0919:
0920: private boolean jarOption = false;
0921:
0922: /**
0923: * @return Returns the jarOption.
0924: */
0925: public boolean isJarOption() {
0926: return jarOption;
0927: }
0928:
0929: /**
0930: * @param jarOption The jarOption to set.
0931: */
0932: public void setJarOption(boolean jarOption) {
0933: this .jarOption = jarOption;
0934: }
0935:
0936: public FileInfoFrame getInfoFrame() {
0937: Manager manager = Manager.getManager();
0938: ArrayList paneList = manager.getCurrentSplitPaneComponents();
0939: for (int s = 0; s < paneList.size(); s++) {
0940: Object current = paneList.get(s);
0941: if (current instanceof FileInfoFrame) {
0942: FileInfoFrame finfo = (FileInfoFrame) current;
0943: return finfo;
0944: }
0945: }
0946: return null;
0947:
0948: }
0949:
0950: public JTabbedPane getLeftTabbedPane() {
0951: Manager manager = Manager.getManager();
0952: ArrayList paneList = manager.getCurrentSplitPaneComponents();
0953: JTabbedPane tabs = null;
0954: for (int s = 0; s < paneList.size(); s++) {
0955: Object current = paneList.get(s);
0956: if (current instanceof JTabbedPane) {
0957: tabs = (JTabbedPane) current;
0958: Component c = tabs.getComponent(0);
0959: if (c instanceof JdecTree) {
0960:
0961: tabs = (JTabbedPane) current;
0962: break;
0963: }
0964:
0965: }
0966: }
0967:
0968: return tabs;
0969: }
0970:
0971: public JTabbedPane getRightTabbedPane() {
0972: Manager manager = Manager.getManager();
0973: ArrayList paneList = manager.getCurrentSplitPaneComponents();
0974: JTabbedPane tabs = null;
0975: for (int s = 0; s < paneList.size(); s++) {
0976: Object current = paneList.get(s);
0977: if (current instanceof JTabbedPane) {
0978: tabs = (JTabbedPane) current;
0979: Component c = tabs.getComponent(0);
0980: if ((c instanceof JdecTree) == false) {
0981: if (tabs.getTabCount() > 2) {
0982: break;
0983: }
0984: }
0985:
0986: }
0987: }
0988:
0989: return tabs;
0990: }
0991:
0992: public void setConstantPoolResultFile(String s) {
0993: constantPoolResultFile = s;
0994: }
0995:
0996: private String constantPoolResultFile = null;
0997:
0998: public String getConstantPoolResultFilePath() {
0999: return constantPoolResultFile;
1000: }
1001:
1002: public void setcpdescription(ArrayList list) {
1003: cpdesc = list;
1004: }
1005:
1006: public ArrayList getcpdesc() {
1007: return cpdesc;
1008: }
1009:
1010: private ArrayList cpdesc = null;
1011: private boolean configChanged = false;
1012:
1013: public void setConfigChanged(boolean b) {
1014: configChanged = b;
1015: }
1016:
1017: public boolean hasConfigChanged() {
1018: return configChanged;
1019: }
1020:
1021: public void copyFile(File src, File dest) {
1022: try {
1023: if (!src.exists()) {
1024: //JOptionPane.showMessageDialog(UILauncher.getMainFrame(),"[ERROR] Could Not Make changed Permanent");
1025: return;
1026: } else {
1027: if (dest.exists()) {
1028: dest.delete();
1029: }
1030:
1031: BufferedReader br = new BufferedReader(
1032: new InputStreamReader(new FileInputStream(src)));
1033: BufferedWriter bw = new BufferedWriter(
1034: new OutputStreamWriter(new FileOutputStream(
1035: dest)));
1036:
1037: String s1 = br.readLine();
1038: while (s1 != null) {
1039: bw.write(s1);
1040: bw.write("\n");
1041: s1 = br.readLine();
1042: }
1043: bw.flush();
1044: bw.close();
1045: br.close();
1046: bw = null;
1047: br = null;
1048:
1049: }
1050: } catch (IOException ioe) {
1051: try {
1052: LogWriter lg = LogWriter.getInstance();
1053: lg
1054: .writeLog("[ERROR]: Method: copyFile\n\tClass: UIUtil.class");
1055: lg
1056: .writeLog("------------------------------------------------");
1057: lg.writeLog("Exception Stack Trace");
1058: ioe.printStackTrace(lg.getPrintWriter());
1059: lg.flush();
1060: } catch (Exception e) {
1061: }
1062:
1063: }
1064:
1065: }
1066:
1067: public Hashtable getTabOpenFileMap() {
1068:
1069: return tabfilemap;
1070:
1071: }
1072:
1073: private Hashtable tabfilemap = new Hashtable();
1074:
1075: public void addToTabFileMap(int pos, String path) {
1076: tabfilemap.put(new Integer(pos), path);
1077: }
1078:
1079: private String defaultLnkNFeelName = getMetalClass();
1080: private String showWelcome = "true";
1081:
1082: /**
1083: * @return Returns the defaultLnkNFeelName.
1084: */
1085: public String getDefaultLnkNFeelName() {
1086: return defaultLnkNFeelName;
1087: }
1088:
1089: /**
1090: * @param defaultLnkNFeelName The defaultLnkNFeelName to set.
1091: */
1092: public void setDefaultLnkNFeelName(String defaultLnkNFeelName) {
1093: this .defaultLnkNFeelName = defaultLnkNFeelName;
1094: }
1095:
1096: public void setShowWelcomeScreenAtStartUp(String show) {
1097: this .showWelcome = show;
1098: }
1099:
1100: public String getTypeGivenClassName(String className) {
1101: if (className.equals(gtkClass)) {
1102: return "GTKLookAndFeel";
1103: }
1104: if (className.equals(windowsClass)) {
1105: return "WindowsLookAndFeel";
1106: }
1107: if (className.equals(metalClass)) {
1108: return "MetalLookAndFeel";
1109: }
1110: if (className.equals(motifClass)) {
1111: return "MotifLookAndFeel";
1112: } else
1113: return "UNKNOWN";
1114:
1115: }
1116:
1117: /**
1118: * @return Returns the inlineAnonymous.
1119: */
1120: public java.lang.String getInlineAnonymous() {
1121: return inlineAnonymous;
1122: }
1123:
1124: /**
1125: * @param inlineAnonymous The inlineAnonymous to set.
1126: */
1127: public void setInlineAnonymous(java.lang.String inlineAnonymous) {
1128: this .inlineAnonymous = inlineAnonymous;
1129: }
1130:
1131: /**
1132: * @return Returns the innerDepth.
1133: */
1134: public java.lang.String getInnerDepth() {
1135: return innerDepth;
1136: }
1137:
1138: /**
1139: * @param innerDepth The innerDepth to set.
1140: */
1141: public void setInnerDepth(java.lang.String innerDepth) {
1142: this .innerDepth = innerDepth;
1143: }
1144:
1145: public static JLabel proframedetails_class = new JLabel();
1146:
1147: public String getShowWelcome() {
1148: return showWelcome;
1149: }
1150:
1151: public static JLabel proframedetails_method = new JLabel();
1152: public static JLabel versionproframedetails_class = new JLabel();
1153: public static JLabel versionproframedetails_method = new JLabel();
1154: public final static JPanel proframedetails = new JPanel();
1155: public final static JPanel versionproframedetails = new JPanel();
1156: public final static JPanel archiveproframedetails = new JPanel();
1157: public static JLabel proframedetails_pkg;
1158: public static JLabel explodeStatus;
1159: public static JLabel currentExplodeEntry;
1160:
1161: public static JDialog launchProgressBarFrame() {
1162:
1163: if (proframe != null) {
1164: proframe.setVisible(false);
1165: proframe.dispose();
1166: proframe = null;
1167: }
1168: if (archiveproframe != null) {
1169: archiveproframe.setVisible(false);
1170: archiveproframe.dispose();
1171: archiveproframe = null;
1172: }
1173: archiveproframe = null;
1174: proframe = new JDialog(UILauncher.getMainFrame(),
1175: "Jdec Progress...", false);
1176: proframe.setFocusableWindowState(true);
1177: proframe.setFocusable(true);
1178:
1179: JLabel statusLabel = new JLabel();
1180: proframedetails_pkg = new JLabel("");
1181: proframedetails_class = new JLabel(
1182: "Please wait for jdec to finish task...");
1183: proframedetails_method = new JLabel("");
1184: statusLabel
1185: .setText("Please Wait for Jdec to finish executing the current task....");
1186: Dimension d = UILauncher.getMainFrame().getToolkit()
1187: .getScreenSize();
1188: proframe.setBounds((int) d.getWidth() / 2 - 130, (int) d
1189: .getHeight() / 2 - 140, 450, 120);
1190: JProgressBar progressBar = new JProgressBar();
1191: progressBar.setIndeterminate(true);
1192: JPanel contents = (JPanel) proframe.getContentPane();
1193: contents.setSize(430, 350);
1194: proframedetails.setLayout(new BoxLayout(proframedetails,
1195: BoxLayout.Y_AXIS));
1196: proframedetails.removeAll();
1197: proframedetails.add(proframedetails_pkg);
1198: proframedetails.add(proframedetails_class);
1199: proframedetails.add(proframedetails_method);
1200: proframedetails.revalidate();
1201: contents.setBorder(BorderFactory.createEmptyBorder(10, 10, 10,
1202: 10));
1203: //contents.add(statusLabel, BorderLayout.NORTH);
1204: contents.add(proframedetails, BorderLayout.NORTH);
1205: contents.add(progressBar);
1206: if (proframe != null) {
1207: proframe.getContentPane().add(progressBar);
1208: proframe.addWindowListener(wndCloser);
1209: }
1210: return proframe;
1211:
1212: }
1213:
1214: public static JDialog launchArchiveProgressBarFrame() {
1215:
1216: if (archiveproframe != null) {
1217: archiveproframe.setVisible(false);
1218: archiveproframe.dispose();
1219: archiveproframe = null;
1220: }
1221: if (proframe != null) {
1222: proframe.setVisible(false);
1223: proframe.dispose();
1224: proframe = null;
1225: }
1226: proframe = null;
1227: archiveproframe = new JDialog(UILauncher.getMainFrame(),
1228: "Jdec Progress...", false);
1229: archiveproframe.setFocusableWindowState(true);
1230: archiveproframe.setFocusable(true);
1231: currentExplodeEntry = new JLabel("");
1232: explodeStatus = new JLabel(
1233: "Please wait. Jdec is now scanning the jar");
1234: explodeStatus.setFont(new Font("MONOSPACE", Font.BOLD, 11));
1235: JLabel statusLabel = new JLabel();
1236: proframedetails_pkg = new JLabel("");
1237: proframedetails_class = new JLabel(
1238: "Please wait for jdec to finish task...");
1239: proframedetails_method = new JLabel("");
1240: statusLabel
1241: .setText("Please Wait for Jdec to finish executing the current task....");
1242: Dimension d = UILauncher.getMainFrame().getToolkit()
1243: .getScreenSize();
1244: archiveproframe.setBounds((int) d.getWidth() / 2 - 130, (int) d
1245: .getHeight() / 2 - 140, 450, 120);
1246: JProgressBar progressBar = new JProgressBar();
1247: progressBar.setIndeterminate(true);
1248: JPanel contents = (JPanel) archiveproframe.getContentPane();
1249: contents.setSize(430, 350);
1250: archiveproframedetails.setLayout(new BoxLayout(
1251: archiveproframedetails, BoxLayout.Y_AXIS));
1252: archiveproframedetails.removeAll();
1253: archiveproframedetails.add(explodeStatus);
1254: archiveproframedetails.add(currentExplodeEntry);
1255: /*archiveproframedetails.add(proframedetails_pkg);
1256: archiveproframedetails.add(proframedetails_class);
1257: archiveproframedetails.add(proframedetails_method);*/
1258: archiveproframedetails.revalidate();
1259: contents.setBorder(BorderFactory.createEmptyBorder(10, 10, 10,
1260: 10));
1261: //contents.add(statusLabel, BorderLayout.NORTH);
1262: JButton stop = new JButton("Stop");
1263: stop.addActionListener(new ActionListener() {
1264: public void actionPerformed(ActionEvent ae) {
1265: continueToExplode = false;
1266: }
1267: });
1268: contents.add(archiveproframedetails, BorderLayout.NORTH);
1269: contents.add(progressBar, BorderLayout.SOUTH);
1270: contents.add(stop, BorderLayout.EAST);
1271: archiveproframe.getContentPane().add(progressBar);
1272: archiveproframe.addWindowListener(wndCloser);
1273: return archiveproframe;
1274:
1275: }
1276:
1277: public static JDialog launchVersionProgressBarFrame() {
1278:
1279: JDialog versionproframe = new JDialog(
1280: UILauncher.getMainFrame(), "Jdec Progress...", false);
1281: if (proframe != null) {
1282: proframe.setVisible(false);
1283: }
1284: if (archiveproframe != null) {
1285: archiveproframe.setVisible(false);
1286: archiveproframe.dispose();
1287: archiveproframe = null;
1288: }
1289: proframe = null;
1290: archiveproframe = null;
1291:
1292: proframedetails_pkg = null;
1293: proframedetails_class = null;
1294: proframedetails_method = null;
1295: JLabel statusLabel = new JLabel();
1296: versionproframedetails_class = new JLabel(
1297: "Please wait for jdec to finish task...");
1298: versionproframedetails_method = new JLabel("");
1299: statusLabel
1300: .setText("Please Wait for Jdec to finish executing the current task....");
1301: Dimension d = UILauncher.getMainFrame().getToolkit()
1302: .getScreenSize();
1303: versionproframe.setBounds((int) d.getWidth() / 2 - 130, (int) d
1304: .getHeight() / 2 - 140, 450, 120);
1305: JProgressBar progressBar = new JProgressBar();
1306: progressBar.setIndeterminate(true);
1307: JPanel contents = (JPanel) versionproframe.getContentPane();
1308: contents.setSize(430, 350);
1309: versionproframedetails.setLayout(new BoxLayout(
1310: versionproframedetails, BoxLayout.Y_AXIS));
1311: versionproframedetails.removeAll();
1312: versionproframedetails.add(versionproframedetails_class);
1313: versionproframedetails.add(versionproframedetails_method);
1314: versionproframedetails.revalidate();
1315: contents.setBorder(BorderFactory.createEmptyBorder(10, 10, 10,
1316: 10));
1317: //contents.add(statusLabel, BorderLayout.NORTH);
1318: contents.add(versionproframedetails, BorderLayout.NORTH);
1319: contents.add(progressBar);
1320: versionproframe.getContentPane().add(progressBar);
1321: versionproframe.addWindowListener(wndCloser);
1322: return versionproframe;
1323:
1324: }
1325:
1326: static WindowListener wndCloser = new WindowAdapter() {
1327: public void windowClosing(WindowEvent e) {
1328: if (proframe != null) {
1329: proframe.setVisible(false);
1330: proframe.dispose();
1331: proframe = null;
1332: }
1333: }
1334: };
1335:
1336: public static JDialog archiveproframe = null;
1337: private static JDialog proframe = null;
1338: private static JDialog versionproframe = null;
1339:
1340: public static JDialog getProgressBarFrame() {
1341: return proframe;
1342: }
1343:
1344: public static JDialog getVersionProgressBarFrame() {
1345: return versionproframe;
1346: }
1347:
1348: public static boolean checkForInvalidEntries(java.lang.String type) {
1349: boolean ok = true;
1350: if (type.equals("run")) {
1351:
1352: UIUtil util = UILauncher.getUIutil();
1353: if (util == null)
1354: return false;
1355: Console cf = util.getConsoleFrame();
1356: JEditorPane pane = null;
1357: if (cf != null) {
1358: pane = cf.getComponent();
1359: }
1360: if (util.getJDecOption() != null
1361: && util.getJDecOption().trim().length() == 0) {
1362: if (pane != null)
1363: pane
1364: .setText("Please set the jdec option to a proper value");
1365: return false;
1366: }
1367: if (util.getJDecOption() != null
1368: && util.getJDecOption().equals("decompileJar")) {
1369:
1370: if (util == null)
1371: return false;
1372: java.lang.String opdir = util.getOutputFilePath();
1373: File test = new File(opdir);
1374: if (test == null || !test.exists()) {
1375: if (pane != null)
1376: pane
1377: .setText("Please set The output Directory to a valid Value");
1378: return false;
1379: }
1380: java.lang.String log = UIUtil.getUIUtil().getLogPath();
1381: test = new File(log);
1382: test = test.getParentFile();
1383: if (test == null || !test.exists()) {
1384: java.lang.String s = "Please set The Decompile Log File Path Properly\n";
1385: s += "Please include the name of The log file also\n";
1386: s += "As an Example You can set it to d:/temp/log.txt if it is a Windows Box\n\n";
1387: if (pane != null)
1388: pane.setText(s);
1389: return false;
1390: }
1391: log = UIUtil.getUIUtil().getUilogfile();
1392: test = new File(log);
1393: test = test.getParentFile();
1394: if (test == null || !test.exists()) {
1395: java.lang.String s = "Please set The UI Log File Path Properly\n";
1396: s += "Please include the name of The log file also\n";
1397: s += "As an Example You can set it to d:/temp/log.txt if it is a Windows Box\n\n";
1398: if (pane != null)
1399: pane.setText(s);
1400: return false;
1401: }
1402: java.lang.String tmp = UIUtil.getUIUtil()
1403: .getProjectTempDir();
1404: test = new File(tmp);
1405: if (test == null || !test.exists()) {
1406: java.lang.String s = "Please set The Temp Dir Path Properly\n";
1407: if (pane != null)
1408: pane.setText(s);
1409: return false;
1410: }
1411:
1412: } else if (util.getJDecOption() != null
1413: && !util.getJDecOption().equals("decompileJar")) {
1414: util = UILauncher.getUIutil();
1415: if (util == null)
1416: return false;
1417: java.lang.String opdir = util.getOutputFilePath();
1418: File test = new File(opdir);
1419: cf = util.getConsoleFrame();
1420: if (cf != null)
1421: pane = cf.getComponent();
1422: if (test == null || !test.exists()) {
1423: if (pane != null)
1424: pane
1425: .setText("Please set The output Directory to a valid Value");
1426: return false;
1427: }
1428: java.lang.String log = UIUtil.getUIUtil().getLogPath();
1429: test = new File(log);
1430: test = test.getParentFile();
1431: if (test == null || !test.exists()) {
1432: java.lang.String s = "Please set The Decompile Log File Path Properly\n";
1433: s += "Please include the name of The log file also\n";
1434: s += "As an Example You can set it to d:/temp/log.txt if it is a Windows Box\n\n";
1435: if (pane != null)
1436: pane.setText(s);
1437: return false;
1438: }
1439: log = UIUtil.getUIUtil().getUilogfile();
1440: test = new File(log);
1441: test = test.getParentFile();
1442: if (test == null || !test.exists()) {
1443: java.lang.String s = "Please set The UI Log File Path Properly\n";
1444: s += "Please include the name of The log file also\n";
1445: s += "As an Example You can set it to d:/temp/log.txt if it is a Windows Box\n\n";
1446: if (pane != null)
1447: pane.setText(s);
1448: return false;
1449: }
1450:
1451: }
1452:
1453: } else if (type.equals("")) {
1454: UIUtil util = UILauncher.getUIutil();
1455: if (util == null)
1456: return false;
1457: java.lang.String opdir = util.getOutputFilePath();
1458: File test = new File(opdir);
1459: Console cf = util.getConsoleFrame();
1460: JEditorPane pane = null;
1461: if (cf != null) {
1462: pane = cf.getComponent();
1463: if (test == null || !test.exists()) {
1464: pane
1465: .setText("Please set The output Directory to a valid Value");
1466: return false;
1467: }
1468: }
1469: java.lang.String log = UIUtil.getUIUtil().getLogPath();
1470: test = new File(log);
1471: test = test.getParentFile();
1472: if (test == null || !test.exists()) {
1473: java.lang.String s = "Please set The Decompile Log File Path Properly\n";
1474: s += "Please include the name of The log file also\n";
1475: s += "As an Example You can set it to d:/temp/log.txt if it is a Windows Box\n\n";
1476: if (pane != null)
1477: pane.setText(s);
1478: return false;
1479: }
1480: log = UIUtil.getUIUtil().getUilogfile();
1481: test = new File(log);
1482: test = test.getParentFile();
1483: if (test == null || !test.exists()) {
1484: java.lang.String s = "Please set The UI Log File Path Properly\n";
1485: s += "Please include the name of The log file also\n";
1486: s += "As an Example You can set it to d:/temp/log.txt if it is a Windows Box\n\n";
1487: if (pane != null)
1488: pane.setText(s);
1489: return false;
1490: }
1491:
1492: } else if (type.equals("jar")) {
1493:
1494: UIUtil util = UILauncher.getUIutil();
1495: if (util == null)
1496: return false;
1497: java.lang.String opdir = util.getOutputFilePath();
1498: File test = new File(opdir);
1499: Console cf = util.getConsoleFrame();
1500: JEditorPane pane = null;
1501: if (cf != null) {
1502:
1503: pane = cf.getComponent();
1504: if (test == null || !test.exists()) {
1505: pane
1506: .setText("Please set The output Directory to a valid Value");
1507: return false;
1508: }
1509: }
1510: java.lang.String log = UIUtil.getUIUtil().getLogPath();
1511: test = new File(log);
1512: test = test.getParentFile();
1513: if (test == null || !test.exists()) {
1514: java.lang.String s = "Please set The Decompile Log File Path Properly\n";
1515: s += "Please include the name of The log file also\n";
1516: s += "As an Example You can set it to d:/temp/log.txt if it is a Windows Box\n\n";
1517: if (pane != null)
1518: pane.setText(s);
1519: return false;
1520: }
1521: log = UIUtil.getUIUtil().getUilogfile();
1522: test = new File(log);
1523: test = test.getParentFile();
1524: if (test == null || !test.exists()) {
1525: java.lang.String s = "Please set The UI Log File Path Properly\n";
1526: s += "Please include the name of The log file also\n";
1527: s += "As an Example You can set it to d:/temp/log.txt if it is a Windows Box\n\n";
1528: if (pane != null)
1529: pane.setText(s);
1530: return false;
1531: }
1532: java.lang.String tmp = UIUtil.getUIUtil()
1533: .getProjectTempDir();
1534: test = new File(tmp);
1535: if (test == null || !test.exists()) {
1536: java.lang.String s = "Please set The Temp Dir Path Properly\n";
1537: if (pane != null)
1538: pane.setText(s);
1539: return false;
1540: }
1541:
1542: }
1543:
1544: return ok;
1545: }
1546:
1547: public ExtraOptions getFilterframe() {
1548: return filterframe;
1549: }
1550:
1551: private ExtraOptions filterframe = null;
1552:
1553: public void setFilterFrameRef(ExtraOptions f) {
1554: filterframe = f;
1555: }
1556:
1557: public boolean searchForClassName() {
1558: return search;
1559: }
1560:
1561: public void setSearch(boolean search) {
1562: this .search = search;
1563: }
1564:
1565: private volatile boolean search = false;
1566:
1567: public static ArrayList getCurrentSels() {
1568: return currentSels;
1569: }
1570:
1571: public static void setCurrentSels(ArrayList list) {
1572: currentSels = list;
1573: }
1574:
1575: static ArrayList currentSels = new ArrayList();
1576:
1577: public static void addSelection(String text) {
1578: currentSels.add(text);
1579: }
1580:
1581: public static String currentSelString = "";
1582:
1583: public static ArrayList decompiledClasses = new ArrayList();
1584:
1585: public static int historyindex = -1;
1586:
1587: private HashMap filetabmap = new HashMap();
1588:
1589: public void setFileTabMap(int index, String file) {
1590: filetabmap.put("" + index, file);
1591: }
1592:
1593: public String saveAsOrSave(int index) {
1594: String s = (String) filetabmap.get("" + index);
1595: if (s == null)
1596: return "saveas";
1597: else
1598: return "save";
1599: }
1600:
1601: public String getFileNameForTab(int index) {
1602: return (String) filetabmap.get("" + index);
1603: }
1604:
1605: public void removeFileTabMap(int i) {
1606: filetabmap.remove("" + i);
1607: }
1608:
1609: ArrayList favList = new ArrayList();
1610:
1611: public ArrayList getFavoriteList() {
1612: favList = Util.removeDuplicates(favList);
1613: return favList;
1614: }
1615:
1616: public void addFavorite(String s) {
1617: favList.add(s);
1618: }
1619:
1620: public void setFavList(ArrayList favList) {
1621: this .favList = favList;
1622: }
1623:
1624: private boolean checkFilterSetting(ZipEntry entry) {
1625:
1626: String name = entry.getName();
1627: if (entry.isDirectory()) {
1628: name = name.replaceAll("/", ".");
1629: ArrayList list = ConsoleLauncher.getInclList();
1630: if (list == null || list.size() == 0)
1631: return true;
1632: if (list.get(0).toString().equals("pkg-all")
1633: || list.get(0).toString().equals("All")
1634: || list.get(0).toString().equals("[]")
1635: || list.get(0).toString().equals("[ ]")) {
1636: return true;
1637: }
1638: for (Iterator iter = list.iterator(); iter.hasNext();) {
1639: String element = (String) iter.next();
1640: if (element.equals(name)) {
1641: return true;
1642: }
1643: }
1644: return false;
1645: } else {
1646: if (name.endsWith(".class")) {
1647: String defaultClz = UILauncher.getUIConfigRef()
1648: .getOnly_default_classes_in_archive();
1649: int sl = name.indexOf("/");
1650: if (sl == -1)
1651: return true;
1652: if (defaultClz != null && defaultClz.equals("true")) {
1653: if (sl != -1) {
1654: return false;
1655: } else
1656: return true;
1657: }
1658: name = name.substring(0, name.lastIndexOf("/"));
1659: name = name.replaceAll("/", ".");
1660: ArrayList list = ConsoleLauncher.getInclList();
1661: if (list.size() == 0)
1662: return true;
1663: for (Iterator iter = list.iterator(); iter.hasNext();) {
1664: String element = (String) iter.next();
1665: if (element.equals(name)) {
1666: return true;
1667: }
1668: }
1669: return false;
1670:
1671: } else {
1672: String enclosedArch = UILauncher.getUIConfigRef()
1673: .getEnclosed_archives_in_archive();
1674: int dot = name.indexOf(".");
1675: if (dot != -1) {
1676: String ext = name.substring(dot + 1);
1677: if (enclosedArch != null
1678: && enclosedArch.equalsIgnoreCase("true")) {
1679: String types = UILauncher.getUIConfigRef()
1680: .getArchiveTypes();
1681: StringTokenizer st = new StringTokenizer(types,
1682: ",");
1683: while (st.hasMoreTokens()) {
1684: String c = (String) st.nextToken();
1685: if (c.equalsIgnoreCase(ext)) {
1686: return true;
1687: }
1688: }
1689: return false;
1690:
1691: } else
1692: return false;
1693:
1694: }
1695: return false;
1696:
1697: }
1698: }
1699:
1700: }
1701:
1702: public JEditorPane getCurrentFocussedInRightTabPane() {
1703: JEditorPane rdwrPane = null;
1704: Manager manager = Manager.getManager();
1705: ArrayList paneList = manager.getCurrentSplitPaneComponents();
1706: JTabbedPane tabs = UIUtil.getUIUtil().getRightTabbedPane();
1707:
1708: if (tabs != null) {
1709:
1710: Component editor = tabs.getSelectedComponent();
1711:
1712: JScrollPane editorTab = (JScrollPane) editor;
1713: Object o = editorTab.getComponent(0);
1714: JViewport view = (JViewport) o;
1715: Object o2 = view.getView();
1716: if (o2 != null) {
1717: rdwrPane = (JEditorPane) o2;
1718: }
1719: }
1720: return rdwrPane;
1721:
1722: }
1723:
1724: public JEditorPane getEditorWindow() {
1725: JEditorPane rdwrPane = null;
1726: Manager manager = Manager.getManager();
1727: ArrayList paneList = manager.getCurrentSplitPaneComponents();
1728: JTabbedPane tabs = UIUtil.getUIUtil().getRightTabbedPane();
1729:
1730: if (tabs != null) {
1731: tabs
1732: .setSelectedIndex(tabs
1733: .indexOfTab("Jdec Editor Window"));
1734: Component editor = tabs.getSelectedComponent();
1735:
1736: JScrollPane editorTab = (JScrollPane) editor;
1737: Object o = editorTab.getComponent(0);
1738: JViewport view = (JViewport) o;
1739: Object o2 = view.getView();
1740: if (o2 != null) {
1741: rdwrPane = (JEditorPane) o2;
1742: }
1743: }
1744: return rdwrPane;
1745:
1746: }
1747:
1748: public void searchText(String s) {
1749: UIUtil.getUIUtil().getCurrentFocussedInRightTabPane().setCaret(
1750: new WideCaret());
1751: JEditorPane editorwindow = getCurrentFocussedInRightTabPane();
1752: int pos = editorwindow.getCaretPosition();
1753: boolean toSearchUp = false;
1754: String searchData = "";
1755: try {
1756: Document doc = editorwindow.getDocument();
1757: searchData = doc.getText(0, doc.getLength());
1758: int searchIndex = pos;
1759: String key = "";
1760: key = s;
1761: start = -1;
1762: finish = -1;
1763: start = searchData.toLowerCase().indexOf(key.toLowerCase());
1764: if (start < 0) {
1765: throw new Exception();
1766: }
1767: finish = start + key.length();
1768: //start = start+searchIndex;
1769: //finish = finish+searchIndex;
1770: selectAnyTextFound(start, finish, toSearchUp);
1771: } catch (Exception ex) {
1772: if (UIUtil.codeReformatted) {
1773: JOptionPane
1774: .showMessageDialog(
1775: UILauncher.getMainFrame(),
1776: "This feature does not work after code is formatted from the toolbar action...\nPlease refresh/decompile this class to use this feature");
1777: } else
1778: JOptionPane.showMessageDialog(
1779: UILauncher.getMainFrame(),
1780: "Error while selecting method in frame");
1781: }
1782:
1783: }
1784:
1785: public void selectAnyTextFound(int fromWhere, int tillWhere,
1786: boolean updownstate) {
1787: //UIUtil.getUIUtil().getEditorWindow().setCaret(new WideCaret());
1788:
1789: //StyleConstants.setBackground(orig,new Color(-16777216));
1790: //StyleConstants.setForeground(orig,new Color(-16777216));
1791: StyleConstants.getBackground(method);
1792: StyleConstants.setForeground(method, Color.WHITE);//new Color(69,47,43));//250,30,80));
1793: StyleConstants.setBackground(method, new Color(51, 0, 51));
1794: StyleConstants.setBold(method, true);
1795: StyleConstants.getForeground(method);
1796: StyleConstants.getBackground(method);
1797: UIUtil.getUIUtil().getCurrentFocussedInRightTabPane()
1798: .setCaretPosition(fromWhere);
1799: UIUtil.getUIUtil().getCurrentFocussedInRightTabPane()
1800: .moveCaretPosition(tillWhere);
1801: UIUtil.getUIUtil().getCurrentFocussedInRightTabPane().select(
1802: fromWhere, tillWhere);
1803: start = UIUtil.getUIUtil().getCurrentFocussedInRightTabPane()
1804: .getSelectionStart();
1805: finish = UIUtil.getUIUtil().getCurrentFocussedInRightTabPane()
1806: .getSelectionEnd();
1807: JEditorPane ep = UIUtil.getUIUtil()
1808: .getCurrentFocussedInRightTabPane();
1809: Document d = ep.getDocument();
1810: Iterator s = resetShades.keySet().iterator();
1811: while (s.hasNext()) {
1812: String str1 = (String) s.next();
1813: String str2 = (String) resetShades.get(str1);
1814: int istr1 = Integer.parseInt(str1);
1815: int istr2 = Integer.parseInt(str2);
1816: ((DefaultStyledDocument) d).setCharacterAttributes(istr1,
1817: istr2, orig, true);
1818: }
1819: if (d instanceof DefaultStyledDocument) {
1820: resetShades.put("" + start, "" + (finish - start + 1));
1821: ((DefaultStyledDocument) d).setCharacterAttributes(start,
1822: (finish - start + 1), method, true);
1823: //UIUtil.getUIUtil().getEditorWindow().moveCaretPosition(tillWhere+20);
1824: }
1825:
1826: }
1827:
1828: int start = -1;
1829: int finish = -1;
1830: public static volatile boolean continueToExplode = true;
1831: private SimpleAttributeSet method = new SimpleAttributeSet();
1832: private SimpleAttributeSet orig = new SimpleAttributeSet();
1833: private HashMap resetShades = new HashMap();
1834:
1835: /**
1836: * Only call it to set it to null
1837: * @param versionproframe
1838: */
1839: public static void setVersionproframe(JDialog versionproframe) {
1840: UIUtil.versionproframe = versionproframe;
1841: }
1842:
1843: private DefaultEditorKit defedkit = null;
1844:
1845: {
1846: defedkit = new DefaultEditorKit() {
1847: public Document createDefaultDocument() {
1848: PlainDocument plainDoc = new PlainDocument();
1849: return plainDoc;
1850: }
1851: };
1852: }
1853:
1854: public DefaultEditorKit getDefaultEditorKit() {
1855: return defedkit;
1856: }
1857:
1858: public OutputFrame decompileFrame = null;
1859:
1860: public String getSkipClassVersionCheck() {
1861: return skipClassVersionCheck;
1862: }
1863:
1864: public void setSkipClassVersionCheck(String skipClassVersionCheck) {
1865: this .skipClassVersionCheck = skipClassVersionCheck;
1866: }
1867:
1868: private String interpretNonAscii = "true";
1869: private String forceNonAscii = "false";
1870: private String skipClassVersionCheck = "true";
1871: private String showFlowerBracketAtSameLine = "true";
1872:
1873: private static String intPrefix = "anInt";
1874: private static String longPrefix = "aLong";
1875: private static String floatPrefix = "aFloat";
1876: private static String doublePrefix = "aDouble";
1877: private static String stringPrefix = "aString";
1878: private static String bytePrefix = "aByte";
1879: private static String shortPrefix = "aShort";
1880: private static String charPrefix = "aChar";
1881: private static String otherPrefix = "Var";
1882: private static String booleanPrefix = "aBoolean";
1883:
1884: public String getBooleanPrefix() {
1885: return booleanPrefix;
1886: }
1887:
1888: public void setBooleanPrefix(String booleanPrefix) {
1889: this .booleanPrefix = booleanPrefix;
1890: }
1891:
1892: public void setStringPrefix(String stringPrefix) {
1893: this .stringPrefix = stringPrefix;
1894: }
1895:
1896: public void setShortPrefix(String shortPrefix) {
1897: this .shortPrefix = shortPrefix;
1898: }
1899:
1900: public void setOtherPrefix(String otherPrefix) {
1901: this .otherPrefix = otherPrefix;
1902: }
1903:
1904: public void setLongPrefix(String longPrefix) {
1905: this .longPrefix = longPrefix;
1906: }
1907:
1908: public void setIntPrefix(String intPrefix) {
1909: this .intPrefix = intPrefix;
1910: }
1911:
1912: public void setFloatPrefix(String floatPrefix) {
1913: this .floatPrefix = floatPrefix;
1914: }
1915:
1916: public void setDoublePrefix(String doublePrefix) {
1917: this .doublePrefix = doublePrefix;
1918: }
1919:
1920: public void setCharPrefix(String charPrefix) {
1921: this .charPrefix = charPrefix;
1922: }
1923:
1924: public void setBytePrefix(String bytePrefix) {
1925: this .bytePrefix = bytePrefix;
1926: }
1927:
1928: public String getStringPrefix() {
1929: return stringPrefix;
1930: }
1931:
1932: public String getBytePrefix() {
1933: return bytePrefix;
1934: }
1935:
1936: public String getCharPrefix() {
1937: return charPrefix;
1938: }
1939:
1940: public String getDoublePrefix() {
1941: return doublePrefix;
1942: }
1943:
1944: public String getFloatPrefix() {
1945: return floatPrefix;
1946: }
1947:
1948: public String getIntPrefix() {
1949: return intPrefix;
1950: }
1951:
1952: public String getLongPrefix() {
1953: return longPrefix;
1954: }
1955:
1956: public String getOtherPrefix() {
1957: return otherPrefix;
1958: }
1959:
1960: public String getShortPrefix() {
1961: return shortPrefix;
1962: }
1963:
1964: public String getForceNonAscii() {
1965: if (forceNonAscii == null)
1966: forceNonAscii = "false";
1967: return forceNonAscii;
1968: }
1969:
1970: public void setForceNonAscii(String forceNonAscii) {
1971: this .forceNonAscii = forceNonAscii;
1972: }
1973:
1974: public String getInterpretNonAscii() {
1975: if (interpretNonAscii == null)
1976: interpretNonAscii = "true";
1977: return interpretNonAscii;
1978: }
1979:
1980: public void setInterpretNonAscii(String interpretNonAscii) {
1981: this .interpretNonAscii = interpretNonAscii;
1982: }
1983:
1984: public JLabel tiplabel = null;
1985:
1986: public int prevMouseEventX = -1;
1987: public int prevMouseEventY = -1;
1988:
1989: public static JdecTree currentScannedJDecTree = null;
1990:
1991: public static JDialog getArchiveproframe() {
1992: return archiveproframe;
1993: }
1994:
1995: public static void setArchiveproframe(JDialog archiveproframe) {
1996: UIUtil.archiveproframe = archiveproframe;
1997: }
1998:
1999: public static JPanel getArchiveproframedetails() {
2000: return archiveproframedetails;
2001: }
2002:
2003: public static boolean isContinueToExplode() {
2004: return continueToExplode;
2005: }
2006:
2007: public static void setContinueToExplode(boolean continueToExplode) {
2008: UIUtil.continueToExplode = continueToExplode;
2009: }
2010:
2011: public static JLabel getCurrentExplodeEntry() {
2012: return currentExplodeEntry;
2013: }
2014:
2015: public static void setCurrentExplodeEntry(JLabel currentExplodeEntry) {
2016: UIUtil.currentExplodeEntry = currentExplodeEntry;
2017: }
2018:
2019: public static JdecTree getCurrentScannedJDecTree() {
2020: return currentScannedJDecTree;
2021: }
2022:
2023: public static void setCurrentScannedJDecTree(
2024: JdecTree currentScannedJDecTree) {
2025: UIUtil.currentScannedJDecTree = currentScannedJDecTree;
2026: }
2027:
2028: public static String getCurrentSelString() {
2029: return currentSelString;
2030: }
2031:
2032: public static void setCurrentSelString(String currentSelString) {
2033: UIUtil.currentSelString = currentSelString;
2034: }
2035:
2036: public static ArrayList getDecompiledClasses() {
2037: return decompiledClasses;
2038: }
2039:
2040: public static void setDecompiledClasses(ArrayList decompiledClasses) {
2041: UIUtil.decompiledClasses = decompiledClasses;
2042: }
2043:
2044: public static JLabel getExplodeStatus() {
2045: return explodeStatus;
2046: }
2047:
2048: public static void setExplodeStatus(JLabel explodeStatus) {
2049: UIUtil.explodeStatus = explodeStatus;
2050: }
2051:
2052: public static boolean isExplosionInProgress() {
2053: return explosionInProgress;
2054: }
2055:
2056: public static void setExplosionInProgress(
2057: boolean explosionInProgress) {
2058: UIUtil.explosionInProgress = explosionInProgress;
2059: }
2060:
2061: public static int getHistoryindex() {
2062: return historyindex;
2063: }
2064:
2065: public static void setHistoryindex(int historyindex) {
2066: UIUtil.historyindex = historyindex;
2067: }
2068:
2069: public static String getJdecFolder() {
2070: return jdecFolder;
2071: }
2072:
2073: public static void setJdecFolder(String jdecFolder) {
2074: UIUtil.jdecFolder = jdecFolder;
2075: }
2076:
2077: public static JDialog getProframe() {
2078: return proframe;
2079: }
2080:
2081: public static void setProframe(JDialog proframe) {
2082: UIUtil.proframe = proframe;
2083: }
2084:
2085: public static JPanel getProframedetails() {
2086: return proframedetails;
2087: }
2088:
2089: public static JLabel getProframedetails_class() {
2090: return proframedetails_class;
2091: }
2092:
2093: public static void setProframedetails_class(
2094: JLabel proframedetails_class) {
2095: UIUtil.proframedetails_class = proframedetails_class;
2096: }
2097:
2098: public static JLabel getProframedetails_method() {
2099: return proframedetails_method;
2100: }
2101:
2102: public static void setProframedetails_method(
2103: JLabel proframedetails_method) {
2104: UIUtil.proframedetails_method = proframedetails_method;
2105: }
2106:
2107: public static JLabel getProframedetails_pkg() {
2108: return proframedetails_pkg;
2109: }
2110:
2111: public static void setProframedetails_pkg(JLabel proframedetails_pkg) {
2112: UIUtil.proframedetails_pkg = proframedetails_pkg;
2113: }
2114:
2115: public static UIUtil getRef() {
2116: return ref;
2117: }
2118:
2119: public static void setRef(UIUtil ref) {
2120: UIUtil.ref = ref;
2121: }
2122:
2123: public static ArrayList getRegisteredClasses() {
2124: return registeredClasses;
2125: }
2126:
2127: public static void setRegisteredClasses(ArrayList registeredClasses) {
2128: UIUtil.registeredClasses = registeredClasses;
2129: }
2130:
2131: public static JPanel getVersionproframedetails() {
2132: return versionproframedetails;
2133: }
2134:
2135: public static JLabel getVersionproframedetails_class() {
2136: return versionproframedetails_class;
2137: }
2138:
2139: public static void setVersionproframedetails_class(
2140: JLabel versionproframedetails_class) {
2141: UIUtil.versionproframedetails_class = versionproframedetails_class;
2142: }
2143:
2144: public static JLabel getVersionproframedetails_method() {
2145: return versionproframedetails_method;
2146: }
2147:
2148: public static void setVersionproframedetails_method(
2149: JLabel versionproframedetails_method) {
2150: UIUtil.versionproframedetails_method = versionproframedetails_method;
2151: }
2152:
2153: public static WindowListener getWndCloser() {
2154: return wndCloser;
2155: }
2156:
2157: public static void setWndCloser(WindowListener wndCloser) {
2158: UIUtil.wndCloser = wndCloser;
2159: }
2160:
2161: public File getCompileFile() {
2162: return compileFile;
2163: }
2164:
2165: public void setCompileFile(File compileFile) {
2166: this .compileFile = compileFile;
2167: }
2168:
2169: public ArrayList getCpdesc() {
2170: return cpdesc;
2171: }
2172:
2173: public void setCpdesc(ArrayList cpdesc) {
2174: this .cpdesc = cpdesc;
2175: }
2176:
2177: public java.lang.String getCurrentFile() {
2178: return currentFile;
2179: }
2180:
2181: public void setCurrentFile(java.lang.String currentFile) {
2182: this .currentFile = currentFile;
2183: }
2184:
2185: public OutputFrame getDecompileFrame() {
2186: return decompileFrame;
2187: }
2188:
2189: public void setDecompileFrame(OutputFrame decompileFrame) {
2190: this .decompileFrame = decompileFrame;
2191: }
2192:
2193: public DefaultEditorKit getDefedkit() {
2194: return defedkit;
2195: }
2196:
2197: public void setDefedkit(DefaultEditorKit defedkit) {
2198: this .defedkit = defedkit;
2199: }
2200:
2201: public java.lang.String getFileSelected() {
2202: return fileSelected;
2203: }
2204:
2205: public void setFileSelected(java.lang.String fileSelected) {
2206: this .fileSelected = fileSelected;
2207: }
2208:
2209: public java.lang.String getFileSelectedPath() {
2210: return fileSelectedPath;
2211: }
2212:
2213: public void setFileSelectedPath(java.lang.String fileSelectedPath) {
2214: this .fileSelectedPath = fileSelectedPath;
2215: }
2216:
2217: public HashMap getFiletabmap() {
2218: return filetabmap;
2219: }
2220:
2221: public void setFiletabmap(HashMap filetabmap) {
2222: this .filetabmap = filetabmap;
2223: }
2224:
2225: public int getFinish() {
2226: return finish;
2227: }
2228:
2229: public void setFinish(int finish) {
2230: this .finish = finish;
2231: }
2232:
2233: public java.lang.String getJavacResFile() {
2234: return javacResFile;
2235: }
2236:
2237: public void setJavacResFile(java.lang.String javacResFile) {
2238: this .javacResFile = javacResFile;
2239: }
2240:
2241: public File getJavaFolder() {
2242: return javaFolder;
2243: }
2244:
2245: public void setJavaFolder(File javaFolder) {
2246: this .javaFolder = javaFolder;
2247: }
2248:
2249: public SimpleAttributeSet getMethod() {
2250: return method;
2251: }
2252:
2253: public void setMethod(SimpleAttributeSet method) {
2254: this .method = method;
2255: }
2256:
2257: public SimpleAttributeSet getOrig() {
2258: return orig;
2259: }
2260:
2261: public void setOrig(SimpleAttributeSet orig) {
2262: this .orig = orig;
2263: }
2264:
2265: public int getPrevMouseEventX() {
2266: return prevMouseEventX;
2267: }
2268:
2269: public void setPrevMouseEventX(int prevMouseEventX) {
2270: this .prevMouseEventX = prevMouseEventX;
2271: }
2272:
2273: public int getPrevMouseEventY() {
2274: return prevMouseEventY;
2275: }
2276:
2277: public void setPrevMouseEventY(int prevMouseEventY) {
2278: this .prevMouseEventY = prevMouseEventY;
2279: }
2280:
2281: public ArrayList getPropNames() {
2282: return propNames;
2283: }
2284:
2285: public void setPropNames(ArrayList propNames) {
2286: this .propNames = propNames;
2287: }
2288:
2289: public ArrayList getPropValues() {
2290: return propValues;
2291: }
2292:
2293: public void setPropValues(ArrayList propValues) {
2294: this .propValues = propValues;
2295: }
2296:
2297: public ArrayList getRecentfiles() {
2298: return recentfiles;
2299: }
2300:
2301: public void setRecentfiles(ArrayList recentfiles) {
2302: this .recentfiles = recentfiles;
2303: }
2304:
2305: public HashMap getResetShades() {
2306: return resetShades;
2307: }
2308:
2309: public void setResetShades(HashMap resetShades) {
2310: this .resetShades = resetShades;
2311: }
2312:
2313: public int getStart() {
2314: return start;
2315: }
2316:
2317: public void setStart(int start) {
2318: this .start = start;
2319: }
2320:
2321: public Hashtable getTabfilemap() {
2322: return tabfilemap;
2323: }
2324:
2325: public void setTabfilemap(Hashtable tabfilemap) {
2326: this .tabfilemap = tabfilemap;
2327: }
2328:
2329: public JLabel getTiplabel() {
2330: return tiplabel;
2331: }
2332:
2333: public void setTiplabel(JLabel tiplabel) {
2334: this .tiplabel = tiplabel;
2335: }
2336:
2337: public static JDialog getVersionproframe() {
2338: return versionproframe;
2339: }
2340:
2341: public boolean isConfigChanged() {
2342: return configChanged;
2343: }
2344:
2345: public String getConstantPoolResultFile() {
2346: return constantPoolResultFile;
2347: }
2348:
2349: public ArrayList getFavList() {
2350: return favList;
2351: }
2352:
2353: public boolean isSearch() {
2354: return search;
2355: }
2356:
2357: public static void setVersionlines(HashMap versionlines) {
2358: UIUtil.versionlines = versionlines;
2359: }
2360:
2361: public void setFilterframe(ExtraOptions filterframe) {
2362: this .filterframe = filterframe;
2363: }
2364:
2365: public void setOutputFilePath(java.lang.String folderPath) {
2366: this .outputFilePath = folderPath;
2367: }
2368:
2369: public void setGtkClass(String gtkClass) {
2370: this .gtkClass = gtkClass;
2371: }
2372:
2373: public void setJarFilePath(java.lang.String jarFilePath) {
2374: this .jarFilePath = jarFilePath;
2375: }
2376:
2377: public void setJavaClassFile(java.lang.String javaClassFile) {
2378: this .javaClassFile = javaClassFile;
2379: }
2380:
2381: public void setJDecOption(java.lang.String decOption) {
2382: JDecOption = decOption;
2383: }
2384:
2385: public void setLogLevel(java.lang.String logLevel) {
2386: this .logLevel = logLevel;
2387: }
2388:
2389: public void setLogMode(java.lang.String logMode) {
2390: this .logMode = logMode;
2391: }
2392:
2393: public void setLogPath(java.lang.String logPath) {
2394: this .logPath = logPath;
2395: }
2396:
2397: public void setMetalClass(String metalClass) {
2398: this .metalClass = metalClass;
2399: }
2400:
2401: public void setMotifClass(String motifClass) {
2402: this .motifClass = motifClass;
2403: }
2404:
2405: public void setMode(java.lang.String outputMode) {
2406: this .mode = outputMode;
2407: }
2408:
2409: public void setProjectTempDir(java.lang.String projectTempDir) {
2410: this .projectTempDir = projectTempDir;
2411: }
2412:
2413: public void setShowImport(java.lang.String showImport) {
2414: this .showImport = showImport;
2415: }
2416:
2417: public void setShowWelcome(String showWelcome) {
2418: this .showWelcome = showWelcome;
2419: }
2420:
2421: public void setWindowsClass(String windowsClass) {
2422: this .windowsClass = windowsClass;
2423: }
2424:
2425: public String getShowFlowerBracketAtSameLine() {
2426: return showFlowerBracketAtSameLine;
2427: }
2428:
2429: public void setShowFlowerBracketAtSameLine(
2430: String showFlowerBracketAtSameLine) {
2431: this.showFlowerBracketAtSameLine = showFlowerBracketAtSameLine;
2432: }
2433:
2434: }
|