/*
* IsoFileBrowser.java
*
* Created on February 19, 2006, 4:29 AM
*/
package isoeditor;
import com.sun.corba.se.spi.activation._ActivatorImplBase;
import java.util.*;
import java.io.*;
import oCommon.*;
import oMathFP.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
public class IsoFileBrowserFrame extends IsoInternalFrame implements TreeSelectionListener, TreeModelListener, ComponentListener {
public static String baseDir = "../../data/editor/managed/";
public static String export_clientData_folder = "../../data/client/managed/";
public static boolean export_clientData = true;
public static String export_serverData_folder = "../../data/server/managed/";
public static boolean export_serverData = true;
public static IsoFileBrowserFrame instance;
public DefaultMutableTreeNode rootNode;
public DefaultTreeModel treeModel;
public IsoFileBrowserFrame_treeNode rootNode_obj;
public IsoExportTask exportTask = null;
public static final oEventId event_selected = new oEventId(IsoFileBrowserFrame.class, "selected");
Vector tmpSelectedPathStrings;
Vector tmpExpandedPathStrings;
public static final String filetypes[] = {
"png",
"bit",
"pal",
"til",
"ent",
"imp"};
public static final String fileicons_path[] = {
"fileicon_png",
"fileicon_bit",
"fileicon_pal",
"fileicon_til",
"fileicon_ent",
"fileicon_imp"
};
public static final String diricon_path = "fileicon_dir";
public static ImageIcon fileicons_img[];
public static ImageIcon diricon_img;
static {
fileicons_img = new ImageIcon[fileicons_path.length];
diricon_img = null;
try {
diricon_img = new ImageIcon(IsoMainFrame.class.getResource(IsoMainFrame.internalResource_folder + diricon_path + ".png"));
for (int i = 0; i < fileicons_path.length; i++) {
fileicons_img[i] = new ImageIcon(IsoMainFrame.class.getResource(IsoMainFrame.internalResource_folder + fileicons_path[i] + ".png"));
}
} catch (Exception e) {
System.out.println("Failed to load file icons");
System.out.println(e.toString());
}
oFileManager.baseDir = baseDir;
}
public class MyRenderer extends DefaultTreeCellRenderer {
public MyRenderer() {
}
public Component getTreeCellRendererComponent(
JTree tree,
Object value,
boolean sel,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
super.getTreeCellRendererComponent(
tree, value, sel,
expanded, leaf, row,
hasFocus);
try {
if (value != rootNode && leaf) {
IsoFileBrowserFrame_treeNode nodeobj = (IsoFileBrowserFrame_treeNode)((DefaultMutableTreeNode)value).getUserObject();
String path = nodeobj.path;
File file = new File(getSystemFilePath(path));
if (file.isDirectory()) {
setIcon(diricon_img);
} else {
int index = getIconIndex(path);
if (index >= 0)
setIcon(fileicons_img[index]);
if (isNodeDirty((DefaultMutableTreeNode)value)) {
if (sel) {
setForeground(new Color(175,175,255));
} else {
setForeground(new Color(0,0,255));
}
}
}
}
} catch (ClassCastException e) {
}
return this;
}
public int getIconIndex(String path) {
for (int i = 0; i < filetypes.length; i++) {
if (path.indexOf("." + filetypes[i]) >= 0) {
return i;
}
}
return -1;
}
}
public static boolean copyTransferFailed = false;
public static String copyDstPath = null;
public static final int COPY_KEYSTATE_NONE = 0;
public static final int COPY_KEYSTATE_COPY = 1;
public static final int COPY_KEYSTATE_CUT = 2;
public int copyKeyState = COPY_KEYSTATE_NONE;
public class MyTransferHandler extends TransferHandler {
public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
for (int i = 0; i < transferFlavors.length; i++) {
if (transferFlavors[i].equals(IsoFileBrowserTransferable.dataflavor)
|| transferFlavors[i].equals(DataFlavor.stringFlavor))
return true;
}
return false;
}
public boolean isFileBrowserFlavor(DataFlavor[] transferFlavors) {
for (int i = 0; i < transferFlavors.length; i++) {
if (transferFlavors[i].equals(IsoFileBrowserTransferable.dataflavor))
return true;
}
return false;
}
public boolean isStringFlavor(DataFlavor[] transferFlavors) {
for (int i = 0; i < transferFlavors.length; i++) {
if (transferFlavors[i].equals(DataFlavor.stringFlavor))
return true;
}
return false;
}
protected Transferable createTransferable(JComponent c) {
Vector nodes = getSelectedNodes();
IsoFileBrowserTransferable transVec = new IsoFileBrowserTransferable();
for (int i = 0; i < nodes.size(); i++) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode)nodes.elementAt(i);
transVec.v.addElement(node.getUserObject());
}
if (transVec.v.size() == 0) return null;
return transVec;
}
public int getSourceActions(JComponent c) {
return COPY_OR_MOVE;
}
public boolean importData(JComponent comp, Transferable t) {
if (t == null)
return false;
if (canImport(comp, t.getTransferDataFlavors())) {
if (isFileBrowserFlavor(t.getTransferDataFlavors())) {
try {
IsoFileBrowserTransferable transVec = (IsoFileBrowserTransferable)t.getTransferData(IsoFileBrowserTransferable.dataflavor);
Vector nodesToCopy = new Vector();
for (int i = 0; i < transVec.v.size(); i++) {
IsoFileBrowserFrame_treeNode nodeobj = (IsoFileBrowserFrame_treeNode)transVec.v.elementAt(i);
String path = getStringPathFromFilePath(nodeobj.path);
if (!stringPathExists(path)) {
continue;
}
nodesToCopy.addElement(getTreePathFromStringPath(path).getLastPathComponent());
}
copyDstPath = null;
if (nodesToCopy.size() > 0) {
DefaultMutableTreeNode copyDstNode = getNearestFolder((DefaultMutableTreeNode)fileTree.getLastSelectedPathComponent());
没有合适的资源?快使用搜索试试~ 我知道了~
Java游戏中斜视角编辑器及引擎源代码.7z
共866个文件
java:541个
png:116个
html:52个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 81 浏览量
2022-07-06
09:44:10
上传
评论
收藏 2.17MB 7Z 举报
温馨提示
Java游戏中斜视角编辑器及引擎源代码.7z
资源推荐
资源详情
资源评论
收起资源包目录
Java游戏中斜视角编辑器及引擎源代码.7z (866个子文件)
style.css 2KB
style.css 999B
win32com.dll 27KB
win32com.dll 27KB
NewEntityFile.ent 167B
NewEntityFile.ent 167B
NewEntityFile.ent 167B
IsoMainFrame.form 54KB
IsoFileBrowserFrame.form 43KB
IsoCurveEditorFrame.form 26KB
IsoEntityTreeFrame.form 21KB
IsoMapEditorFrame.form 20KB
IsoObjectPropertiesFrame.form 14KB
IsoMapEditorToolsFrame.form 12KB
ProxyMainWindow.form 11KB
IsoOutputFrame.form 4KB
screenshots_gui_small.gif 88KB
screenshot_console_small.gif 85KB
screenshot_gui1.gif 38KB
screenshot_gui2.gif 30KB
screenshot_gui4.gif 30KB
screenshot_gui7.gif 29KB
screenshot_gui3.gif 29KB
screenshot_gui5.gif 28KB
vtitle.gif 26KB
screenshot_gui8.gif 26KB
screenshot_gui6.gif 23KB
vtitle.gif 22KB
screenshot_console.gif 13KB
steel.gif 3KB
title.gif 3KB
drop1.gif 803B
drop2.gif 620B
drop3.gif 175B
arrow.gif 112B
checkmark.gif 63B
usage.html 41KB
examples.html 31KB
alternatives.html 21KB
examples.html 17KB
gui.html 17KB
ant.html 16KB
troubleshooting.html 16KB
GPL.html 16KB
downloads.html 13KB
FAQ.html 10KB
refcard.html 10KB
limitations.html 5KB
introduction.html 5KB
testimonials.html 4KB
results.html 4KB
feedback.html 4KB
main.html 3KB
usage.html 2KB
package.html 2KB
acknowledgements.html 2KB
screenshots.html 2KB
introduction.html 2KB
license.html 2KB
sections.html 2KB
wtk.html 2KB
sections.html 2KB
index.html 2KB
quality.html 2KB
GPL_exception.html 2KB
index.html 1KB
package.html 664B
index.html 600B
title.html 449B
package.html 379B
package.html 162B
package.html 147B
package.html 132B
package.html 129B
package.html 121B
package.html 104B
package.html 99B
package.html 93B
package.html 91B
package.html 89B
package.html 87B
package.html 85B
package.html 84B
package.html 82B
package.html 81B
package.html 69B
package.html 65B
package.html 64B
favicon.ico 7KB
NewMap.imp 11KB
NewMap.imp 11KB
NewMap.imp 6KB
ant.jar 721KB
proguard.jar 409KB
proguardgui.jar 123KB
jappo.jar 56KB
comm.jar 53KB
comm.jar 27KB
retrace.jar 5KB
IsoFileBrowserFrame.java 126KB
共 866 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
BryanDing
- 粉丝: 311
- 资源: 5578
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功