[Jrisk-cvs] SF.net SVN: jrisk:[581] XcodeTranslationTool/src/net/yura/translation/ plugins/xcode
Brought to you by:
yuranet
From: <yu...@us...> - 2011-11-17 19:55:20
|
Revision: 581 http://jrisk.svn.sourceforge.net/jrisk/?rev=581&view=rev Author: yuranet Date: 2011-11-17 19:55:14 +0000 (Thu, 17 Nov 2011) Log Message: ----------- add files Modified Paths: -------------- XcodeTranslationTool/src/net/yura/translation/plugins/xcode/Project.java XcodeTranslationTool/src/net/yura/translation/plugins/xcode/XcodeComm.java XcodeTranslationTool/src/net/yura/translation/plugins/xcode/XcodeNet.java Modified: XcodeTranslationTool/src/net/yura/translation/plugins/xcode/Project.java =================================================================== --- XcodeTranslationTool/src/net/yura/translation/plugins/xcode/Project.java 2011-11-17 19:41:38 UTC (rev 580) +++ XcodeTranslationTool/src/net/yura/translation/plugins/xcode/Project.java 2011-11-17 19:55:14 UTC (rev 581) @@ -103,6 +103,16 @@ return new File(screen.getParent() + "/screens", screenUID); } + public void addScreen(String file,byte[] bytes) throws IOException { + + File destFile = new File( new File(screen.getParentFile(),"/screens") , file); + + FileOutputStream fos = new FileOutputStream(destFile); + fos.write(bytes); + fos.close(); + + } + public void addScreen(File file) throws IOException { File destFile = new File( new File(screen.getParentFile(),"/screens") ,file.getName()); Modified: XcodeTranslationTool/src/net/yura/translation/plugins/xcode/XcodeComm.java =================================================================== --- XcodeTranslationTool/src/net/yura/translation/plugins/xcode/XcodeComm.java 2011-11-17 19:41:38 UTC (rev 580) +++ XcodeTranslationTool/src/net/yura/translation/plugins/xcode/XcodeComm.java 2011-11-17 19:55:14 UTC (rev 581) @@ -281,4 +281,8 @@ project.addScreen(file); } + public void addScreen(String name,byte[] bytes) throws Exception { + project.addScreen(name,bytes); + } + } Modified: XcodeTranslationTool/src/net/yura/translation/plugins/xcode/XcodeNet.java =================================================================== --- XcodeTranslationTool/src/net/yura/translation/plugins/xcode/XcodeNet.java 2011-11-17 19:41:38 UTC (rev 580) +++ XcodeTranslationTool/src/net/yura/translation/plugins/xcode/XcodeNet.java 2011-11-17 19:55:14 UTC (rev 581) @@ -1,14 +1,15 @@ package net.yura.translation.plugins.xcode; -import java.awt.Image; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.File; +import java.io.FileInputStream; import java.io.InputStream; import java.util.Locale; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JCheckBox; +import net.yura.mobile.util.SystemUtil; import net.yura.translation.MyNode; import net.yura.translation.PartnerNode; import net.yura.translation.plugins.NetComm; @@ -58,8 +59,15 @@ return new ImageIcon(image); } - public void addScreen(File file) { + public void addScreen(File file) throws Exception { + FileInputStream filein = new FileInputStream(file); + byte[] bytearray = SystemUtil.getData(filein, (int)file.length()); + Object[] messages = new Object[2]; + messages[0] = file.getName(); + messages[1] = bytearray; + + callMethod("addScreen",messages); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |