// Path: src/main/java/edu/utah/ece/async/sboldesigner/swing/AbstractListTableModel.java
// public abstract class AbstractListTableModel<T> extends AbstractTableModel {
// 	private final String[] columns;
// 	private final double[] widths;
// 	private List<T> elements;
// 
// 	public AbstractListTableModel(List<T> components, String[] columns, double[] widths) {
// 		super();
// 		this.elements = components;
// 		this.columns = columns;
// 		this.widths = widths;
// 	}
// 
// 	public double[] getWidths() {
// 		return widths;
// 	}
// 
// 	public void setElements(List<T> components) {
// 		this.elements = components;
// 		fireTableDataChanged();
// 	}
// 
// 	public int getColumnCount() {
// 		return columns.length;
// 	}
// 
// 	public int getRowCount() {
// 		return elements.size();
// 	}
// 
// 	public String getColumnName(int col) {
// 		return columns[col];
// 	}
// 
// 	public T getElement(int row) {
// 		return elements.get(row);
// 	}
// 
// 	public Class<?> getColumnClass(int col) {
// 		return Object.class;
// 	}
// 
// 	public boolean isCellEditable(int row, int col) {
// 		return false;
// 	}
// 
// 	public Object getValueAt(int row, int col) {
// 		T element = getElement(row);
// 		return getField(element, col);
// 	}
// 
// 	protected abstract Object getField(T element, int field);
// }


import java.util.List;
import org.sbolstandard.core2.ComponentDefinition;
import edu.utah.ece.async.sboldesigner.swing.AbstractListTableModel;

/*
 * Copyright (c) 2012 - 2015, Clark & Parsia, LLC. <http://www.clarkparsia.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package edu.utah.ece.async.sboldesigner.sbol.editor.dialog;




class ComponentDefinitionTableModel extends AbstractListTableModel<ComponentDefinition> {
	private static final String[] COLUMNS = { "Type", "Display Id", "Name", "Version", "Description" };
	private static final double[] WIDTHS = { 0.1, 0.2, 0.2, 0.1, 0.4 };

	public ComponentDefinitionTableModel(List<ComponentDefinition> CDs) {
		super(CDs, COLUMNS, WIDTHS);
	}

	public Object getField(ComponentDefinition CD, int col) {
		switch (col) {
		case 0:
			return "Part";
		case 1:

// Path: src/main/java/edu/utah/ece/async/sboldesigner/swing/AbstractListTableModel.java
// public abstract class AbstractListTableModel<T> extends AbstractTableModel {
// 	private final String[] columns;
// 	private final double[] widths;
// 	private List<T> elements;
// 
// 	public AbstractListTableModel(List<T> components, String[] columns, double[] widths) {
// 		super();
// 		this.elements = components;
// 		this.columns = columns;
// 		this.widths = widths;
// 	}
// 
// 	public double[] getWidths() {
// 		return widths;
// 	}
// 
// 	public void setElements(List<T> components) {
// 		this.elements = components;
// 		fireTableDataChanged();
// 	}
// 
// 	public int getColumnCount() {
// 		return columns.length;
// 	}
// 
// 	public int getRowCount() {
// 		return elements.size();
// 	}
// 
// 	public String getColumnName(int col) {
// 		return columns[col];
// 	}
// 
// 	public T getElement(int row) {
// 		return elements.get(row);
// 	}
// 
// 	public Class<?> getColumnClass(int col) {
// 		return Object.class;
// 	}
// 
// 	public boolean isCellEditable(int row, int col) {
// 		return false;
// 	}
// 
// 	public Object getValueAt(int row, int col) {
// 		T element = getElement(row);
// 		return getField(element, col);
// 	}
// 
// 	protected abstract Object getField(T element, int field);
// }


// Path: src/main/java/edu/utah/ece/async/sboldesigner/sbol/editor/dialog/ComponentDefinitionTableModel.java
import java.util.List;
import org.sbolstandard.core2.ComponentDefinition;
import edu.utah.ece.async.sboldesigner.swing.AbstractListTableModel;

/*
 * Copyright (c) 2012 - 2015, Clark & Parsia, LLC. <http://www.clarkparsia.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package edu.utah.ece.async.sboldesigner.sbol.editor.dialog;




class ComponentDefinitionTableModel extends AbstractListTableModel<ComponentDefinition> {
	private static final String[] COLUMNS = { "Type", "Display Id", "Name", "Version", "Description" };
	private static final double[] WIDTHS = { 0.1, 0.2, 0.2, 0.1, 0.4 };

	public ComponentDefinitionTableModel(List<ComponentDefinition> CDs) {
		super(CDs, COLUMNS, WIDTHS);
	}

	public Object getField(ComponentDefinition CD, int col) {
		switch (col) {
		case 0:
			return "Part";
		case 1:

			return CD.getDisplayId();
