freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

虛擬的java編輯器課程設(shè)計報告-資料下載頁

2025-08-04 05:04本頁面
  

【正文】 lparea。myhelp(){super(幫助主題)。helparea=new TextArea(,45,25,)。//創(chuàng)建沒有滾動條的幫助窗口( )。(。)。(要編輯文字,請先選定它,然后單擊相應(yīng)菜單上的相關(guān)命令。)。(鼠標(biāo)懸停在工具欄上會出現(xiàn)相關(guān)提示。本軟件在SDK ,)。setResizable(false)。getContentPane().add(helparea)。show()。pack()。(new Font(宋體,14))。(false)。addWindowListener(new xxxhelp(this))。}}class handlemouse extends MouseAdapter //處理右鍵彈出菜單類{myfr fx。handlemouse(myfr fxx){fx=fxx。}public void mouseReleased(MouseEvent n){if(())((Component)(),(),())。}}class SyntaxHighlighter implements DocumentListener {private SetString keywords。private SetString classwords。private Style keywordStyle。private Style classwordStyle。private Style normalStyle。public SyntaxHighlighter(JTextPane editor) { // 準(zhǔn)備著色使用的樣式keywordStyle = ((StyledDocument) ()).addStyle(Keyword_Style, null)。classwordStyle=((StyledDocument) ()).addStyle(classword_Style,null)。normalStyle = ((StyledDocument) ()).addStyle(Keyword_Style, null)。(keywordStyle, )。(classwordStyle, )。 // 準(zhǔn)備關(guān)鍵字keywords = new HashSetString()。(public)。(protected)。(private)。(float)。(double)。//準(zhǔn)備類庫類名classwords=new HashSetString()。(awt)。(io)。(util)。(text)。(swing)。}public void colouring(StyledDocument doc, int pos, int len) throws BadLocationException {// 取得插入或者刪除后影響到的單詞.// 例如public在b后插入一個空格, 就變成了:pub lic, 這時就有兩個單詞要處理:pub和lic// 這時要取得的范圍是pub中p前面的位置和lic中c后面的位置int start = indexOfWordStart(doc, pos)。int end = indexOfWordEnd(doc, pos + len)。char ch。while (start end) {ch = getCharAt(doc, start)。if ((ch) || ch == 39。_39。) {// 如果是以字母或者下劃線開頭, 說明是單詞// pos為處理后的最后一個下標(biāo)start = colouringWord(doc, start)。} else {(new ColouringTask(doc, start, 1, normalStyle))。++start。}}}public int colouringWord(StyledDocument doc, int pos) throws BadLocationException {int wordEnd = indexOfWordEnd(doc, pos)。String word = (pos, wordEnd pos)。if ((word)) {// 如果是關(guān)鍵字, 就進(jìn)行關(guān)鍵字的著色, 否則使用普通的著色.// 這里有一點要注意, 在insertUpdate和removeUpdate的方法調(diào)用的過程中, 不能修改doc的屬性.// 但我們又要達(dá)到能夠修改doc的屬性, 所以把此任務(wù)放到這個方法的外面去執(zhí)行.// 實現(xiàn)這一目的, 可以使用新線程, 但放到swing的事件隊列里去處理更輕便一點.(new ColouringTask(doc, pos, wordEnd pos, keywordStyle))。} else if((word)) {(new ColouringTask(doc, pos, wordEnd pos, classwordStyle))。}else {(new ColouringTask(doc, pos, wordEnd pos, normalStyle))。}return wordEnd。}public char getCharAt(Document doc, int pos) throws BadLocationException {return (pos, 1).charAt(0)。}public int indexOfWordStart(Document doc, int pos) throws BadLocationException {// 從pos開始向前找到第一個非單詞字符.for (。 pos 0 amp。amp。 isWordCharacter(doc, pos 1)。 pos)。return pos。}public int indexOfWordEnd(Document doc, int pos) throws BadLocationException {// 從pos開始向前找到第一個非單詞字符.for (。 isWordCharacter(doc, pos)。 ++pos)。return pos。}public boolean isWordCharacter(Document doc, int pos) throws BadLocationException {char ch = getCharAt(doc, pos)。if ((ch) || (ch) || ch == 39。_39。) { return true。 }return false。}public void changedUpdate(DocumentEvent e) {}public void insertUpdate(DocumentEvent e) {try {colouring((StyledDocument) (), (), ())。} catch (BadLocationException e1) {()。}}@Overridepublic void removeUpdate(DocumentEvent e) {try {// 因為刪除后光標(biāo)緊接著影響的單詞兩邊, 所以長度就不需要了colouring((StyledDocument) (), (), 0)。} catch (BadLocationException e1) {()。}}private class ColouringTask implements Runnable {private StyledDocument doc。private Style style。private int pos。private int len。public ColouringTask(StyledDocument doc, int pos, int len, Style style) { = doc。 = pos。 = len。 = style。}public void run() {try {// 這里就是對字符進(jìn)行著色(pos, len, style, true)。} catch (Exception e) {}}}}粘貼復(fù)制即可29 / 29
點擊復(fù)制文檔內(nèi)容
化學(xué)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1