├── src ├── Main.java ├── Transmit.java ├── UdpReceive.java ├── ProgressFrame.java ├── HttpThread_UpLoad.java ├── HttpThread_DownLoad.java └── MyColorUtil.java ├── bin ├── Client.class ├── Main$1.class ├── Main.class ├── Server.class ├── MyButton.class ├── MyPanel.class ├── inframe.class ├── outframe.class ├── MyColorUtil.class ├── UdpReceive.class ├── mainFrame$1.class ├── mainFrame$2.class ├── mainFrame$3.class ├── mainFrame.class ├── pathmanager.class ├── HttpThread_UpLoad.class ├── HttpThread_DownLoad.class └── mainFrame$ButtonAction.class ├── 灵动快传PC版V2.1.jar ├── github-images-folder ├── main.jpg ├── zidingyi.jpg ├── lixianwenjian.jpg └── xiazaishezhi.jpg ├── .classpath ├── .project ├── .settings └── org.eclipse.jdt.core.prefs └── README.md /src/Main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/src/Main.java -------------------------------------------------------------------------------- /bin/Client.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/Client.class -------------------------------------------------------------------------------- /bin/Main$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/Main$1.class -------------------------------------------------------------------------------- /bin/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/Main.class -------------------------------------------------------------------------------- /bin/Server.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/Server.class -------------------------------------------------------------------------------- /灵动快传PC版V2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/灵动快传PC版V2.1.jar -------------------------------------------------------------------------------- /bin/MyButton.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/MyButton.class -------------------------------------------------------------------------------- /bin/MyPanel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/MyPanel.class -------------------------------------------------------------------------------- /bin/inframe.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/inframe.class -------------------------------------------------------------------------------- /bin/outframe.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/outframe.class -------------------------------------------------------------------------------- /src/Transmit.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/src/Transmit.java -------------------------------------------------------------------------------- /bin/MyColorUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/MyColorUtil.class -------------------------------------------------------------------------------- /bin/UdpReceive.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/UdpReceive.class -------------------------------------------------------------------------------- /bin/mainFrame$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/mainFrame$1.class -------------------------------------------------------------------------------- /bin/mainFrame$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/mainFrame$2.class -------------------------------------------------------------------------------- /bin/mainFrame$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/mainFrame$3.class -------------------------------------------------------------------------------- /bin/mainFrame.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/mainFrame.class -------------------------------------------------------------------------------- /bin/pathmanager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/pathmanager.class -------------------------------------------------------------------------------- /src/UdpReceive.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/src/UdpReceive.java -------------------------------------------------------------------------------- /src/ProgressFrame.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/src/ProgressFrame.java -------------------------------------------------------------------------------- /src/HttpThread_UpLoad.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/src/HttpThread_UpLoad.java -------------------------------------------------------------------------------- /bin/HttpThread_UpLoad.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/HttpThread_UpLoad.class -------------------------------------------------------------------------------- /src/HttpThread_DownLoad.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/src/HttpThread_DownLoad.java -------------------------------------------------------------------------------- /bin/HttpThread_DownLoad.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/HttpThread_DownLoad.class -------------------------------------------------------------------------------- /github-images-folder/main.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/github-images-folder/main.jpg -------------------------------------------------------------------------------- /bin/mainFrame$ButtonAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/bin/mainFrame$ButtonAction.class -------------------------------------------------------------------------------- /github-images-folder/zidingyi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/github-images-folder/zidingyi.jpg -------------------------------------------------------------------------------- /github-images-folder/lixianwenjian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/github-images-folder/lixianwenjian.jpg -------------------------------------------------------------------------------- /github-images-folder/xiazaishezhi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhoubowen-sky/File-Transmit-pc/HEAD/github-images-folder/xiazaishezhi.jpg -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | File Transmit-pc 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.5 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.5 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## "灵动快传"项目简介 3 | 4 | - 本项目为 第五届[“中国软件杯”][2]——大学生软件设计大赛 [A6赛题][1] 的参赛作品 5 | - 开发团队为来自湖北大学的“根号三”队伍,队员有 **周博文**、**郑志琦**、**董致礼** 6 | - 凭借此作品,我们 **“根号三”** 团队获得**全国二等奖**以及**最佳表现奖**的成绩 7 | - 项目总共分为三个模块,分别为Android端、PC端以及Web端 8 | - 以下将分别从这三个模块进行较为详细的介绍 9 | 10 | ### “灵动快传”PC端介绍 11 | 12 | > 本项目全称为:互联网多平台文件快传系统——灵动快传 13 | > 14 | > 开发人员:周博文 郑志琦 董致礼 15 | > 16 | > 集成开发工具:eclipse 17 | > 18 | > 开发语言:Java 19 | 20 | #####PC端程序的UI展示 21 | 22 | ![image](https://github.com/zhoubowen-sky/File-Transmit-pc/blob/master/github-images-folder/main.jpg) 23 | ![image](https://github.com/zhoubowen-sky/File-Transmit-pc/blob/master/github-images-folder/lixianwenjian.jpg) 24 | ![image](https://github.com/zhoubowen-sky/File-Transmit-pc/blob/master/github-images-folder/zidingyi.jpg) 25 | ![image](https://github.com/zhoubowen-sky/File-Transmit-pc/blob/master/github-images-folder/xiazaishezhi.jpg) 26 | 27 | #####PC端程序目录相关说明 28 | 29 | > 程序目录中 **github-images-folder** 文件夹与PC端程序无关,里面的图片为Github项目README页面的说明 30 | > 31 | > 许多Windows程序写作者使用一种叫做「匈牙利表示法」的变量命名通则。这是为了纪念传奇性的Microsoft程序写作者Charles Simonyi。非常简单,变量名以一个或者多个小写字母开始,这些字母表示变量的数据型态。例如,szCmdLine中的sz代表「以0结尾的字符串」。在hInstance和hPrevInstance中的h前缀表示「句柄」;在iCmdShow中的i前缀表示「整数」。 32 | 33 | 34 | 35 | #####PC端程序功能相关说明 36 | 37 | > "连接手机",与手机进行“一键连接” 38 | > 39 | > “离线文件”,发送或者下载离线文件 40 | > 41 | > “自定义”,自定义文件的接收方,可以手动设置IP地址 42 | > 43 | > “下载设置”,自定义PC端的文件接收路径,另有开启wifi的功能,将电脑作为热点开启 44 | > 45 | 46 | 47 | ### “灵动快传”Android端介绍 48 | 49 | > [点击访问Android端介绍][3] 50 | 51 | ### “灵动快传”Web端介绍 52 | 53 | > [点击访问Web端介绍][4] 54 | 55 | ### “灵动快传”PC端介绍 56 | 57 | > [点击访问PC端介绍][5] 58 | 59 | ####关于我们 60 | 61 | >此项目为湖北大学 **周博文**、**郑志琦**、**董致礼**三人合力开发。 62 | >联系方式: 63 | >董:yhinu@qq.com 64 | >郑:664837069@qq.com 65 | >周:zhoubowen.sky@qq.com 66 | 67 | 68 | 69 | 70 | [1]:http://www.cnsoftbei.com/bencandy.php?fid=130&aid=1379 71 | [2]:http://www.cnsoftbei.com/ 72 | [3]:https://github.com/zhoubowen-sky/LingDong2.0/blob/master/README.md 73 | [4]:https://github.com/zhoubowen-sky/LingDongWeb/blob/master/README.md 74 | [5]:https://github.com/zhoubowen-sky/File-Transmit-pc/blob/master/README.md -------------------------------------------------------------------------------- /src/MyColorUtil.java: -------------------------------------------------------------------------------- 1 | import java.awt.Color; 2 | public class MyColorUtil { 3 | /** 4 | * Blend two colors. 5 | * 6 | * @param color1 First color to blend. 7 | * @param color2 Second color to blend. 8 | * @param ratio Blend ratio. 0.5 will give even blend, 1.0 will return 9 | * color1, 0.0 will return color2 and so on. 10 | * @return Blended color. 11 | */ 12 | public static Color blend(Color color1, Color color2, double ratio) { 13 | float r = (float)ratio; 14 | float ir = (float)1.0 - r; 15 | 16 | float rgb1[] = new float[3]; 17 | float rgb2[] = new float[3]; 18 | 19 | color1.getColorComponents(rgb1); 20 | color2.getColorComponents(rgb2); 21 | 22 | return new Color(rgb1[0] * r + rgb2[0] * ir, 23 | rgb1[1] * r + rgb2[1] * ir, 24 | rgb1[2] * r + rgb2[2] * ir); 25 | } 26 | 27 | 28 | /** 29 | * Make an even blend between two colors. 30 | * 31 | * @param color1 First color to blend. 32 | * @param color2 Second color to blend. 33 | * @return Blended color. 34 | */ 35 | public static Color blend(Color color1, Color color2) { 36 | return MyColorUtil.blend(color1, color2, 0.5); 37 | } 38 | 39 | 40 | /** 41 | * Make a color darker. 42 | * 43 | * @param color Color to make darker. 44 | * @param fraction Darkness fraction. 45 | * @return Darker color. 46 | */ 47 | public static Color darker(Color color, double fraction) { 48 | int red = (int)Math.round(color.getRed() * (1.0 - fraction)); 49 | int green = (int)Math.round(color.getGreen() * (1.0 - fraction)); 50 | int blue = (int)Math.round(color.getBlue() * (1.0 - fraction)); 51 | 52 | if (red < 0) red = 0; 53 | else if (red > 255) red = 255; 54 | if (green < 0) green = 0; 55 | else if (green > 255) green = 255; 56 | if (blue < 0) blue = 0; 57 | else if (blue > 255) blue = 255; 58 | 59 | int alpha = color.getAlpha(); 60 | 61 | return new Color(red, green, blue, alpha); 62 | } 63 | 64 | 65 | /** 66 | * Make a color lighter. 67 | * 68 | * @param color Color to make lighter. 69 | * @param fraction Darkness fraction. 70 | * @return Lighter color. 71 | */ 72 | public static Color lighter(Color color, double fraction) { 73 | int red = (int)Math.round(color.getRed() * (1.0 + fraction)); 74 | int green = (int)Math.round(color.getGreen() * (1.0 + fraction)); 75 | int blue = (int)Math.round(color.getBlue() * (1.0 + fraction)); 76 | 77 | if (red < 0) red = 0; 78 | else if (red > 255) red = 255; 79 | if (green < 0) green = 0; 80 | else if (green > 255) green = 255; 81 | if (blue < 0) blue = 0; 82 | else if (blue > 255) blue = 255; 83 | 84 | int alpha = color.getAlpha(); 85 | 86 | return new Color(red, green, blue, alpha); 87 | } 88 | 89 | 90 | /** 91 | * Return the hex name of a specified color. 92 | * 93 | * @param color Color to get hex name of. 94 | * @return Hex name of color: "rrggbb". 95 | */ 96 | public static String getHexName(Color color) { 97 | int r = color.getRed(); 98 | int g = color.getGreen(); 99 | int b = color.getBlue(); 100 | 101 | String rHex = Integer.toString(r, 16); 102 | String gHex = Integer.toString(g, 16); 103 | String bHex = Integer.toString(b, 16); 104 | 105 | return (rHex.length() == 2 ? "" + rHex : "0" + rHex) + 106 | (gHex.length() == 2 ? "" + gHex : "0" + gHex) + 107 | (bHex.length() == 2 ? "" + bHex : "0" + bHex); 108 | } 109 | 110 | 111 | /** 112 | * Return the "distance" between two colors. The rgb entries are taken 113 | * to be coordinates in a 3D space [0.0-1.0], and this method returnes 114 | * the distance between the coordinates for the first and second color. 115 | * 116 | * @param r1 First color (red). 117 | * @param g1 First color (green). 118 | * @param b1 First color (blue). 119 | * @param r2 Second color (red). 120 | * @param g2 Second color (green). 121 | * @param b2 Second color (blue). 122 | * @return Distance bwetween colors. 123 | */ 124 | public static double colorDistance(double r1, double g1, double b1, 125 | double r2, double g2, double b2) { 126 | double a = r2 - r1; 127 | double b = g2 - g1; 128 | double c = b2 - b1; 129 | 130 | return Math.sqrt(a * a + b * b + c * c); 131 | } 132 | 133 | 134 | /** 135 | * Return the "distance" between two colors. 136 | * 137 | * @param color1 First color [r,g,b]. 138 | * @param color2 Second color [r,g,b]. 139 | * @return Distance bwetween colors. 140 | */ 141 | public static double colorDistance(double[] color1, double[] color2) { 142 | return MyColorUtil.colorDistance(color1[0], color1[1], color1[2], 143 | color2[0], color2[1], color2[2]); 144 | } 145 | 146 | 147 | /** 148 | * Return the "distance" between two colors. 149 | * 150 | * @param color1 First color. 151 | * @param color2 Second color. 152 | * @return Distance between colors. 153 | */ 154 | public static double colorDistance(Color color1, Color color2) { 155 | float rgb1[] = new float[3]; 156 | float rgb2[] = new float[3]; 157 | 158 | color1.getColorComponents(rgb1); 159 | color2.getColorComponents(rgb2); 160 | 161 | return MyColorUtil.colorDistance(rgb1[0], rgb1[1], rgb1[2], 162 | rgb2[0], rgb2[1], rgb2[2]); 163 | } 164 | 165 | 166 | /** 167 | * Check if a color is more dark than light. Useful if an entity of 168 | * this color is to be labeled: Use white label on a "dark" color and 169 | * black label on a "light" color. 170 | * 171 | * @param r Color to check (red part). 172 | * @param g Color to check (green part). 173 | * @param b Color to check (blue part). 174 | * @return True if this is a "dark" color, false otherwise. 175 | */ 176 | public static boolean isDark(double r, double g, double b) { 177 | // Measure distance to white and black respectively 178 | double dWhite = MyColorUtil.colorDistance(r, g, b, 1.0, 1.0, 1.0); 179 | double dBlack = MyColorUtil.colorDistance(r, g, b, 0.0, 0.0, 0.0); 180 | 181 | return dBlack < dWhite; 182 | } 183 | 184 | 185 | /** 186 | * Check if a color is more dark than light. Useful if an entity of 187 | * this color is to be labeled: Use white label on a "dark" color and 188 | * black label on a "light" color. 189 | * 190 | * @param color Color to check. 191 | * @return True if this is a "dark" color, false otherwise. 192 | */ 193 | public static boolean isDark(Color color) { 194 | float r = color.getRed() / 255.0f; 195 | float g = color.getGreen() / 255.0f; 196 | float b = color.getBlue() / 255.0f; 197 | 198 | return isDark(r, g, b); 199 | } 200 | } --------------------------------------------------------------------------------