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

📄 vijxtautil.java

📁 Myjxta的源代码 基于JXTA的P2P即时通信系统
💻 JAVA
字号:
/* * Copyright (c) [2005] [Jeffrey Moore] * * Redistributions in source code form must reproduce the above copyright and  * this condition. * * The contents of this file are subject to the Sun Project JXTA License  * Version 1.1 (the "License"); you may not use this file except in compliance  * with the License. A copy of the License is available at  * http://www.jxta.org/jxta_license.html. * *//* * ViJxtaUtil.java * * Created on April 12, 2005, 12:20 PM */package net.jxta.myjxta.plugins.vijxta;import java.awt.Dimension;/** * * @author Jeff Moore */public class ViJxtaUtil {        /** Creates a new instance of ViUtil */    public ViJxtaUtil () {    }        public static String dimensionToString (Dimension d) {                return (d != null) ?            String.valueOf (String.valueOf ((int)d.getWidth ()) +                " x " +                String.valueOf ((int)d.getHeight ())) : null;    }        public static Dimension stringToDimension (String s) {                        int w = 0;        int h = 0;        Dimension rtn = null;                if(s != null) {                        String[] tmp = s.split ("x");                        if( tmp.length == 2) {                                try {                                        w = Integer.valueOf (tmp[0].trim ()).intValue ();                                        h = Integer.valueOf (tmp[1].trim ()).intValue ();                                    }catch(NumberFormatException nfx) {                    nfx.printStackTrace ();                }            }            rtn = new Dimension (w,h);        }        return rtn;            }}

⌨️ 快捷键说明

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