⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inireader.java

📁 java xml 应用开发
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
                tmp = br.readLine();
            }
        }
        catch (IOException ioe)
        {
            System.out.println("An IOException has occurred");
        }
    }
    
    private void newINIFile()
    {
        try
        {
            final PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("Editor.ini")));

            pw.println("[General]");
            pw.println("language=" + language);
            pw.println("lookAndFeel=" + lookAndFeel);
            pw.println();
            
            pw.println("[Recent files]");
            
            for(int i = 0; i < recentFiles.length; i++)
            {
                if (recentFiles[i] != null)
                    pw.println("file=" + recentFiles[i]);
            }
            pw.println();
            
            pw.println("[Validate and Edit]");
            pw.println("autoValidate=" + autoValidate);
            pw.println("highlightFN=" + highlightFN);
            pw.println("readOnly=" + readOnly);
            pw.println();
            
            pw.println("[Show in Tree View]");
            pw.println("attribute=" + attribute);
            pw.println("inheritedAttr=" + inheritedAttr);
            pw.println();
            
            pw.println("[Icons]");
            
            for (int i = 0; i < iconStrings.length; i++)
            {
                if (iconStrings[i] != null)
                    pw.println(iconStrings[i]);
            }
            pw.println();

            //20040906 MRE
            pw.println("[Send to Device]");
            pw.println("method=" + methodSendToDevice);
            
            pw.close();
        }
        catch (IOException ioe)
        {
            System.out.println("File is a directory or cannot be created");
        }
        
        try
        {
            fis = new FileInputStream("Editor.ini");
            br = new BufferedReader(new InputStreamReader(fis));
        }
        catch (FileNotFoundException fnfe)
        {
            System.err.println(fnfe);
        }
    }
    
    private void checkIcon(String s)
    {
        final int index = s.indexOf("=") + 1;
        final String iconName = s.substring(0, index);
        final String iconPath = s.substring(index, s.length());
            
        check: for (int i = 0; i < iconStrings.length; i++)
        {
            final String temp = iconStrings[i].substring(0, iconStrings[i].indexOf("=") + 1);
            
            if (iconName.equals(temp))
            {
                iconStrings[i] = iconName + iconPath;
                break check;
            }
        }
    }
    
    public void setIcons()
    {
        for (int i = 0; i < iconStrings.length; i++)
        {
            final int index = iconStrings[i].indexOf("=") + 1;
            final String iconName = iconStrings[i].substring(0, index);
            final String iconPath = iconStrings[i].substring(index, iconStrings[i].length());

            if (iconName.equals("Attribute with Error="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    errAttIcon = defaultErrAttIcon;
                else
                    errAttIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Attribute with Error (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    errAttIconS = defaultErrAttIconS;
                else
                    errAttIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Element with Error="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    errElemIcon = defaultErrElemIcon;
                else
                    errElemIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Element with Error (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    errElemIconS = defaultErrElemIconS;
                else
                    errElemIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Attribute="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    attIcon = defaultAttIcon;
                else
                    attIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Attribute (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    attIconS = defaultAttIconS;
                else
                    attIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Inherited Attribute="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    iAttIcon = defaultIAttIcon;
                else
                    iAttIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Inherited Attribute (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    iAttIconS = defaultIAttIconS;
                else
                    iAttIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("PartID Key Attribute="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    pAttIcon = defaultPAttIcon;
                else
                    pAttIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("PartID Key Attribute (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    pAttIconS = defaultPAttIconS;
                else
                    pAttIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Inherited PartID Key Attribute="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    iPAttIcon = defaultIPAttIcon;
                else
                    iPAttIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Inherited PartID Key Attribute (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    iPAttIconS = defaultIPAttIconS;
                else
                    iPAttIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("rRef Attribute="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    refAttIcon = defaultRefAttIcon;
                else
                    refAttIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("rRef Attriubte (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    refAttIconS = defaultRefAttIconS;
                else
                    refAttIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Element="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    elemIcon = defaultElemIcon;
                else
                    elemIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Element (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    elemIconS = defaultElemIconS;
                else
                    elemIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("JDF Element="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    jdfElemIcon = defaultJDFElemIcon;
                else
                    jdfElemIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("JDF Element (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    jdfElemIconS = defaultJDFElemIconS;
                else
                    jdfElemIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Input rRef Element="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    rRefInElemIcon = defaultRefInElemIcon;
                else
                    rRefInElemIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Input rRef Element (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    rRefInElemIconS = defaultRefInElemIconS;
                else
                    rRefInElemIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Output rRef Element="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    rRefOutElemIcon = defaultRefOutElemIcon;
                else
                    rRefOutElemIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("Output rRef Element (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    rRefOutElemIconS = defaultRefOutElemIconS;
                else
                    rRefOutElemIconS = new ImageIcon(iconPath);
            }

            else if (iconName.equals("rRef Element="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    rRefElemIcon = defaultRefElemIcon;
                else
                    rRefElemIcon = new ImageIcon(iconPath);
            }

            else if (iconName.equals("rRef Element (selected)="))
            {
                if (iconPath.equalsIgnoreCase("default"))
                    rRefElemIconS = defaultRefElemIconS;
                else
                    rRefElemIconS = new ImageIcon(iconPath);
            }
//            else if (iconName.equals("JDF Folder="))
//            {
//            	if (iconPath.equalsIgnoreCase("default"))
//            		execJDFIcon = defaultExecJDFIcon;
//            }
            
//            invElemIcon = defaultInvElemIcon;
//            invAttIcon = defaultInvAttIcon;
//            misElemIcon = defaultMisElemIcon;
//            misAttIcon = defaultMisAttIcon;
//            unkElemIcon = defaultUnkElemIcon;
//            unkAttIcon = defaultUnkAttIcon;
//            execJDFIcon = defaultExecJDFIcon;
//            invElemIconS = defaultInvElemIconS;
//            invAttIconS = defaultInvAttIconS;
//            misElemIconS = defaultMisElemIconS;
//            misAttIconS = defaultMisAttIconS;
//            unkElemIconS = defaultUnkElemIconS;
//            unkAttIconS = defaultUnkAttIconS;
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -