SandMark version 2.0


sandmark.gui
Class ObTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--sandmark.gui.ObTableModel
All Implemented Interfaces:
SandMarkGUIConstants, java.io.Serializable, SMarkGUIConstants, javax.swing.table.TableModel

public class ObTableModel
extends javax.swing.table.AbstractTableModel
implements SandMarkGUIConstants

This class is the data model of the JTable. It takes a ClassFileCollection as input and fills the JTable with that data. It provides methods which change and access the table's values.

See Also:
Serialized Form

Field Summary
(package private)  java.lang.Class[] columnClasses
           
(package private)  java.lang.String[] columnNames
           
(package private)  java.lang.Object[][] data
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Fields inherited from interface sandmark.gui.SandMarkGUIConstants
_12_CHARS_WIDE, ALL_NODE_SELECTION_TYPE, CANCEL_OPTION, CLASS_DIALOG_DIMS, CLASS_STAT_DIALOG_WIDTH_0, CLASS_STAT_DIALOG_WIDTH_1, CLASS_STAT_DIALOG_WIDTH_2, CLASS_STAT_DIALOG_WIDTH_3, CLASS_STAT_DIALOG_WIDTH_4, CLASS_STAT_DIALOG_WIDTH_5, CLASS_STAT_DIALOG_WIDTH_6, DARK_SAND_COLOR, DEFAULT_VALUES, FULL_OBFUSCATION, GREEN_LIGHT_IMAGE, HALF_OBFUSCATION, JDIALOG_OFFSET, LOGO_IMAGE, METHOD_DIALOG_DIMS, METHOD_STAT_DIALOG_WIDTH_0, METHOD_STAT_DIALOG_WIDTH_1, METHOD_STAT_DIALOG_WIDTH_2, METHOD_STAT_DIALOG_WIDTH_3, METHOD_STAT_DIALOG_WIDTH_4, METHOD_STAT_DIALOG_WIDTH_5, METHOD_STAT_DIALOG_WIDTH_6, NO_OBFUSCATION, NS_PANEL_DIMS, OK_OPTION, PACKAGE, PACKAGE_DIALOG_DIMS, PACKAGE_STAT_DIALOG_WIDTH_0, PERMUTATION_ENCODING_TYPE, RADIX_ENCODING_TYPE, RED_LIGHT_IMAGE, ROOT_NODE_SELECTION_TYPE, ROOT_PATH, SAND_COLOR, SAND_IMAGE, TITLE, W_PANEL_DIMS, YELLOW_LIGHT_IMAGE
 
Fields inherited from interface sandmark.gui.SMarkGUIConstants
ALGORITHM_LABEL_X, ALGORITHM_LABEL_Y, ARGUMENTS_LABEL_X, ARGUMENTS_LABEL_Y, BROWSE_BUTTON_X, BROWSE_BUTTON_Y, CLASSPATH_LABEL_X, CLASSPATH_LABEL_Y, COLS20, COLS30, CONFIGURE_BUTTON_X, CONFIGURE_BUTTON_Y, DONE_BUTTON_X, DONE_BUTTON_Y, EMBED_BUTTON_X, EMBED_BUTTON_Y, EMBED_LABEL_X, EMBED_LABEL_Y, JARFILE_LABEL_X, JARFILE_LABEL_Y, KEY_LABEL_X, KEY_LABEL_Y, MAIN_LABEL_X, MAIN_LABEL_Y, NEXT_BUTTON_X, NEXT_BUTTON_Y, OBFUSCATE_BUTTON_X, OBFUSCATE_BUTTON_Y, OBFUSCATED_LABEL_X, OBFUSCATED_LABEL_Y, OPTIMIZE_BUTTON_X, OPTIMIZE_BUTTON_Y, OPTIMIZED_LABEL_X, OPTIMIZED_LABEL_Y, RANDOM_BUTTON_X, RANDOM_BUTTON_Y, RECOGNIZE_BUTTON_X, RECOGNIZE_BUTTON_Y, RECOGNIZE_LABEL_X, RECOGNIZE_LABEL_Y, ROWS1, ROWS6, START_BUTTON_X, START_BUTTON_Y, STATISTICS_BUTTON_X, STATISTICS_BUTTON_Y, TEXTAREA_X, TEXTAREA_Y, TRACE_BUTTON_X, TRACE_BUTTON_Y, TRACE_LABEL_X, TRACE_LABEL_Y, TRACEFILE_LABEL_X, TRACEFILE_LABEL_Y, VIEW_BUTTON_X, VIEW_BUTTON_Y, WATERMARKS_LABEL_X, WATERMARKS_LABEL_Y, WMARKJAR_LABEL_X, WMARKJAR_LABEL_Y, WMARKVALUE_LABEL_X, WMARKVALUE_LABEL_Y
 
Constructor Summary
ObTableModel(ClassFileCollection cfc)
          Constructs a new JTable with the starting values specified in the ClassFileCollection.
 
Method Summary
 java.lang.Class getColumnClass(int c)
          Returns the Class of object at the first row of the cth column.
 int getColumnCount()
          Returns the number of colmuns.
 java.lang.String getColumnName(int col)
          Returns the title of the specified column
 java.lang.Object[][] getData()
          Gets the Object array that represents the data stored in the table.
 int getNumObfuscations()
           
 int getRowCount()
          Returns the current number of rows
 java.lang.Object getValueAt(int row, int col)
          Returns the value at the cell specified
 boolean isCellEditable(int r, int c)
          Returns true if the cell at row r, column c is editable, otherwise false.
 void resetAll()
          Resets all of the obfuscations in the table to their default..
 void setClassOn(int row)
          When a class name is clicked on, sets all obfuscations in all methods to full.
 void setMethodOn(int row)
          When a method name in the table is clicked on, all of the obfuscations for that method are set to full.
 void setValueAt(java.lang.Object value, int row, int col)
          Sets the value in the table to the specified value.
 void updateCellLight(int row, int col)
          Increments the integer in the table at the (row, col) coordinates by one modulo three.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNames

final java.lang.String[] columnNames

data

final java.lang.Object[][] data

columnClasses

final java.lang.Class[] columnClasses
Constructor Detail

ObTableModel

public ObTableModel(ClassFileCollection cfc)
Constructs a new JTable with the starting values specified in the ClassFileCollection.

Parameters:
cfc - the starting ClassFileCollection.
Method Detail

getColumnCount

public int getColumnCount()
Returns the number of colmuns.

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Returns:
returns the number of columns in the table

getRowCount

public int getRowCount()
Returns the current number of rows

Specified by:
getRowCount in interface javax.swing.table.TableModel
Returns:
the number of rows in the table.

getColumnName

public java.lang.String getColumnName(int col)
Returns the title of the specified column

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
col - the column number (zero based index)
Returns:
the name of the column

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Returns the value at the cell specified

Specified by:
getValueAt in interface javax.swing.table.TableModel
Parameters:
row - the row in the table
col - the column in the table
Returns:
the Object located at row, col in the table.

getColumnClass

public java.lang.Class getColumnClass(int c)
Returns the Class of object at the first row of the cth column. This is used to make determinations by the table about how to display the data.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
c - the column in the table for which to get the class
Returns:
the class type of the data in the column

isCellEditable

public boolean isCellEditable(int r,
                              int c)
Returns true if the cell at row r, column c is editable, otherwise false.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
r - a row in the table.
c - a column in the table.
Returns:
true if the cell at row r, column c is editable, otherwise false.

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Sets the value in the table to the specified value.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
Parameters:
value - the value to insert into the table.
row - a row in the table

getData

public java.lang.Object[][] getData()
Gets the Object array that represents the data stored in the table.

Returns:
an Object[][] array which holds the data that is in the table.

updateCellLight

public void updateCellLight(int row,
                            int col)
Increments the integer in the table at the (row, col) coordinates by one modulo three. Example: if the value at (3,4) was 1, after method return it would be 2. It the value were 2, after method return, it would be 0. In the case of the cell being a class, all rows of methods belonging to that class will be incremented in that column..

Parameters:
row - a row in the table
col - a column in the table

getNumObfuscations

public int getNumObfuscations()

setMethodOn

public void setMethodOn(int row)
When a method name in the table is clicked on, all of the obfuscations for that method are set to full.

Parameters:
row - the row to set all of the obfuscations.

setClassOn

public void setClassOn(int row)
When a class name is clicked on, sets all obfuscations in all methods to full.

Parameters:
row - the row where the class name is.

resetAll

public void resetAll()
Resets all of the obfuscations in the table to their default..


SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002