• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作業部屋の使い方を試しています。


Commit MetaInfo

Revision64 (tree)
Time2014-07-30 18:40:44
Authortuna_p

Log Message

(empty log message)

Change Summary

Incremental Difference

--- trunk/HtmlTest2/src/Form/HtmlSearch.java (revision 63)
+++ trunk/HtmlTest2/src/Form/HtmlSearch.java (revision 64)
@@ -254,6 +254,11 @@
254254 private void jBtnRowInsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnRowInsActionPerformed
255255 int SelectedRow = jTable1.getSelectedRow();
256256 SearchData sdat = new SearchData();
257+ sdat.setitem("");
258+ sdat.setHtmlid("");
259+ sdat.setHtmlclass("");
260+ sdat.setaround("");
261+ sdat.setregexp("");
257262
258263 if(SelectedRow >= 0) {
259264 this.serachDataList.add(SelectedRow, sdat);
--- trunk/HtmlTest2/src/Lib/AttributeData.java (revision 63)
+++ trunk/HtmlTest2/src/Lib/AttributeData.java (revision 64)
@@ -28,7 +28,7 @@
2828 import javax.swing.text.html.HTML;
2929
3030 /**
31- *
31+ * HTMLタグの属性情報を保持する.
3232 * @author kgto
3333 */
3434 public class AttributeData {
@@ -38,6 +38,11 @@
3838 size = 0;
3939 }
4040
41+ /**
42+ * 属性情報追加.
43+ * @param tag
44+ * @param attr
45+ */
4146 public void add(HTML.Tag tag, MutableAttributeSet attr) {
4247
4348 int tagcount = tagcnt(tag);
@@ -59,6 +64,13 @@
5964
6065 }
6166
67+ /**
68+ * 属性情報検索.
69+ * @param tag
70+ * @param attrname
71+ * @param attrvalue
72+ * @return
73+ */
6274 public boolean search(HTML.Tag tag, String attrname, String attrvalue) {
6375 boolean ret = false;
6476 for (Object AttrList1 : AttrList) {
@@ -146,6 +158,6 @@
146158 public String attrvalue;
147159 }
148160 public ArrayList AttrList;
149- public int size; // AttrListのサイズ
161+ public int size; // AttrListのサイズ
150162
151163 }
--- trunk/HtmlTest2/src/Lib/HtmlParser.java (revision 63)
+++ trunk/HtmlTest2/src/Lib/HtmlParser.java (revision 64)
@@ -80,17 +80,43 @@
8080 serchpageData(skey);
8181 }
8282
83- // 検索位置を数値変換
84- String around = skey.getaround();
85- byte bAround = 0;
86- if(around.length() > 0) {
87- bAround = Byte.parseByte(around);
88- }
83+// // 検索位置を数値変換
84+// String around = skey.getaround();
85+// byte bAround = 0;
86+// if(around.length() > 0) {
87+// bAround = Byte.parseByte(around);
88+// }
89+//
90+// if(bAround < sData.size()) {
91+// String str = (String)sData.get(bAround);
92+// String rtn = RegularExpression(str, regexp);
93+// return item + "\t" + rtn;
94+// }
8995
90- if(bAround < sData.size()) {
91- String str = (String)sData.get(bAround);
92- String rtn = RegularExpression(str, regexp);
93- return item + "\t" + rtn;
96+ /*
97+ around 出現位置指定 入力有り:指定された位置の情報のみ返す。
98+ 入力無し:取得した全ての情報を返す。
99+ */
100+ String wkaround = skey.getaround();
101+ if(wkaround.length() > 0) {
102+ byte wbAround = 0;
103+ wbAround = Byte.parseByte(wkaround); // 検索位置を数値変換
104+ if(wbAround < sData.size()) {
105+ String str = (String)sData.get(wbAround);
106+ String rtn = RegularExpression(str, regexp);
107+ return item + "\t" + rtn;
108+ }
109+ } else {
110+ StringBuilder strbuf = new StringBuilder();
111+ for (Object sData1 : sData) {
112+ String str = (String)sData1;
113+ String rtn = RegularExpression(str, regexp);
114+ if(strbuf.length() > 0) {
115+ strbuf.append("\t");
116+ }
117+ strbuf.append(rtn);
118+ }
119+ return item + "\t" + strbuf;
94120 }
95121 return null;
96122 }