From 1bc16326fd4fa6a91ba513de0d5aca3202e616c1 Mon Sep 17 00:00:00 2001 From: Dan Vasilescu Date: Tue, 29 Oct 2024 17:46:17 -0400 Subject: [PATCH] molecular details: NamedColor combobox, editor, renderer --- .../gui/MolecularTypeSpecsTableModel.java | 6 ++-- .../gui/MolecularStructuresPanel.java | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/vcell-client/src/main/java/cbit/vcell/mapping/gui/MolecularTypeSpecsTableModel.java b/vcell-client/src/main/java/cbit/vcell/mapping/gui/MolecularTypeSpecsTableModel.java index ec3bfb1c96..454610545e 100644 --- a/vcell-client/src/main/java/cbit/vcell/mapping/gui/MolecularTypeSpecsTableModel.java +++ b/vcell-client/src/main/java/cbit/vcell/mapping/gui/MolecularTypeSpecsTableModel.java @@ -56,13 +56,13 @@ public class MolecularTypeSpecsTableModel extends VCellSortTableModel [nm]"; + setText(text); + } else { + setText(value + " [nm]"); + } + } else if(MolecularTypeSpecsTableModel.ColumnType.COLUMN_DIFFUSION.ordinal() == column) { + if(!isSelected) { + String darkRed = "#8B0000"; + String text = "" + value + " [um^2/s]"; + setText(text); + } else { + setText(value + " [um^2/s"); + } + } + } + } + return this; + } + }; getMolecularTypeSpecsTable().setDefaultRenderer(String.class, new DefaultScrollTableCellRenderer()); getMolecularTypeSpecsTable().setDefaultRenderer(Structure.class, structuresTableCellRenderer); // The Structures combobox cell renderer + getMolecularTypeSpecsTable().setDefaultRenderer(Expression.class, expressionTableCellRenderer); // Expression field cell renderer getMolecularTypeSpecsTable().setDefaultRenderer(NamedColor.class, namedColorTableCellRenderer); // NamedColor combobox cell renderer