📄 stylesheet.java
字号:
/* * Fire (Flexible Interface Rendering Engine) is a set of graphics widgets for creating GUIs for j2me applications. * Copyright (C) 2006-2008 Bluevibe (www.bluevibe.net) * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * *//** * */package gr.fire.browser.util;import gr.fire.browser.Browser;import gr.fire.browser.Tag;import gr.fire.util.Log;import gr.fire.util.StringUtil;import java.util.Vector;/** * @author padeler * */public class StyleSheet{ /** * Initializes the default stylesheet. */ public StyleSheet() { } public void parseDocument(String css) { } public void applyStyle(Browser browser,Tag t) { } public static void parseDeclaration(String owner,String declaration) {// Vector properties = StringUtil.split(declaration,";"); // for(int i=0;i<properties.size();++i)// {// //Log.logInfo(owner+" STYLE: "+properties.elementAt(i));// } } public static int calculateLenght(String value,int maxLen) { int width=-1; if(value!=null) { try{ value = value.trim().toLowerCase(); if(value.endsWith("%")) // percent { width = Integer.parseInt(value.substring(0,value.length()-1)); width = (width*maxLen)/100; } else { int idx = value.indexOf("px"); if(idx!=-1) value = value.substring(0,idx); width = Integer.parseInt(value); } }catch(Exception e) { Log.logWarn("Failed to parse lenght "+value,e); } } return width; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -