91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 136KB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發布日期: 2021-10-16
  • 語言: Java
  • 標簽: CMM??解釋器??

資源簡介

含詞法分析器、語法分析、語義分析、界面等的完整解釋器實現。MyEclipse項目

資源截圖

代碼片段和文件信息

package?graphic;

import?java.awt.Color;
import?java.awt.FontMetrics;
import?java.awt.Component;
import?java.awt.Graphics;
import?java.awt.Insets;



import?javax.swing.JTextArea;
import?javax.swing.border.AbstractBorder;
public?class?LineNumberBorder?extends?AbstractBorder?{
?public?LineNumberBorder(){
?
?}

?/*Insets?對象是容器邊界的表示形式。
??????????????????????????它指定容器必須在其各個邊緣留出的空間。
?*/
?//此方法在實例化時自動調用
?//此方法關系到邊框是否占用組件的空間
?public?Insets?getBorderInsets(Component?c)
?{
return?getBorderInsets(cnew?Insets(0000));?
?}
?
?public?Insets?getBorderInsets(Component?c?Insets?insets)
?{
?if(c?instanceof?JTextArea){
?int?width=lineNumberWidth((JTextArea)c);
?insets.left=width;
?}
?return?insets;
????? ?
?}
?
?public?boolean?isBorderOpaque()
?{
?return?false;
?}
?//邊框的繪制方法
?//此方法必須實現
?public?void?paintBorder(Component?c?Graphics?g?int?x?int?y?int?width?int?height)
?????{
?//獲得當前剪貼區域的邊界矩形。
???? ?java.awt.Rectangle?clip=g.getClipBounds();
???? ?FontMetrics?fm=g.getFontMetrics();
???? ?int?fontHeight=fm.getHeight();
???? ?
???? ?//starting?location?at?the?“top“?of?the?page...
???? ?//?y?is?the?starting?baseline?for?the?font...
???? ?int?ybaseline=y+fm.getAscent();
???? ?
???? ?//?now?determine?if?it?is?the?“top“?of?the?page...or?somewhere?else
???? ?int?startingLineNumber=(clip.y/fontHeight)+1;
???? ?
???? ?if(startingLineNumber!=1){
???? ?ybaseline=y+startingLineNumber*fontHeight-
???? ????????????(fontHeight-fm.getAscent());
???? ?}
???? ?
???? ?int?yend=ybaseline+height;
???? ?if(yend>(y+height)){
???? ?yend=y+height;
???? ?}
???? ?
???? ?JTextArea?jta=(JTextArea)c;
???? ?int?lineWidth=lineNumberWidth(jta);
???? ?
???? ?int?lnxStart=x+lineWidth;
???? ?
???? ?g.setColor(Color.blue);
???? ?
???? ?
???? ?//?loop?until?out?of?the?“visible“?region...
???? ?int?length=(““+Math.max(jta.getRows()?jta.getLineCount()+1)).length();
?????????//繪制行號
???? ?while(ybaseline?????????{
???????? ?String?label?=?padLabel(startingLineNumber?length?true);
???????? ?
???????? ?g.drawString(label?lnxStart-?fm.stringWidth(label)??ybaseline);
???????? ?ybaseline+=fontHeight;
???????? ?startingLineNumber++;
?????????}
?????}
?????
?????//尋找適合的數字寬度
?????private?int?lineNumberWidth(JTextArea?jta){
???? ?int?lineCount=Math.max(jta.getRows()?jta.getLineCount());
???? ?return?jta.getFontMetrics(jta.getFont()).stringWidth(lineCount+“?“);
?????}
?????
?????private?static?String?padLabel(int?lineNumber?int?length?boolean?addSpace)
?????{
???? ?StringBuffer?buffer=new?StringBuffer();
???? ?buffer.append(lineNumber);
???? ?for(int?count=(length-buffer.length());count>0;count--){
???? ?buffer.insert(0?‘?‘);
???? ?}
???? ?if(addSpace){
???? ?buffer.append(‘?‘);
???? ?}
???? ?return?buffer.toString();
?????}
?????
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????232??2009-11-19?15:29??Interpretor\.classpath

?????文件????????387??2009-11-19?15:29??Interpretor\.project

?????文件???????3435??2009-12-11?16:50??Interpretor\bin\graphic\LineNumberBorder.class

?????文件???????1793??2009-12-17?14:37??Interpretor\bin\graphic\MyRenderer.class

?????文件??????10692??2009-12-17?14:42??Interpretor\bin\graphic\ParserGraphic.class

?????文件????????852??2009-12-17?14:13??Interpretor\bin\graphic\ResultWindow.class

?????文件???????4121??2009-12-17?14:45??Interpretor\bin\graphic\UserGraphic$1.class

?????文件????????960??2009-12-17?14:45??Interpretor\bin\graphic\UserGraphic$UndoHandler.class

?????文件??????10124??2009-12-17?14:45??Interpretor\bin\graphic\UserGraphic.class

?????文件???????7779??2009-12-11?17:04??Interpretor\bin\graphic.rar

?????文件???????9243??2009-12-17?14:22??Interpretor\bin\lexer\Lexer.class

?????文件???????1196??2009-12-04?19:53??Interpretor\bin\lexer\Token.class

?????文件???????1023??2009-12-17?14:20??Interpretor\bin\parser\AddSymbolLeaf.class

?????文件???????1972??2009-12-17?14:20??Interpretor\bin\parser\arth\ArthTree.class

?????文件???????1079??2009-12-17?14:20??Interpretor\bin\parser\arth\NumLeaf.class

?????文件???????1538??2009-12-17?14:20??Interpretor\bin\parser\arth\OtherPartTree.class

?????文件???????1442??2009-12-17?14:20??Interpretor\bin\parser\arth\OtherTermTree.class

?????文件???????1972??2009-12-17?14:20??Interpretor\bin\parser\arth\PartTree.class

?????文件???????3248??2009-12-17?14:20??Interpretor\bin\parser\arth\TermTree.class

?????文件???????1791??2009-12-17?14:20??Interpretor\bin\parser\arth\VarArrayElementLeaf.class

?????文件???????1235??2009-12-17?14:20??Interpretor\bin\parser\arth\VarSimpleLeaf.class

?????文件???????1551??2009-12-17?14:20??Interpretor\bin\parser\ass\AssVarArrayElementTree.class

?????文件???????1511??2009-12-17?14:20??Interpretor\bin\parser\ass\AssVarSimpleTree.class

?????文件????????775??2009-12-17?14:20??Interpretor\bin\parser\BlockTree.class

?????文件????????384??2009-12-17?14:20??Interpretor\bin\parser\CommonTree.class

?????文件????????332??2009-12-17?14:20??Interpretor\bin\parser\CONSTS.class

?????文件???????2142??2009-12-17?14:20??Interpretor\bin\parser\declare\VarArrayDefTree.class

?????文件???????1490??2009-12-17?14:20??Interpretor\bin\parser\declare\VarSimpleDefTree.class

?????文件???????2060??2009-12-17?14:20??Interpretor\bin\parser\ifTree\IfTree.class

?????文件???????1838??2009-12-17?14:20??Interpretor\bin\parser\LogicTree.class

............此處省略88個文件信息

評論

共有 條評論