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

📄 ae.java

📁 Advanced explorer to handle day today work
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
        if(dstis(s))
            target.modified = true;
        if(srcis(s))
            source.modified = true;
    }

    void saveAs()
    {
        if(editor.saveAs())
        {
            changeTextTab();
            displayText();
            updateConditional(editor.UpdateDir);
        }
    }

    void openText(String s, String s1, boolean flag)
    {
        if(Preferences.EditorAss)
        {
            openWordpad(s, flag);
            return;
        }
        if(editor.savePrevious())
            return;
        m_pathName = s;
        m_fileName = s1;
        m_dirName = Path.getPath(s);
        File file = new File(m_pathName);
        if(!file.exists())
        {
            dispTip("File not found " + m_pathName);
            return;
        }
        long l = file.length();
        if(l == 0)
        {
            dispTip("Size is " + l + " character...");
            return;
        }
        if(!openViewer(flag))
        {
            openWordpad(s, flag);
            return;
        } else
        {
            return;
        }
    }

    boolean openViewer(boolean flag)
    {
        Message("Reading " + m_pathName);
        editor.setPath(m_dirName, m_fileName);
        if(!editor.open())
        {
            setPath(null, null);
            editor.setPath("", "+Editor");
            changeTextTab();
            return false;
        }
        changeTextTab();
        if(flag)
            addRecents(m_dirName, m_fileName);
        tabbedAE.select(1);
        return true;
    }

    void openWordpad(String s, boolean flag)
    {
        if(dirtools.LaunchPrgFile(Preferences.edName, s) && flag)
            addRecents(m_dirName, m_fileName);
    }

    void processAny(DirManager dirmanager, String s, boolean flag)
    {
        String s1 = dirmanager.m_pathName;
        String s2 = dirmanager.m_fileName;
        String s3 = Path.getExtension(s2);
        if(s.equals("assoc") && associate(s1, s2, flag))
        {
            dirmanager.associated = true;
            return;
        }
        if(s.equals("graph"))
        {
            if(DirManager.inside(extGraphic, s3))
            {
                display(s1, s2, true);
                return;
            }
            if(DirManager.inside(extUnsupported, s3))
            {
                dispTip(s3 + " format not supported");
                return;
            }
        }
        if(s.equals("sound") && DirManager.inside(extSound, s3))
        {
            dirtools.sound(s1, s2);
            return;
        }
        if(s.equals("addprg"))
        {
            addPrograms();
            return;
        }
        if(s.equals("adddoc"))
        {
            addReferences();
            return;
        }
        if(s.equals("text"))
        {
            openText(s1, s2, flag);
            return;
        } else
        {
            dispTip("Command not processed");
            return;
        }
    }

    void actionDynamic(FileList filelist, String s)
    {
        int i = (new Integer(s)).intValue();
        String s1 = filelist.getDir(i);
        String s2 = filelist.getName(i);
        setPath(s1, s2);
        String s3 = Path.getExtension(s2);
        if(DirManager.inside(DirManager.graflist, s3))
        {
            tabbedAE.setPanel(0);
            display(m_pathName, s2, false);
            return;
        }
        if(DirManager.inside(DirManager.soundlist, s3))
        {
            dirtools.sound(m_pathName, s2);
            return;
        }
        if(associate(m_pathName, s2, false))
        {
            return;
        } else
        {
            openText(m_pathName, s2, false);
            return;
        }
    }

    boolean associate(String s, String s1, boolean flag)
    {
        String s2 = Path.getExtension(s1);
        int i = aesetup.comboExt.search(s2);
        if(i == -1)
            return false;
        AESetup _tmp = aesetup;
        if(!AESetup.enableAss[i])
            return false;
        String s3 = aesetup.comboAss.getListText(i);
        if(dirtools.LaunchPrgFile(s3, s) && flag)
            addRecents(s, s1);
        return true;
    }

    void swapDirs()
    {
        String s = source.getDir();
        String s1 = target.getDir();
        int i = target.getSelectedIndex();
        int j = source.getSelectedIndex();
        setSrcPath(s1);
        setDstPath(s);
        SrcDisp();
        DstDisp();
        dispTip("Source and destination swapped");
        source.showIt(i);
        target.showIt(j);
        source.requestFocus();
    }

    public void compare(int i)
    {
        int j = 0;
        int l = 0;
        String as[] = {
            "lists, ", "any, ", "versions, ", "data, "
        };
        String as1[] = source.getListItems();
        String as2[] = target.getListItems();
        dispTip("Comparing source and target lists...");
        source.setPainting(false);
        source.deselectAll();
        setCursor(new Cursor(3));
        int i1 = source.countItems();
        for(int j1 = 0; j1 < i1; j1++)
        {
            boolean flag = i <= 1;
            for(int k1 = 0; k1 < target.countItems(); k1++)
            {
                if(!Path.equals(as1[j1], as2[k1]))
                    continue;
                if(i != 0)
                {
                    flag = true;
                    String s1 = Path.merge(source.getDir(), as1[j1]);
                    String s2 = Path.merge(target.getDir(), as2[k1]);
                    if(i != 2 ? !DirTools.compare(s1, s2) : Path.newVersion(s1, s2))
                        break;
                }
                j++;
                flag = false;
                break;
            }

            if(flag)
            {
                source.selectMultiple(j1);
                if(i > 1)
                    l++;
            }
        }

        String s = "";
        int k = i1 - j;
        switch(i)
        {
        default:
            break;

        case 0: // '\0'
        case 1: // '\001'
            s = "Comparing " + as[i] + j + "/" + i1 + " matches and " + k + " no found or different";
            if(k > 0)
                s = s + " and tagged";
            break;

        case 2: // '\002'
        case 3: // '\003'
            int l1 = j + l;
            s = "Comparing " + as[i] + j + "/" + l1 + " identical, " + l + " different";
            if(l > 0)
                s = s + " and tagged";
            break;
        }
        Message(s);
        source.setPainting(true);
        source.update(false);
        setCursor(new Cursor(0));
    }

    boolean srcSelected()
    {
        return source.isSelected();
    }

    boolean dstSelected()
    {
        return target.isSelected();
    }

    boolean dstTagged()
    {
        return target.isTagged();
    }

    int whatWindow()
    {
        boolean flag = source.isSelected();
        boolean flag1 = target.isSelected();
        if(flag && !flag1)
            return 0;
        return flag || !flag1 ? -1 : 1;
    }

    int whichWindow()
    {
        int i = whatWindow();
        if(i == -1)
        {
            dispTip("Select files ever in source or target window");
            beep();
        }
        return i;
    }

    void processEdit(DirManager dirmanager)
    {
        String s = dirmanager.getDir();
        String s1 = dirmanager.getSelected();
        openText(Path.merge(s, s1), s1, true);
    }

    void Make()
    {
        int i = whichWindow();
        if(i == -1)
            return;
        String as[] = new String[2];
        as[0] = "source";
        as[1] = "target";
        String s = "Creating a sub-directory in " + as[i];
        if(i == 1)
            target.make(s);
        else
            source.make(s);
    }

    void actionProgram(int i)
    {
        int j = whatWindow();
        String s = tools.get(i);
        String s1 = tools.getName(i);
        if(j == -1)
        {
            dirtools.Launch(s, s1);
            return;
        }
        String s2 = null;
        String s3 = null;
        if(j == 0)
        {
            s3 = source.getDir();
            s2 = source.getSelected();
        }
        if(j == 1)
        {
            s3 = target.getDir();
            s2 = target.getSelected();
        }
        Message("Launching " + s + " with " + s2);
        dirtools.LaunchPrgFile(s, Path.merge(s3, s2));
    }

    void shortcut(int i)
    {
        setSrcPath(Preferences.longpath[i]);
        SrcDisp();
    }

    void Locate()
    {
        LocateDialog locatedialog = new LocateDialog(this, LocatePrevious);
        locatedialog.setCurDrive(source.getDrive());
        locatedialog.setVisible(true);
        LocatePrevious = Path.splitFile(locatedialog.getInput());
        if(locatedialog.result == 1)
        {
            setSrcPath(locatedialog.dirfound);
            source.dirDisp(true);
            source.setSelected(locatedialog.filefound, true);
            source.requestFocus();
            return;
        }
        if(locatedialog.result == 2)
        {
            OrigineIsSrc = true;
            setPath(locatedialog.dirfound, locatedialog.filefound);
            tabbedAE.select(0);
            source.makePath(locatedialog.dirfound, locatedialog.filefound);
            source.openCommon(true);
            source.requestFocus();
        }
    }

    void messageInDir()
    {
        dispTip("Select a directory in target to copy into");
        beep();
    }

    void fileCopy(boolean flag)
    {
        boolean flag1 = true;
        String s = null;
        String s1 = "";
        if(editor.isVisible())
            return;
        if(!source.testSelected(0))
            return;
        if(flag)
            if(dstTagged() && target.isDir())
            {
                s = target.getTagged();
            } else
            {
                messageInDir();
                return;
            }
        String as[] = source.getSelectedItems();
        int i = 0;
        boolean flag2 = true;
        String 

⌨️ 快捷键说明

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