use of cbit.vcell.model.gui.ScopedExpressionTableCellRenderer in project vcell by virtualcell.
the class ScrollTable method setAutoResizeMode.
@Override
public void setAutoResizeMode(int mode) {
super.setAutoResizeMode(mode);
if (autoResizeMode == AUTO_RESIZE_OFF) {
setDefaultRenderer(ScopedExpression.class, new ScopedExpressionTableCellRenderer());
setDefaultRenderer(VCUnitDefinition.class, new DefaultScrollTableCellRenderer() {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (value instanceof VCUnitDefinition) {
setText(((VCUnitDefinition) value).getSymbolUnicode());
}
return this;
}
});
if (componentListener == null) {
componentListener = new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
ScopedExpressionTableCellRenderer.formatTableCellSizes(ScrollTable.this);
}
});
}
};
}
enclosingScrollPane.removeComponentListener(componentListener);
enclosingScrollPane.addComponentListener(componentListener);
} else {
if (componentListener != null) {
enclosingScrollPane.removeComponentListener(componentListener);
}
}
}
Aggregations