formatunicodecallout.java

来自「Java的面向对象数据库系统的源代码」· Java 代码 · 共 62 行

JAVA
62
字号
package com.nwalsh.xalan;import org.xml.sax.SAXException;import org.w3c.dom.*;import org.apache.xml.utils.DOMBuilder;import com.nwalsh.xalan.Callout;import org.apache.xml.utils.AttList;/** * <p>Utility class for the Verbatim extension (ignore this).</p> * * <p>$Id: FormatUnicodeCallout.java,v 1.1 2001/04/02 13:03:45 nwalsh Exp $</p> * * <p>Copyright (C) 2000, 2001 Norman Walsh.</p> * * <p><b>Change Log:</b></p> * <dl> * <dt>1.0</dt> * <dd><p>Initial release.</p></dd> * </dl> * * @author Norman Walsh * <a href="mailto:ndw@nwalsh.com">ndw@nwalsh.com</a> * * @see Verbatim * * @version $Id: FormatUnicodeCallout.java,v 1.1 2001/04/02 13:03:45 nwalsh Exp $ **/public class FormatUnicodeCallout extends FormatCallout {  int unicodeMax = 0;  int unicodeStart = 0;  public FormatUnicodeCallout(int start, int max, boolean fo) {    unicodeMax = max;    unicodeStart = start;    stylesheetFO = fo;  }  public void formatCallout(DOMBuilder rtf,			    Callout callout) {    Element area = callout.getArea();    int num = callout.getCallout();    String label = areaLabel(area);    try {      if (label == null && num <= unicodeMax) {	char chars[] = new char[1];	chars[0] = (char) (unicodeStart + num - 1);	startSpan(rtf);	rtf.characters(chars, 0, 1);	endSpan(rtf);      } else {	formatTextCallout(rtf, callout);      }    } catch (SAXException e) {      System.out.println("SAX Exception in unicode formatCallout");    }  }}

⌨️ 快捷键说明

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