]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/distance/GenericTableModel.java
Moved source into separate src directory due to popular request
[GpsPrune.git] / tim / prune / function / distance / GenericTableModel.java
diff --git a/tim/prune/function/distance/GenericTableModel.java b/tim/prune/function/distance/GenericTableModel.java
deleted file mode 100644 (file)
index bc56540..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-package tim.prune.function.distance;
-
-import java.util.ArrayList;
-
-import javax.swing.table.AbstractTableModel;
-
-import tim.prune.I18nManager;
-import tim.prune.data.DataPoint;
-
-/**
- * General table model class for the two models in the distance function
- */
-public abstract class GenericTableModel extends AbstractTableModel
-{
-       /** list of points */
-       protected ArrayList<DataPoint> _pointList = null;
-       /** Column heading */
-       private static String _currPointLabel = I18nManager.getText("dialog.distances.currentpoint");
-
-       /**
-        * Initialize the table model with the point list
-        * @param inPointList list of points
-        */
-       public void init(ArrayList<DataPoint> inPointList)
-       {
-               _pointList = inPointList;
-       }
-
-       /**
-        * @return row count
-        */
-       public int getRowCount()
-       {
-               if (_pointList == null) {return 0;}
-               return _pointList.size();
-       }
-
-       /**
-        * Get the name of the specified point from the list
-        * @param inIndex index of point
-        * @return waypoint name if waypoint, otherwise "current point"
-        */
-       protected String getPointName(int inIndex)
-       {
-               if (_pointList == null) {return "null";}
-               DataPoint point = _pointList.get(inIndex);
-               if (point.isWaypoint()) {return point.getWaypointName();}
-               return _currPointLabel;
-       }
-}