m_table.addMouseListener(new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent ev)
{
TableColumnModel colModel = m_table.getColumnModel();
int colIndex = colModel.getColumnIndexAtX(ev.getX()), index;
if (colIndex >= 0)
{
if ((index = colModel.getColumn(colIndex).getModelIndex()) >= 0)
{
int tag = JExifDataModel.m_colTag[index];
if (tag == JExifTag.GPSTAG_TAG_MAPLINK)
{
if ((index = m_table.getSelectedRow()) >= 0)
{
JIfdData data = m_tableData.getRowData(index);
if (data.isTagPresent(tag))
{
float latitude = data.getGPSLatitude();
if (data.getGPSLatitudeRef().equals("S"))
latitude = -latitude;
float longitude = data.getGPSLongitude();
if (data.getGPSLongitudeRef().equals("W"))
longitude = -longitude;
String title, str;
Date date = JIfdData.getDateFromString(data.getDigitizedDateTime());
if (date == null)
date = data.getFileDate();
SimpleDateFormat sdf = new SimpleDateFormat("EEEE");
StringBuffer strBuf = new StringBuffer();
sdf.format(date, strBuf, new FieldPosition(0));
String strDate = strBuf + ", " + DateFormat.getDateInstance(DateFormat.LONG).format(date);
String strTime = DateFormat.getTimeInstance(DateFormat.MEDIUM).format(date);
String fileName = data.getFullFileName();
title = String.format(Main.getString("data_gps_title"), fileName, strDate, strTime);
String laStr = JExifDataModel.getTagValue(data, JExifTag.GPSTAG_TAG_LATITUDE).toString();
String loStr = JExifDataModel.getTagValue(data, JExifTag.GPSTAG_TAG_LONGITUDE).toString();
String alStr = "";
if (data.isTagPresent(JExifTag.GPSTAG_TAG_ALTITUDE))
alStr = JExifDataModel.getTagValue(data, JExifTag.GPSTAG_TAG_ALTITUDE).toString();
String info = String.format(Main.getString("data_gps_info"), fileName, strDate, strTime, laStr, loStr, alStr);
try
{
title = URLEncoder.encode(title, "UTF-8");
}
catch (UnsupportedEncodingException ex)
{}
try
{
info = URLEncoder.encode(info, "UTF-8");
}
catch (UnsupportedEncodingException ex)
{}
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
int size_w = (int)(dim.width * 0.66f);
int size_h = (int)(dim.height * 0.66f);
String url = "";
Locale loc = Locale.getDefault();
Locale.setDefault(Locale.US);
int width = colModel.getColumn(colIndex).getWidth()/3;
int offset = 0;
for(int i = 0; i < colIndex; i++)
offset += colModel.getColumn(i).getWidth();
offset = ev.getX() - offset;
if (offset < width)
url = String.format(Main.getString("data_gps_gmlinkhttp"), latitude, longitude, latitude, longitude, "hybrid", 15, info, title, size_w, size_h);
else if (offset >= width && offset < 2*width)