1 package net.sf.openrocket.gui.customexpression;
3 import javax.swing.table.AbstractTableModel;
5 import net.sf.openrocket.l10n.Translator;
6 import net.sf.openrocket.simulation.customexpression.Functions;
7 import net.sf.openrocket.startup.Application;
9 public class OperatorTableModel extends AbstractTableModel {
11 private static final Translator trans = Application.getTranslator();
13 private static final String[] columnNames = {trans.get("customExpression.Operator"), trans.get("customExpression.Description")};
15 private final Object[] operators = Functions.AVAILABLE_OPERATORS.keySet().toArray();
16 private final Object[] descriptions = Functions.AVAILABLE_OPERATORS.values().toArray();
18 public OperatorTableModel(){
23 public int getColumnCount() {
28 public int getRowCount() {
29 return Functions.AVAILABLE_OPERATORS.size();
33 public Object getValueAt(int row, int col) {
35 return operators[row].toString();
38 return descriptions[row].toString();
44 public String getColumnName(int col) {
45 return columnNames[col];
48 public String getOperatorAt(int row) {
49 return operators[row].toString();