本文整理汇总了Java中net.sf.memoranda.ui.treetable.TreeTableModel类的典型用法代码示例。如果您正苦于以下问题:Java TreeTableModel类的具体用法?Java TreeTableModel怎么用?Java TreeTableModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TreeTableModel类属于net.sf.memoranda.ui.treetable包,在下文中一共展示了TreeTableModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getColumnClass
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
/**
* @see net.sf.memoranda.ui.treetable.TreeTableModel#getColumnClass(int)
*/
public Class getColumnClass(int column) {
try {
switch (column) {
case 1:
return TreeTableModel.class;
case 0:
return TaskTable.class;
case 4:
case 5:
return Class.forName("java.lang.String");
case 2:
case 3:
return Class.forName("java.util.Date");
case 6:
return Class.forName("java.lang.Integer");
}
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例2: getColumnClass
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
/**
* @see net.sf.memoranda.ui.treetable.TreeTableModel#getColumnClass(int)
*/
public Class getColumnClass(int column) {
try {
switch (column) {
case 1:
return TreeTableModel.class;
case 0:
return TaskTable.class;
case 4:
case 5:
return Class.forName("java.lang.String");
case 2:
case 3:
return Class.forName("java.util.Date");
case 6:
return Class.forName("java.lang.Integer");
case 7:
return Class.forName("java.lang.String");
}
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例3: getColumnClass
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
/**
* @see net.sf.memoranda.ui.treetable.TreeTableModel#getColumnClass(int)
*/
public Class getColumnClass(int column) {
try {
switch (column) {
case 1:
return TreeTableModel.class;
case 0:
return TaskTable.class;
case 4:
case 5:
return Class.forName("java.lang.String");
case 2:
case 3:
return Class.forName("java.util.Date");
case 6:
return Class.forName("java.lang.Integer");
}
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例4: getColumnClass
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
public Class getColumnClass(int column) {
try {
switch (column) {
case 1:
return TreeTableModel.class;
case 0:
return DefectTable.class;
case 4:
case 5:
return Class.forName("java.lang.String");
case 2:
case 3:
return Class.forName("java.util.Date");
case 6:
return Class.forName("java.lang.Integer");
default:
return Class.forName("java.lang.String");
}
} catch (Exception ex) {
ex.printStackTrace();
}
System.out.println(column);
return null;
}
示例5: getColumnClass
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
/**
* @see net.sf.memoranda.ui.treetable.TreeTableModel#getColumnClass(int)
*/
@Override
public Class getColumnClass(int column) {
try {
switch (column) {
case 1:
return TreeTableModel.class;
case 0:
return TaskTable.class;
case 4:
case 5:
return Class.forName("java.lang.String");
case 2:
case 3:
return Class.forName("java.util.Date");
case 6:
return Class.forName("java.lang.Integer");
}
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例6: getColumnClass
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
/**
* @see net.sf.memoranda.ui.treetable.TreeTableModel#getColumnClass(int)
*/
public Class getColumnClass(int column) {
try {
switch (column) {
case 1:
return TreeTableModel.class;
case 0:
return TaskTable.class;
case 4:
case 5:
return Class.forName("java.lang.String");
case 2:
case 3:
return Class.forName("java.util.Date");
case 6:
return Class.forName("java.lang.Integer");
case 7:
return Class.forName("java.lang.String");
}
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例7: getColumnClass
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
/**
* @see net.sf.memoranda.ui.treetable.TreeTableModel#getColumnClass(int)
*/
public Class getColumnClass(int column) {
try {
switch (column) {
case 1:
return TreeTableModel.class;
case 0:
return TaskTable.class;
case 4:
case 5:
return Class.forName("java.lang.String");
case 2:
case 3:
return Class.forName("java.util.Date");
case 6:
return Class.forName("java.lang.Integer");
case 7:
return Class.forName("java.lang.String");
case 8:
return Class.forName("java.lang.String");
case 9:
return Class.forName("java.lang.String");
case 10:
return Class.forName("java.lang.String");
}
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例8: getColumnClass
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
/**
* @see net.sf.memoranda.ui.treetable.TreeTableModel#getColumnClass(int)
*/
public Class getColumnClass(int column) {
try {
switch (column) {
case 1:
return TreeTableModel.class;
case 0:
return TimeLogTable.class;
case 2:
return Class.forName("java.lang.String");
case 3:
// return Class.forName("java.util.Date");
case 4:
// return Class.forName("java.util.Date");
case 5:
return Class.forName("java.lang.Integer");
case 6:
return Class.forName("java.lang.Integer");
case 7:
return Class.forName("java.lang.String");
case 8:
return Class.forName("java.lang.String");
case 9:
return Class.forName("java.lang.String");
}
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例9: initTable
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
private void initTable() {
//model = new TaskTableModel();
model = new TaskTableSorter(this);
// Create the tree. It will be used as a renderer and editor.
tree = new TreeTableCellRenderer(model);
// store tree expansion status and
// restore after sorting/project change etc.
expansion = new ExpansionHandler();
tree.addTreeExpansionListener(expansion);
// Install a tableModel representing the visible rows in the tree.
TreeTableModelAdapter modelAdapter = new TreeTableModelAdapter(model, tree);
super.setModel(modelAdapter);
// Install the tree editor renderer and editor.
renderer = new TaskTreeTableCellRenderer(this);
tree.setCellRenderer(renderer);
setDefaultRenderer(TreeTableModel.class, tree);
setDefaultRenderer(Integer.class, renderer);
setDefaultRenderer(TaskTable.class, renderer);
setDefaultRenderer(String.class, renderer);
setDefaultRenderer(java.util.Date.class, renderer);
setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
// column name is repeated in 2 places, do something about it!
getColumn("% " + Local.getString("done")).setCellEditor(new TaskProgressEditor());
// TODO: editor for task progress
// grid.
setShowGrid(false);
// No intercell spacing
setIntercellSpacing(new Dimension(0, 0));
// And update the height of the trees row to match that of
// the table.
//if (tree.getRowHeight() < 1) {
setRowHeight(18);
//}
initColumnWidths();
// do not allow moving columns
getTableHeader().setReorderingAllowed(false);
}
示例10: getEditingRow
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
public int getEditingRow() {
return (getColumnClass(editingColumn) == TreeTableModel.class) ? -1
: editingRow;
}
示例11: isCellEditable
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
/**
* Overridden to return false, and if the event is a mouse event it is
* forwarded to the tree.
* <p>
* The behavior for this is debatable, and should really be offered as a
* property. By returning false, all keyboard actions are implemented in
* terms of the table. By returning true, the tree would get a chance to
* do something with the keyboard events. For the most part this is ok.
* But for certain keys, such as left/right, the tree will
* expand/collapse where as the table focus should really move to a
* different column. Page up/down should also be implemented in terms of
* the table. By returning false this also has the added benefit that
* clicking outside of the bounds of the tree node, but still in the
* tree column will select the row, whereas if this returned true that
* wouldn't be the case.
* <p>
* By returning false we are also enforcing the policy that the tree
* will never be editable (at least by a key sequence).
*/
public boolean isCellEditable(EventObject e) {
if (e instanceof MouseEvent) {
for (int counter = getColumnCount() - 1; counter >= 0; counter--) {
if (getColumnClass(counter) == TreeTableModel.class) {
MouseEvent me = (MouseEvent) e;
MouseEvent newME = new MouseEvent(tree, me.getID(), me
.getWhen(), me.getModifiers(), me.getX()
- getCellRect(0, counter, true).x, me.getY(),
me.getClickCount(), me.isPopupTrigger());
tree.dispatchEvent(newME);
break;
}
}
}
return false;
}
示例12: initTable
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
private void initTable() {
//model = new TaskTableModel();
model = new TaskTableSorter( this );
// Create the tree. It will be used as a renderer and editor.
tree = new TreeTableCellRenderer(model);
// store tree expansion status and
// restore after sorting/project change etc.
expansion = new ExpansionHandler();
tree.addTreeExpansionListener(expansion);
// Install a tableModel representing the visible rows in the tree.
modelAdapter = new TreeTableModelAdapter(model, tree);
super.setModel(modelAdapter);
// Install the tree editor renderer and editor.
renderer = new TaskTreeTableCellRenderer(this);
tree.setCellRenderer(renderer);
setDefaultRenderer(TreeTableModel.class, tree);
setDefaultRenderer(Integer.class, renderer);
setDefaultRenderer(TaskTable.class, renderer);
setDefaultRenderer(String.class, renderer);
setDefaultRenderer(java.util.Date.class, renderer);
setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
// column name is repeated in 2 places, do something about it!
getColumn( "% " + Local.getString("done") ).setCellEditor(new TaskProgressEditor());
// TODO: editor for task progress
// grid.
setShowGrid(false);
// No intercell spacing
setIntercellSpacing(new Dimension(0, 0));
// And update the height of the trees row to match that of
// the table.
//if (tree.getRowHeight() < 1) {
setRowHeight(18);
//}
initColumnWidths();
// do not allow moving columns
getTableHeader().setReorderingAllowed(false);
}
示例13: initTable
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
private void initTable() {
model = new DefectTableSorter( this );
// Create the tree. It will be used as a renderer and editor.
tree = new TreeTableCellRenderer(model);
// store tree expansion status and
// restore after sorting/project change etc.
expansion = new ExpansionHandler();
tree.addTreeExpansionListener(expansion);
// Install a tableModel representing the visible rows in the tree.
modelAdapter = new TreeTableModelAdapter(model, tree);
super.setModel(modelAdapter);
// Install the tree editor renderer and editor.
renderer = new DefectTreeTableCellRenderer(this);
tree.setCellRenderer(renderer);
setDefaultRenderer(TreeTableModel.class, tree);
setDefaultRenderer(Integer.class, renderer);
setDefaultRenderer(DefectTable.class, renderer);
setDefaultRenderer(String.class, renderer);
setDefaultRenderer(java.util.Date.class, renderer);
setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
// grid.
setShowGrid(false);
// No intercell spacing
setIntercellSpacing(new Dimension(0, 0));
// And update the height of the trees row to match that of
// the table.
//if (tree.getRowHeight() < 1) {
setRowHeight(18);
//}
initColumnWidths();
// do not allow moving columns
getTableHeader().setReorderingAllowed(false);
getTableHeader().setBackground(ColorScheme.getColor("frame_secondary"));
}
示例14: initTable
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
private void initTable() {
// model = new TaskTableModel();
model = new TaskTableSorter(this);
// Create the tree. It will be used as a renderer and editor.
tree = new TreeTableCellRenderer(model);
// store tree expansion status and
// restore after sorting/project change etc.
expansion = new ExpansionHandler();
tree.addTreeExpansionListener(expansion);
// Install a tableModel representing the visible rows in the tree.
modelAdapter = new TreeTableModelAdapter(model, tree);
super.setModel(modelAdapter);
// Install the tree editor renderer and editor.
renderer = new TaskTreeTableCellRenderer(this);
tree.setCellRenderer(renderer);
setDefaultRenderer(TreeTableModel.class, tree);
setDefaultRenderer(Integer.class, renderer);
setDefaultRenderer(TaskTable.class, renderer);
setDefaultRenderer(String.class, renderer);
setDefaultRenderer(java.util.Date.class, renderer);
setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
// column name is repeated in 2 places, do something about it!
getColumn("% " + Local.getString("done")).setCellEditor(new TaskProgressEditor());
// TODO: editor for task progress
// grid.
setShowGrid(false);
// No intercell spacing
setIntercellSpacing(new Dimension(0, 0));
// And update the height of the trees row to match that of
// the table.
// if (tree.getRowHeight() < 1) {
setRowHeight(18);
// }
initColumnWidths();
// do not allow moving columns
getTableHeader().setReorderingAllowed(false);
}
示例15: getEditingRow
import net.sf.memoranda.ui.treetable.TreeTableModel; //导入依赖的package包/类
@Override
public int getEditingRow() {
return (getColumnClass(editingColumn) == TreeTableModel.class) ? -1 : editingRow;
}