*/
    @Override
    public void mouseClicked(MouseEvent e)
    {
        int numOfRecs = lines.uniqueID.size()-1;
        String[] recordMin, recordMax;
        String xyMin, xyMax;
        Double x1, y1, x2, y2;
        int x,y;
        Boolean upLeft = false;
        Double[] coordinates;
        
        // the purpose of this loop is to see if a bone was click on
        // in the map panel. Scaling and offsetting is done to get the position
        // of the bones realtive to the mouse click.
        // each bone record must be individually checked if it has been clicked
        // on every time there is a click event. However the function
        // exits once it finds a match to prevent getting multiple results from
        // one click.
        String lastBone = activeBone;
        for(int i = 0; i < numOfRecs; i++)
        {
            if(lines.xymax.get(i) != null)
            {
                activeBone = "";
                // get xy min and max, then parse into array of strings.
                xyMin = lines.xymin.get(i);
                xyMax = lines.xymax.get(i);
                xyMin = xyMin.trim();
                xyMax = xyMax.trim();
                xyMin += " ";
                xyMin += xyMax;
                recordMin = xyMin.split(" ");
                recordMax = xyMax.split(" ");
                
                // call function that given array of strings, returns array of
                // doubles with the x coordinates in the even indices and
                // y coordinates in the odd indices.
                coordinates = getXY(recordMin);

                // scale coordinates, the odd coordinates (y min and max)
                // must be scaled so as to invert ther position, essentially
                // vertically flip the y coordintas. The x coordinates are 
                // scaled down like other points.
                coordinates[0] -= scaleMeters[0];
                coordinates[1] = scaleMeters[3]-coordinates[1];
                coordinates[2] -= scaleMeters[0];
                coordinates[3] = scaleMeters[3]-coordinates[3];
                
                // now that the min and max coordinates are scaled, they are now
                // scaled and offset to the same scale and offset as the items
                // that where drawn on the panel.
                coordinates[0] = coordinates[0] * scaleFactor + xOffset;
                coordinates[1] = coordinates[1] * scaleFactor + yOffset;
                coordinates[2] = coordinates[2] * scaleFactor + xOffset;
                coordinates[3] = coordinates[3] * scaleFactor + yOffset;

                
                x = e.getX();
                y = e.getY();

                int currDetailLevel = lines.element.get(i);
                
                // check to see if the mouse click is within the area of a bone
                // on the map panel.
                if((double)x > coordinates[0] 
                        && (double)y > coordinates[3] 
                        && (double)x < coordinates[2]
                        && (double)y < coordinates[1] 
                        && currDetailLevel < detailLevel
                        && !(lastBone.equals(lines.uniqueID.get(i))))
                {
                    activeBone = lines.uniqueID.get(i);
                    controller.showBoneInfo(activeBone);
                    break;
                }
                else
                    controller.menuPanel.infoPanel.setVisible(false);
            }
        }
        repaint();       
    }