亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? textline.java

?? java 作圖的程序
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
         if(g == null) return 0;         parseText(g);         return leading;           }  /**   * parse the text. When the text is parsed the width, height, leading   * are all calculated. The text will only be truly parsed if   * the graphics context has changed or the text has changed or   * the font has changed. Otherwise nothing is done when this   * method is called.    * @param g Graphics context.   */     public void parseText(Graphics g) {         FontMetrics fm;         TextState current = new TextState();         char ch;         Stack state = new Stack();         int w = 0;         if(lg != g) parse = true;         lg = g;         if(!parse) return;         parse = false;         width   = 0;         leading = 0;         ascent  = 0;         descent = 0;         height  = 0;         maxAscent = 0;         maxDescent = 0;         if( text == null || g == null) return;         list.removeAllElements();         if(font == null) current.f = g.getFont();         else             current.f = font;         state.push(current);         list.addElement(current);                  fm = g.getFontMetrics(current.f);         for(int i=0; i<text.length(); i++) {             ch = text.charAt(i);             switch (ch) {             case '$':                      i++;                      if(i<text.length()) current.s.append(text.charAt(i));                      break;/***                    Push the current state onto the state stack**                    and start a new storage string*/	     case '{':                      w = current.getWidth(g);                      if(!current.isEmpty()) {                           current = current.copyState();                           list.addElement(current);		      }                      state.push(current);                      current.x += w;                      break;/***                    Pop the state off the state stack and set the current**                    state to the top of the state stack*/	     case '}':                      w = current.x + current.getWidth(g);                      state.pop();                      current = ((TextState)state.peek()).copyState();                      list.addElement(current);                      current.x = w;                      break;	     case '^':                      w = current.getWidth(g);                      if(!current.isEmpty()) {                           current = current.copyState();                           list.addElement(current);		      }                      current.f = getScriptFont(current.f);                      current.x += w;                      current.y -= (int)((double)(current.getAscent(g))*sup_offset+0.5);                      break; 	     case '_':                      w = current.getWidth(g);                      if(!current.isEmpty()) {                           current = current.copyState();                           list.addElement(current);		      }                      current.f = getScriptFont(current.f);                      current.x += w;                      current.y += (int)((double)(current.getDescent(g))*sub_offset+0.5);                      break;             default:                       current.s.append(ch);                      break;	     }	   }         for(int i=0; i<list.size(); i++) {            current = ((TextState)(list.elementAt(i)));            if( !current.isEmpty() ) {               width  += current.getWidth(g);               ascent  = Math.max(ascent, Math.abs(current.y) +                                           current.getAscent(g));               descent = Math.max(descent, Math.abs(current.y) +                                           current.getDescent(g));               leading  = Math.max(leading, current.getLeading(g));               maxDescent = Math.max(maxDescent, Math.abs(current.y) +                                           current.getMaxDescent(g));               maxAscent  = Math.max(maxAscent, Math.abs(current.y) +                                           current.getMaxAscent(g));	     }         }         height = ascent+descent+leading;         return;     }  /**   * @return true if the text has never been set or is null   */     public boolean isNull() {        return (text==null);      }  /**   * Parse the text then draw it.   * @param g Graphics context   * @param x pixel position of the text   * @param y pixel position of the text   * @param j justification of the text   */     public void draw(Graphics g, int x, int y, int j) {         justification = j;         if( g == null ) return;         draw(g,x,y);       }  /**   * Parse the text then draw it without any rotation.   * @param g Graphics context   * @param x pixel position of the text   * @param y pixel position of the text   */     public void draw(Graphics g, int x, int y) {         TextState ts;         int xoffset = x;         int yoffset = y;               if(g == null || text == null) return;          Graphics lg = g.create();         parseText(g);         if(justification == CENTER ) {               xoffset = x-width/2;         } else          if(justification == RIGHT ) {                     xoffset = x-width;	 }         if(background != null) {            lg.setColor(background);            lg.fillRect(xoffset,yoffset-ascent,width,height);            lg.setColor(g.getColor());         }         if(font  != null) lg.setFont(font);         if(color != null) lg.setColor(color);         for(int i=0; i<list.size(); i++) {              ts = ((TextState)(list.elementAt(i)));              if(ts.f != null) lg.setFont(ts.f);              if(ts.s != null)                    lg.drawString(ts.toString(),ts.x+xoffset,ts.y+yoffset);	 }         lg.dispose();         lg = null;       }  /**   * @return Logical font name of the set font   */      public String getFontName()  { return fontname; }  /**   * @return Style of the set font   */      public int    getFontStyle() { return fontstyle; }  /**   * @return Size of the set font   */      public int    getFontSize()  { return fontsize; }  /**   * Set the Logical font name of the current font   * @param s Logical font name.   */      public void setFontName(String s) {  fontname  = s; rebuildFont(); }  /**   * Set the Font style of the current font   * @param i Font style.   */      public void setFontStyle(int i)   {  fontstyle = i; rebuildFont(); }  /**   * Set the Font size of the current font   * @param i Font size.   */      public void setFontSize(int i)    {  fontsize  = i; rebuildFont(); }  /*  ** Rebuild the font using the current fontname, fontstyle, and fontsize.  */      private void rebuildFont() {         parse = true;         if( fontsize <= 0 || fontname == null   ) {              font = null;	    } else {              font = new Font(fontname, fontstyle, fontsize);	    }       }  /**   * @param f Font   * @return The script font version of the parsed font using the   *        script_fraction variable.   */        public Font getScriptFont(Font f) {             int size;             if(f == null) return f;             size = f.getSize();             if(size <= MINIMUM_SIZE) return f;             size = (int)((double)(f.getSize())*script_fraction + 0.5);             if(size <= MINIMUM_SIZE) return f;             return new Font(f.getName(), f.getStyle(), size);	   }  /**   * Parse a double value. Precision is 6 figures, with 7 significant   * figures.   * @param d double to parse   * return <i>true</i> if the parse was successful   */     public boolean parseDouble(double d) {           return parseDouble(d, 7, 6, ALGEBRAIC);     }  /**   * Parse a double value. Number of significant figures is 1 greater than   * the precision.   * @param d double to parse   * @param p precision of the number   * return <i>true</i> if the parse was successful   */     public boolean parseDouble(double d, int p) {           return parseDouble(d, p+1, p, ALGEBRAIC);     }  /**   * Parse a double value   * @param d double to parse   * @param n number of significant figures   * @param p precision of the number   * @param f format of the number scientific, algebraic etc.   * return <i>true</i> if the parse was successful   */     public boolean parseDouble(double d, int n, int p, int f) {         double x = d;         int left = n - p;         double right = 0;         int power;         int exponent;         int i;         StringBuffer s = new StringBuffer(n+4);                 if(left < 0 ) {            System.out.println(                "TextLine.parseDouble: Precision > significant figures!");            return false;         }          if(d < 0.0) {                      x = -d;                      s.append("-");         }          //System.out.println("parseDouble: value = "+x);         if( d == 0.0 ) exponent = 0;         else           exponent = (int)(Math.floor(SpecialFunction.log10(x)));         //System.out.println("parseDouble: exponent = "+exponent);         power = exponent - (left - 1);         //System.out.println("parseDouble: power = "+power);         if( power < 0 ) {             for(i=power; i<0; i++) { x *= 10.0; }         } else {             for(i=0; i<power; i++) { x /= 10.0; }         }         //System.out.println("parseDouble: adjusted value = "+x);         left = (int)x;         s.append(left);         //System.out.println("parseDouble: left = "+left);         if( p > 0 ) {           s.append('.');           right = x-left;           for(i=0; i<p; i++) {                 right *= 10;                 if(i==p-1) right += 0.5;                 s.append((int)(right));                  right -= (int)right;	   }	 }                  //System.out.println("parseDouble: right = "+right);         if(power != 0) {              if(f == SCIENTIFIC) {                              s.append('E');                              if(power < 0) s.append('-');                              else          s.append('+');                              power = Math.abs(power);                              if(power > 9) {                                      s.append(power);                              } else {                                      s.append('0');                                      s.append(power);                              }              } else {                              s.append("x10{^");                              s.append(power);                              s.append("}");	      }	 }         setText( s.toString() );         return true;          }   }/** * A structure class used exclusively with the TextLine class. * When the Text changes state (new font, new color, new offset) * then this class holds the information plus the substring * that the state pertains to. */class TextState extends Object {       Font f         = null;      StringBuffer s = null;      int x          = 0;      int y          = 0;            public TextState() {              s = new StringBuffer();	    }      public TextState copyAll() {             TextState tmp = copyState();             if(s.length()==0) return tmp;             for(int i=0; i<s.length(); i++) { tmp.s.append(s.charAt(i)); }             return tmp;	   }      public TextState copyState() {             TextState tmp = new TextState();             tmp.f = f;             tmp.x = x;             tmp.y = y;             return tmp;	   }      public String toString() {             return s.toString();	   }      public boolean isEmpty() {           return (s.length() == 0);	 }      public int getWidth(Graphics g) {           if(g == null || f == null || s.length()==0 ) return 0;           return g.getFontMetrics(f).stringWidth(s.toString());      }      public int getHeight(Graphics g) {           if(g == null || f == null ) return 0;                      return g.getFontMetrics(f).getHeight();	 }      public int getAscent(Graphics g) {           if(g == null || f == null ) return 0;                      return g.getFontMetrics(f).getAscent();	 }      public int getDescent(Graphics g) {           if(g == null || f == null ) return 0;                      return g.getFontMetrics(f).getDescent();	 }      public int getMaxAscent(Graphics g) {           if(g == null || f == null ) return 0;                      return g.getFontMetrics(f).getMaxAscent();	 }      public int getMaxDescent(Graphics g) {           if(g == null || f == null ) return 0;                      return g.getFontMetrics(f).getMaxDescent();	 }      public int getLeading(Graphics g) {           if(g == null || f == null ) return 0;                      return g.getFontMetrics(f).getLeading();	 }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆精品视频| 日本成人在线不卡视频| 美女网站一区二区| 99久久久国产精品| 欧美精品一区二区久久婷婷| 亚洲图片欧美一区| 成人动漫视频在线| 久久美女艺术照精彩视频福利播放| 亚洲国产一区视频| 91免费精品国自产拍在线不卡| 26uuu欧美日本| 天天射综合影视| 欧美亚洲另类激情小说| 国产精品久久三区| 国产aⅴ精品一区二区三区色成熟| 日韩免费福利电影在线观看| 亚洲国产精品麻豆| 色乱码一区二区三区88| 国产精品青草综合久久久久99| 狠狠色综合播放一区二区| 欧美一级高清大全免费观看| 亚洲午夜免费电影| 欧美综合视频在线观看| 亚洲柠檬福利资源导航| a在线播放不卡| 国产精品视频在线看| 粉嫩av一区二区三区| 久久一区二区视频| 国产一区二区在线看| 精品国产免费人成在线观看| 裸体歌舞表演一区二区| 777精品伊人久久久久大香线蕉| 亚洲五码中文字幕| 欧美色偷偷大香| 性感美女极品91精品| 欧美日韩国产高清一区二区 | 91福利国产成人精品照片| 中文字幕一区二区三区精华液 | 美女诱惑一区二区| 国产欧美日韩在线| 国产一区二区三区av电影 | 欧美午夜理伦三级在线观看| 一区二区三区日韩精品视频| 欧美日韩在线播放| 午夜精品视频在线观看| 欧美日本韩国一区二区三区视频 | 一区二区三区四区精品在线视频| 91论坛在线播放| 亚洲午夜精品网| 91精品国产免费| 久久精品国产一区二区三| 亚洲精品在线观看视频| 国产成人午夜片在线观看高清观看| 国产无人区一区二区三区| 成人毛片老司机大片| 综合久久久久综合| 欧美日韩成人综合在线一区二区| 日韩av二区在线播放| 精品久久久久久综合日本欧美| 国内不卡的二区三区中文字幕| 欧美激情综合五月色丁香小说| av在线这里只有精品| 亚洲自拍与偷拍| 日韩视频免费观看高清在线视频| 狠狠色狠狠色综合系列| 国产精品午夜春色av| 色拍拍在线精品视频8848| 日韩综合在线视频| 久久日韩粉嫩一区二区三区| 99久久久免费精品国产一区二区| 亚洲一区二区三区影院| 日韩写真欧美这视频| 丰满少妇在线播放bd日韩电影| 一区二区三区四区蜜桃| 日韩精品一区二区三区swag| 懂色av一区二区三区蜜臀| 亚洲一区二区三区美女| 欧美成人官网二区| av福利精品导航| 日韩av电影天堂| 国产女同互慰高潮91漫画| 色综合久久中文综合久久牛| 蜜臀久久99精品久久久久久9 | 久久久精品综合| 色哟哟精品一区| 狠狠色丁香婷综合久久| 亚洲欧美一区二区久久| 日韩欧美久久一区| av男人天堂一区| 免费在线观看日韩欧美| 亚洲天堂免费看| 日韩一区二区免费在线观看| 成人开心网精品视频| 午夜欧美电影在线观看| 亚洲国产精品黑人久久久| 欧美日韩电影在线播放| 岛国一区二区三区| 青青草伊人久久| 亚洲精品国久久99热| 久久久99久久| 6080日韩午夜伦伦午夜伦| 粉嫩欧美一区二区三区高清影视| 99久久久久久| 精品一区二区三区免费观看| 亚洲最色的网站| 亚洲国产成人午夜在线一区| 欧美一级一区二区| 91视频在线观看免费| 久久国产欧美日韩精品| 亚洲午夜在线观看视频在线| 国产精品美女久久久久久| 精品毛片乱码1区2区3区| 欧美色爱综合网| 99久久精品国产一区二区三区| 国内外精品视频| 日本成人在线看| 亚洲午夜免费福利视频| 国产精品乱码一区二区三区软件| 日韩精品中文字幕在线一区| 欧亚洲嫩模精品一区三区| 成人一级黄色片| 久久精品噜噜噜成人88aⅴ| 亚洲国产精品尤物yw在线观看| 亚洲视频小说图片| 国产亚洲成av人在线观看导航 | 91美女在线看| 国产成人亚洲综合a∨婷婷图片| 免费xxxx性欧美18vr| 婷婷综合另类小说色区| 亚洲影院久久精品| 亚洲欧美一区二区三区久本道91| 国产精品天美传媒沈樵| 久久久久久久久久久黄色| 日韩一区二区麻豆国产| 欧美乱妇20p| 欧美视频在线观看一区| 色诱视频网站一区| 99r精品视频| 97久久精品人人做人人爽50路| 成人三级伦理片| 成人黄色免费短视频| 成人午夜视频在线| 国产成人免费在线视频| 国产99一区视频免费| 国产不卡在线播放| 国产成人在线视频网址| 国产成a人亚洲精| 国产91精品一区二区麻豆亚洲| 国产成人在线视频网站| 国产不卡视频一区二区三区| 高清av一区二区| 春色校园综合激情亚洲| 粉嫩绯色av一区二区在线观看| 国产大陆精品国产| 成人性视频网站| av中文一区二区三区| 色综合天天视频在线观看| 91浏览器打开| 欧美视频一区二区三区| 欧美色图在线观看| 欧美性视频一区二区三区| 欧美日韩中文字幕一区| 4438x成人网最大色成网站| 在线播放/欧美激情| 日韩欧美国产麻豆| 久久久精品人体av艺术| 欧美高清在线一区| 亚洲欧美在线视频观看| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲综合区在线| 日本午夜精品一区二区三区电影| 美女视频黄免费的久久| 国产一区二区三区四| 成人av资源在线观看| 91污片在线观看| 欧美挠脚心视频网站| 日韩欧美自拍偷拍| 久久久国产午夜精品| 中文字幕一区二区三区视频| 一区二区不卡在线播放| 成人国产在线观看| 欧洲一区在线电影| 日韩欧美不卡在线观看视频| 久久亚洲欧美国产精品乐播| 国产精品美女www爽爽爽| 亚洲综合色自拍一区| 蜜臀av性久久久久av蜜臀妖精| 国产成人精品免费网站| 色吧成人激情小说| 欧美一级黄色大片| 国产欧美久久久精品影院| 一二三区精品视频| 精品一区二区综合| 成人精品电影在线观看| 精品视频在线看| 国产亚洲婷婷免费| 有码一区二区三区| 久久66热re国产| 日本精品免费观看高清观看| 欧美电视剧免费观看|