marlboro
2010-05-10 10:13:53

man always remember lover because of romantic occ

▼ more
research interest
2010-05-10 08:11:05

Biomedical text mining, Data mining, Machine learning, Semantic web, Ontology, Information retrieval

▼ more
테이블 모델을 만들어보아요 JAVA
2010-05-09 19:38:11

// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// 테이블을 나타내기 위한 내부클래스 Cross Validation WordTable

// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class TopPizzaTable extends AbstractTableModel {

List docuList;

Object[][] data;

private String[] columnNames = { "No", "Words", "Possibility" };

public CVWordTable() {

data = new Object[100][3];

for (int i = 0; i < 100; i++) {

data[i][0] = " -";

data[i][1] = " -";

data[i][2] = " -";// 긍정문에서 해당 단어가 나올확률

}

}

public void reset(int order) {

pw1CV[order] = AlSpamFilterMgr.getPosiNegaCV(

SettingValue.PROGRAM_ID, 1, order);

pw2CV[order] = AlSpamFilterMgr.getPosiNegaCV(

SettingValue.PROGRAM_ID, 0, order);

List word = AlSpamFilterMgr.getWordsProbabilityCV(

SettingValue.PROGRAM_ID, order/* 번째 */);

data = new Object[word.size()][3];

double temp_weight = 0.0f;

for (int i = 0; i < word.size(); i++) {

data[i][0] = i + 1;

data[i][1] = word.get(i).getWord();

temp_weight = BayesianSpamFilter.calWordsWeight(word.get(i)

.getAnW1(), word.get(i).getAnW2(), pw1CV[order],

pw2CV[order]);// 부정문에서 해당 단어가 나올확률

data[i][2] = temp_weight;

word.get(i).setWeight(temp_weight);

}

afterCVWordTable[order] = true;

}

public int getColumnCount() {

return columnNames.length;

}

public int getRowCount() {

return data.length;

}

public String getColumnName(int col) {

return columnNames[col];

}

public Object getValueAt(int row, int col) {

return data[row][col];

}

/*

* JTable uses this method to determine the default renderer/ editor for

* each cell. If we didn't implement this method, then the last column

* would contain text ("true"/"false"), rather than a check box.

*/

public Class getColumnClass(int c) {

return getValueAt(0, c).getClass();

}

public boolean isCellEditable(int row, int col) {

// Note that the data/cell address is constant,

// no matter where the cell appears onscreen.

if (col < 2) {

return false;

} else {

return true;

}

}

public void setValueAt(Object value, int row, int col) {

if (DEBUG) {

System.out.println("Setting value at " + row + "," + col

+ " to " + value + " (an instance of "

+ value.getClass() + ")");

}

data[row][col] = value;

fireTableCellUpdated(row, col);

if (DEBUG) {

System.out.println("New value of data:");

printDebugData();

}

}

private void printDebugData() {

int numRows = getRowCount();

int numCols = getColumnCount();

for (int i = 0; i < numRows; i++) {

System.out.print(" row " + i + ":");

for (int j = 0; j < numCols; j++) {

System.out.print(" " + data[i][j]);

}

System.out.println();

}

System.out.println("--------------------------");

}

}

// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// 테이블을 나타내기 위한 내부클래스

// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

▼ more
테이블을 만들어 보아요 JAVA
2010-05-09 19:37:49

model3 = new TotalWordWeightTable();

jTable3 = new JTable(model3);

jTable3.setModel(model3);

jTable3.setFillsViewportHeight(true);

jTable3.setPreferredSize(new java.awt.Dimension(214, 5000*TABLE_HEIGHT));

jTable3.setToolTipText("weight");

// jTable2.addMouseListener(new MyMouseListener()); // MouseListener등록

//Create the scroll pane and add the table to it.

scrollPane3 = new JScrollPane(jTable3);

//Add the scroll pane to this panel.

jInternalFrame1.getContentPane().add(scrollPane3);//internalFrame에 넣는다.

scrollPane3.setBounds(200, 31, 300, 139);

▼ more