📄 ae.java
字号:
buttonTextNew.addActionListener(dbuttonaction);
toolText.add(buttonTextNew);
buttonTextOpen = new DButton(Icons.Open);
buttonTextOpen.setTip("Open a document");
buttonTextOpen.addActionListener(dbuttonaction);
toolText.add(buttonTextOpen);
buttonTextSave = new DButton(Icons.Save);
buttonTextSave.setTip("Save the current document");
buttonTextSave.addActionListener(dbuttonaction);
toolText.add(buttonTextSave);
toolText.addSpacer(30, 36);
buttonTextFind = new DButton(Icons.Search);
buttonTextFind.addActionListener(dbuttonaction);
buttonTextFind.setTip("Find a string");
toolText.add(buttonTextFind);
buttonTextReplace = new DButton(Icons.Replace);
buttonTextReplace.addActionListener(dbuttonaction);
buttonTextReplace.setTip("Replace a string");
toolText.add(buttonTextReplace);
buttonqsearch = new DButton(Icons.Search);
buttonqsearch.addActionListener(dbuttonaction);
buttonqsearch.setTip("Find a string");
toolDir.add(buttonqsearch);
buttonA = new DButton(true);
buttonA.setLabel(Preferences.shortcut[0], true);
buttonA.setTip("Shortcut for path");
buttonA.addActionListener(dbuttonaction);
dtoolbar.add(buttonA);
buttonC = new DButton(true);
buttonC.setLabel(Preferences.shortcut[1], true);
buttonC.setTip("Shortcut for path");
buttonC.addActionListener(dbuttonaction);
dtoolbar.add(buttonC);
buttonD = new DButton(true);
buttonD.setLabel(Preferences.shortcut[2], true);
buttonD.setTip("Shortcut for path");
buttonD.addActionListener(dbuttonaction);
dtoolbar.add(buttonD);
buttonE = new DButton(true);
buttonE.setLabel(Preferences.shortcut[3], true);
buttonE.setTip("Shortcut for path");
buttonE.addActionListener(dbuttonaction);
dtoolbar.add(buttonE);
buttonF = new DButton(true);
buttonF.setLabel(Preferences.shortcut[4], true);
buttonF.setTip("Shortcut for path");
buttonF.addActionListener(dbuttonaction);
dtoolbar.add(buttonF);
buttonG = new DButton(true);
buttonG.setLabel(Preferences.shortcut[5], true);
buttonG.setTip("Shortcut for path");
buttonG.addActionListener(dbuttonaction);
dtoolbar.add(buttonG);
buttonH = new DButton(true);
buttonH.setLabel(Preferences.shortcut[6], true);
buttonH.setTip("Shortcut for path");
buttonH.addActionListener(dbuttonaction);
dtoolbar.add(buttonH);
buttonI = new DButton(true);
buttonI.setLabel(Preferences.shortcut[7], true);
buttonI.setTip("Shortcut for path");
buttonI.addActionListener(dbuttonaction);
dtoolbar.add(buttonI);
setTextStyle();
setDirStyle();
setTreeStyle();
setMessageStyle();
addWindowListener(this);
filecopy.addActionListener(action);
Disp.it("Loading lists to fill memories");
mem.srcPath = AEDir;
mem.dstPath = AEDir;
mem.setComponents(source.combo, target.combo, tools.dynList, references.dynList, recents.dynList, aesetup.cards, aesetup.comboExt, aesetup.comboAss);
if(!flag)
{
tabbedAE.select(1);
editor.setPath(AEDir, "install.txt");
editor.open();
} else
{
tabbedAE.select(0);
}
mem.load(AEDir);
source.setArcSort(Preferences.ArcSort);
target.setArcSort(Preferences.ArcSort);
String s1 = mem.srcPath;
if(s1.startsWith("a:"))
s1 = "c:\\";
setSrcPath(s1);
s1 = mem.dstPath;
if(s1.startsWith("a:"))
s1 = "c:\\";
setDstPath(s1);
tools.restore();
references.restore();
recents.restore();
editor.setMessage(statusbar);
editor.setHistory(history);
System.out.println("Reading directories");
maskAll();
dirmask = true;
unmaskSome();
source.setSelected(0);
source.requestFocus();
panelSrc.first();
tabDst.select(Preferences.panelTarget);
aesetup.setTab((new Integer(mem.SetupPanel)).intValue());
panelTool.showPanel(toolDir);
source.setPopupParent(tabDir, AEFont);
target.setPopupParent(tabDst, AEFont);
source.combo.setPopupParent(AEFont);
target.combo.setPopupParent(AEFont);
target.miCopy.setEnabled(false);
target.miUnarc.setEnabled(false);
}
public ae(String s)
{
this();
setTitle(s);
}
public synchronized void show()
{
super.show();
SrcFocus();
}
public static void main(String args[])
{
ae ae1 = new ae();
ae1.setVisible(true);
}
public void addNotify()
{
Dimension dimension = getSize();
super.addNotify();
if(fComponentsAdjusted)
return;
setSize(getInsets().left + getInsets().right + dimension.width, getInsets().top + getInsets().bottom + dimension.height);
Component acomponent[] = getComponents();
for(int i = 0; i < acomponent.length; i++)
{
Point point = acomponent[i].getLocation();
point.translate(getInsets().left, getInsets().top);
acomponent[i].setLocation(point);
}
fComponentsAdjusted = true;
}
void addNotify(boolean flag)
{
fComponentsAdjusted = flag;
addNotify();
}
void Exit_Action()
{
if(editor.saveBefore() == 0)
return;
if(source.dir.zipMode)
source.parent();
if(tempo != null)
{
tempo.kill();
tempo = null;
}
System.gc();
if(Preferences.SaveMemory)
{
mem.srcPath = source.getPath();
mem.dstPath = target.getPath();
mem.save(AEDir);
}
if(Preferences.AutoSave)
Preferences.Save();
setVisible(false);
dispose();
System.exit(0);
}
void About()
{
AboutDialog aboutdialog = new AboutDialog(this);
aboutdialog.setRelease("", "");
aboutdialog.setVisible(true);
}
void Explorer()
{
String s;
if(tabDst.getTab() == 1)
{
s = treemanager.getSelected();
} else
{
DirManager dirmanager;
if(srcSelected())
dirmanager = source;
else
dirmanager = target;
s = dirmanager.getSelected();
if(s == null || dirmanager.getSelectedIndex() >= dirmanager.firstFile())
s = "";
s = Path.merge(dirmanager.getDir(), s);
}
dirtools.Run("explorer.exe ", s, false);
}
boolean webPrompt(String s)
{
if(!Preferences.AskHtml)
return true;
String s1 = Path.merge(target.getDir(), s);
File file = new File(s1);
if(file.exists())
{
DialogCYN dialogcyn = new DialogCYN(this, s1 + " exists, replace?");
dialogcyn.show();
return dialogcyn.answer == 1;
} else
{
return true;
}
}
void indexAction()
{
String s = source.getDir();
HtmlList htmllist = new HtmlList(s, source.getTaggedItems());
if(!webPrompt(panelList.htmlName))
return;
String s1 = panelList.htmlDir;
htmllist.setFile(s1, panelList.htmlName);
int i = htmllist.createHtml();
Message(i + " names found");
if(i > 0)
{
associate(htmllist.htmlFile, htmllist.htmlName, false);
if(srcis(s1))
SrcDisp();
if(dstis(s1))
DstDisp();
}
}
void outlineAction()
{
String s = source.getDir();
String s1;
if(srcSelected())
s1 = source.getSelected();
else
if(source.isTagged())
{
s1 = source.getTagged();
} else
{
beep();
Message("Select a text to convert, please.");
return;
}
Outline outline = new Outline(s, s1);
String s2 = panelOutline.htmlName;
String s3 = panelOutline.htmlDir;
if(!webPrompt(s2))
return;
outline.setFile(s3, s2);
int i = outline.createHtml();
if(i > 0)
{
associate(outline.htmlFile, outline.htmlName, false);
if(srcis(s3))
SrcDisp();
if(dstis(s3))
DstDisp();
}
Message("Generated " + outline.htmlFile + " " + i + " lines");
}
void thumbnailAction()
{
String s = source.getDir();
int i = source.dir.MAXINDIRS;
Dimension dimension = getToolkit().getScreenSize();
Thumbnail thumbnail = new Thumbnail(dimension, source.dirList, i, s);
if(!webPrompt(panelThumbnail.htmlName))
return;
String s1 = panelThumbnail.getDir(source.getDir());
Thumbnail _tmp = thumbnail;
Thumbnail.setFile(s1, panelThumbnail.htmlName);
int j = thumbnail.createHtml();
if(j > 0)
{
Thumbnail _tmp1 = thumbnail;
Thumbnail _tmp2 = thumbnail;
associate(Thumbnail.htmlFile, Thumbnail.htmlName, false);
if(srcis(s1))
SrcDisp();
if(dstis(s1))
DstDisp();
}
Message(thumbnail.getFile() + " created with " + j + " images");
}
void MakeSrc(boolean flag)
{
source.setPath(treemanager.getSelected());
source.dirDisp(true);
}
void setPath(String s, String s1)
{
m_dirName = s;
m_fileName = s1;
m_pathName = Path.merge(m_dirName, m_fileName);
}
void setPath(String s)
{
m_dirName = s;
m_fileName = "";
m_pathName = s;
}
void manual()
{
String s;
if(aesetup.hasHtml())
{
s = ".html";
} else
{
s = ".txt";
if(editor.savePrevious())
return;
}
String s1 = Preferences.LangFile[Preferences.Language] + s;
Message("Loading manual: " + AEDir + s1);
source.openPath(Path.merge(AEDir, s1), s1, false, false);
}
void newText()
{
editor.setPath(source.getDir(), "+Editor");
if(editor.newText())
{
changeTextTab();
displayText();
Message("New empty document created");
} else
{
dispTip("Cancelled");
}
}
void closeText()
{
if(editor.close())
{
editor.setPath(null, "+Editor");
changeTextTab();
setPath(null, null);
Message("Document closed");
}
}
void openTextDialog(boolean flag)
{
if(editor.savePrevious())
return;
FileDialog filedialog = new FileDialog(this, "Open", 0);
filedialog.show();
setPath(filedialog.getDirectory(), filedialog.getFile());
if(!flag && associate(m_pathName, m_fileName, true))
{
return;
} else
{
openText(m_pathName, m_fileName, true);
return;
}
}
void setModified()
{
String s = editor.getDir();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -