org.tizen.injector.location.map_1.0.0.201310291329

16:50:05.990 INFO  jd.cli.Main - Decompiling org.tizen.injector.location.map_1.0.0.201310291329.jar
package org.tizen.injector.location.map;

import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.Section;
import org.tizen.injector.location.core.model.GeoLocationVO;
import org.tizen.injector.location.map.page.MapImage;
import org.tizen.injector.model.DefaultTableModel;
import org.tizen.injector.provider.AbstractInjectorItem;
import org.tizen.injector.provider.AbstractInjectorPage;

public class Map
  extends AbstractInjectorItem
{
  private static String LABEL = Messages.Map_0;
  private DefaultTableModel model = new DefaultTableModel(new GeoLocationVO());
  private ArrayList<TableViewer> viewerList = new ArrayList();
  
  protected void addPages()
  {
    addPage(new MapImage(this, Messages.Map_1, model));
  }
  
  public void initializeContents()
  {
    Iterator localIterator = getPageList().iterator();
    while (localIterator.hasNext())
    {
      AbstractInjectorPage localAbstractInjectorPage = (AbstractInjectorPage)localIterator.next();
      localAbstractInjectorPage.initializeContents();
    }
  }
  
  public void addViewer(TableViewer paramTableViewer)
  {
    viewerList.add(paramTableViewer);
  }
  
  public void refreshViewers()
  {
    for (int i = 0; i < viewerList.size(); i++) {
      ((TableViewer)viewerList.get(i)).refresh();
    }
  }
  
  public void setSiblingsEnabled(boolean paramBoolean)
  {
    ArrayList localArrayList = getCategoryItems("Location");
    for (int i = 0; i < localArrayList.size(); i++)
    {
      Section localSection = (Section)((AbstractInjectorItem)localArrayList.get(i)).getParent().getParent();
      if (!localSection.getText().equals(LABEL))
      {
        if (!paramBoolean) {
          localSection.setExpanded(paramBoolean);
        }
        localSection.setEnabled(paramBoolean);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.Map
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.tizen.injector.location.map.messages";
  public static String Map_0;
  public static String Map_1;
  
  static
  {
    NLS.initializeMessages("org.tizen.injector.location.map.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.Messages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.UnknownHostException;

public class CheckNetThread
  extends Thread
{
  private boolean isError = true;
  private String errorMsg = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br><center>Failed to load the map (throw time out ...)<br>Please check the network status!</center></body></html>";
  
  private boolean checkGoogle()
  {
    try
    {
      URL localURL = new URL("http://www.google.com/");
      HttpURLConnection localHttpURLConnection = (HttpURLConnection)localURL.openConnection();
      localHttpURLConnection.connect();
      int i = 0;
      if (localHttpURLConnection.getResponseCode() != -1)
      {
        BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localHttpURLConnection.getInputStream()));
        String str2 = "<title>";
        String str3 = "</title>";
        String str1;
        label110:
        for (int j = 0; (str1 = localBufferedReader.readLine()) != null; j = 1)
        {
          if ((!str1.contains(str2)) && (j == 0)) {
            break label110;
          }
          if (str1.contains("google")) {
            i = 1;
          }
          if ((i != 0) || (str1.contains(str3))) {
            break;
          }
        }
        localBufferedReader.close();
      }
      if (i == 0)
      {
        errorMsg = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br><center>Failed to load the map.<br>Please check the network status!</center></body></html>";
        return false;
      }
      localHttpURLConnection.disconnect();
    }
    catch (UnknownHostException localUnknownHostException)
    {
      errorMsg = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br><center>Can't connect to network.</center></body></html>";
      return false;
    }
    catch (IOException localIOException)
    {
      errorMsg = ("<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br><center>Failed to load the map.<br>" + localIOException.getMessage() + "</center></body></html>");
      return false;
    }
    return true;
  }
  
  public void run()
  {
    if (!checkGoogle()) {
      isError = true;
    } else {
      isError = false;
    }
    synchronized (this)
    {
      notifyAll();
    }
  }
  
  public boolean isError()
  {
    return isError;
  }
  
  public String getErrorMsg()
  {
    return errorMsg;
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.CheckNetThread
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import java.io.PrintStream;

public class DebugLog
{
  static
  {
    synchronized (DebugLog.class)
    {
      System.out.println("This is empty synchronized phase.");
    }
  }
  
  public static void log(String paramString) {}
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.DebugLog
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import java.util.Calendar;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;

class LoggerFormatter
  extends Formatter
{
  public String format(LogRecord paramLogRecord)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    Calendar localCalendar = Calendar.getInstance();
    localCalendar.setTimeInMillis(paramLogRecord.getMillis());
    localStringBuffer.append('[');
    localStringBuffer.append(localCalendar.get(1));
    localStringBuffer.append('.');
    localStringBuffer.append(localCalendar.get(2));
    localStringBuffer.append('.');
    localStringBuffer.append(localCalendar.get(5));
    localStringBuffer.append(' ');
    localStringBuffer.append(localCalendar.get(11));
    localStringBuffer.append(':');
    localStringBuffer.append(localCalendar.get(12));
    localStringBuffer.append(':');
    localStringBuffer.append(localCalendar.get(13));
    localStringBuffer.append(']');
    localStringBuffer.append('[');
    localStringBuffer.append(paramLogRecord.getLevel());
    localStringBuffer.append(']');
    localStringBuffer.append('[');
    localStringBuffer.append(paramLogRecord.getSourceClassName().substring(paramLogRecord.getSourceClassName().lastIndexOf(".") + 1));
    localStringBuffer.append('.');
    localStringBuffer.append(paramLogRecord.getSourceMethodName());
    localStringBuffer.append("] ");
    localStringBuffer.append(paramLogRecord.getMessage());
    Throwable localThrowable = paramLogRecord.getThrown();
    if (localThrowable != null)
    {
      StackTraceElement[] arrayOfStackTraceElement = localThrowable.getStackTrace();
      localStringBuffer.append('\n');
      localStringBuffer.append(localThrowable.toString());
      for (int i = 0; i < arrayOfStackTraceElement.length; i++)
      {
        localStringBuffer.append('\n');
        localStringBuffer.append(arrayOfStackTraceElement[i].toString());
      }
    }
    localStringBuffer.append('\n');
    return localStringBuffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.LoggerFormatter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;

class MapImage$1
  implements ProgressListener
{
  MapImage$1(MapImage paramMapImage) {}
  
  public void completed(ProgressEvent paramProgressEvent)
  {
    DebugLog.log("[Map] Map Loading: Compelete");
  }
  
  public void changed(ProgressEvent paramProgressEvent) {}
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.MapImage.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import org.eclipse.swt.SWTException;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Button;
import org.tizen.injector.location.core.model.GeoLocationVO;
import org.tizen.injector.location.core.protocol.GeoLocation;
import org.tizen.injector.location.map.Map;
import org.tizen.injector.model.DefaultTableModel;

class MapImage$2$1$1
  implements Runnable
{
  MapImage$2$1$1(MapImage.2.1 param1) {}
  
  public void run()
  {
    try
    {
      int i = ((Double)MapImage.access$0(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).evaluate("return markersArray.length;")).intValue();
      if (MapImage.access$1(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).size() == i) {
        return;
      }
      int j;
      Double localDouble1;
      Double localDouble2;
      GeoLocationVO localGeoLocationVO;
      GeoLocation localGeoLocation;
      if (MapImage.access$1(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).size() == i - 1)
      {
        j = i - 1;
        localDouble1 = Double.valueOf(((Double)MapImage.access$0(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).evaluate("return markersArray[" + j + "].getPosition().lat();")).doubleValue());
        localDouble2 = Double.valueOf(((Double)MapImage.access$0(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).evaluate("return markersArray[" + j + "].getPosition().lng();")).doubleValue());
        localGeoLocationVO = new GeoLocationVO();
        localGeoLocation = new GeoLocation(localDouble1.doubleValue(), localDouble2.doubleValue());
        localGeoLocationVO.setSeq(i);
        localGeoLocationVO.setLocation(localGeoLocation);
        MapImage.access$1(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).add(localGeoLocationVO);
        ((Map)MapImage.2.access$0(MapImage.2.1.access$0(this$2)).getParent()).refreshViewers();
      }
      else
      {
        MapImage.access$1(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).clear();
        for (j = 0; j < i; j++)
        {
          localDouble1 = Double.valueOf(((Double)MapImage.access$0(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).evaluate("return markersArray[" + j + "].getPosition().lat();")).doubleValue());
          localDouble2 = Double.valueOf(((Double)MapImage.access$0(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).evaluate("return markersArray[" + j + "].getPosition().lng();")).doubleValue());
          localGeoLocationVO = new GeoLocationVO();
          localGeoLocation = new GeoLocation(localDouble1.doubleValue(), localDouble2.doubleValue());
          localGeoLocationVO.setSeq(j + 1);
          localGeoLocationVO.setLocation(localGeoLocation);
          MapImage.access$1(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).add(localGeoLocationVO);
        }
        ((Map)MapImage.2.access$0(MapImage.2.1.access$0(this$2)).getParent()).refreshViewers();
      }
      MapImage.access$2(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).setEnabled(MapImage.access$3(MapImage.2.access$0(MapImage.2.1.access$0(this$2))));
      MapImage.access$4(MapImage.2.access$0(MapImage.2.1.access$0(this$2))).setEnabled(MapImage.access$3(MapImage.2.access$0(MapImage.2.1.access$0(this$2))));
    }
    catch (SWTException localSWTException) {}
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.MapImage.2.1.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.tizen.injector.location.core.model.GeoLocationVO;
import org.tizen.injector.location.core.protocol.GeoLocation;
import org.tizen.injector.location.map.Map;
import org.tizen.injector.model.DefaultTableModel;

class MapImage$2$1
  extends Job
{
  MapImage$2$1(MapImage.2 param2, String paramString)
  {
    super(paramString);
  }
  
  protected IStatus run(IProgressMonitor paramIProgressMonitor)
  {
    IWorkbenchWindow localIWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (localIWorkbenchWindow == null)
    {
      localObject = PlatformUI.getWorkbench().getWorkbenchWindows();
      localIWorkbenchWindow = localObject[0];
    }
    Object localObject = localIWorkbenchWindow.getShell();
    ((Shell)localObject).getDisplay().asyncExec(new Runnable()
    {
      public void run()
      {
        try
        {
          int i = ((Double)MapImage.access$0(MapImage.2.access$0(this$1)).evaluate("return markersArray.length;")).intValue();
          if (MapImage.access$1(MapImage.2.access$0(this$1)).size() == i) {
            return;
          }
          int j;
          Double localDouble1;
          Double localDouble2;
          GeoLocationVO localGeoLocationVO;
          GeoLocation localGeoLocation;
          if (MapImage.access$1(MapImage.2.access$0(this$1)).size() == i - 1)
          {
            j = i - 1;
            localDouble1 = Double.valueOf(((Double)MapImage.access$0(MapImage.2.access$0(this$1)).evaluate("return markersArray[" + j + "].getPosition().lat();")).doubleValue());
            localDouble2 = Double.valueOf(((Double)MapImage.access$0(MapImage.2.access$0(this$1)).evaluate("return markersArray[" + j + "].getPosition().lng();")).doubleValue());
            localGeoLocationVO = new GeoLocationVO();
            localGeoLocation = new GeoLocation(localDouble1.doubleValue(), localDouble2.doubleValue());
            localGeoLocationVO.setSeq(i);
            localGeoLocationVO.setLocation(localGeoLocation);
            MapImage.access$1(MapImage.2.access$0(this$1)).add(localGeoLocationVO);
            ((Map)MapImage.2.access$0(this$1).getParent()).refreshViewers();
          }
          else
          {
            MapImage.access$1(MapImage.2.access$0(this$1)).clear();
            for (j = 0; j < i; j++)
            {
              localDouble1 = Double.valueOf(((Double)MapImage.access$0(MapImage.2.access$0(this$1)).evaluate("return markersArray[" + j + "].getPosition().lat();")).doubleValue());
              localDouble2 = Double.valueOf(((Double)MapImage.access$0(MapImage.2.access$0(this$1)).evaluate("return markersArray[" + j + "].getPosition().lng();")).doubleValue());
              localGeoLocationVO = new GeoLocationVO();
              localGeoLocation = new GeoLocation(localDouble1.doubleValue(), localDouble2.doubleValue());
              localGeoLocationVO.setSeq(j + 1);
              localGeoLocationVO.setLocation(localGeoLocation);
              MapImage.access$1(MapImage.2.access$0(this$1)).add(localGeoLocationVO);
            }
            ((Map)MapImage.2.access$0(this$1).getParent()).refreshViewers();
          }
          MapImage.access$2(MapImage.2.access$0(this$1)).setEnabled(MapImage.access$3(MapImage.2.access$0(this$1)));
          MapImage.access$4(MapImage.2.access$0(this$1)).setEnabled(MapImage.access$3(MapImage.2.access$0(this$1)));
        }
        catch (SWTException localSWTException) {}
      }
    });
    return Status.OK_STATUS;
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.MapImage.2.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.tizen.injector.location.core.model.GeoLocationVO;
import org.tizen.injector.location.core.protocol.GeoLocation;
import org.tizen.injector.location.map.Map;
import org.tizen.injector.model.DefaultTableModel;

class MapImage$2
  extends MouseAdapter
{
  MapImage$2(MapImage paramMapImage) {}
  
  public void mouseDoubleClick(MouseEvent paramMouseEvent)
  {
    Job local1 = new Job("Add a Marker")
    {
      protected IStatus run(IProgressMonitor paramAnonymousIProgressMonitor)
      {
        IWorkbenchWindow localIWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        if (localIWorkbenchWindow == null)
        {
          localObject = PlatformUI.getWorkbench().getWorkbenchWindows();
          localIWorkbenchWindow = localObject[0];
        }
        Object localObject = localIWorkbenchWindow.getShell();
        ((Shell)localObject).getDisplay().asyncExec(new Runnable()
        {
          public void run()
          {
            try
            {
              int i = ((Double)MapImage.access$0(this$0).evaluate("return markersArray.length;")).intValue();
              if (MapImage.access$1(this$0).size() == i) {
                return;
              }
              int j;
              Double localDouble1;
              Double localDouble2;
              GeoLocationVO localGeoLocationVO;
              GeoLocation localGeoLocation;
              if (MapImage.access$1(this$0).size() == i - 1)
              {
                j = i - 1;
                localDouble1 = Double.valueOf(((Double)MapImage.access$0(this$0).evaluate("return markersArray[" + j + "].getPosition().lat();")).doubleValue());
                localDouble2 = Double.valueOf(((Double)MapImage.access$0(this$0).evaluate("return markersArray[" + j + "].getPosition().lng();")).doubleValue());
                localGeoLocationVO = new GeoLocationVO();
                localGeoLocation = new GeoLocation(localDouble1.doubleValue(), localDouble2.doubleValue());
                localGeoLocationVO.setSeq(i);
                localGeoLocationVO.setLocation(localGeoLocation);
                MapImage.access$1(this$0).add(localGeoLocationVO);
                ((Map)this$0.getParent()).refreshViewers();
              }
              else
              {
                MapImage.access$1(this$0).clear();
                for (j = 0; j < i; j++)
                {
                  localDouble1 = Double.valueOf(((Double)MapImage.access$0(this$0).evaluate("return markersArray[" + j + "].getPosition().lat();")).doubleValue());
                  localDouble2 = Double.valueOf(((Double)MapImage.access$0(this$0).evaluate("return markersArray[" + j + "].getPosition().lng();")).doubleValue());
                  localGeoLocationVO = new GeoLocationVO();
                  localGeoLocation = new GeoLocation(localDouble1.doubleValue(), localDouble2.doubleValue());
                  localGeoLocationVO.setSeq(j + 1);
                  localGeoLocationVO.setLocation(localGeoLocation);
                  MapImage.access$1(this$0).add(localGeoLocationVO);
                }
                ((Map)this$0.getParent()).refreshViewers();
              }
              MapImage.access$2(this$0).setEnabled(MapImage.access$3(this$0));
              MapImage.access$4(this$0).setEnabled(MapImage.access$3(this$0));
            }
            catch (SWTException localSWTException) {}
          }
        });
        return Status.OK_STATUS;
      }
    };
    local1.schedule(100L);
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.MapImage.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import java.io.IOException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.tizen.injector.location.core.injector.LocationInjector;
import org.tizen.injector.model.ITableVO;

class MapImage$3$1
  extends Job
{
  MapImage$3$1(MapImage.3 param3, String paramString, ITableVO[] paramArrayOfITableVO)
  {
    super(paramString);
  }
  
  protected IStatus run(IProgressMonitor paramIProgressMonitor)
  {
    try
    {
      MapImage.access$5(MapImage.3.access$0(this$1), new LocationInjector());
      boolean bool = MapImage.access$6(MapImage.3.access$0(this$1)).inject(val$dataList, paramIProgressMonitor);
      if (!bool) {
        cancel();
      }
      if (paramIProgressMonitor.isCanceled()) {
        return Status.CANCEL_STATUS;
      }
    }
    catch (IOException localIOException)
    {
      return Status.CANCEL_STATUS;
    }
    return Status.OK_STATUS;
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.MapImage.3.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Button;
import org.tizen.injector.location.map.Map;

class MapImage$3$2
  extends JobChangeAdapter
{
  MapImage$3$2(MapImage.3 param3) {}
  
  public void scheduled(IJobChangeEvent paramIJobChangeEvent)
  {
    MapImage.access$2(MapImage.3.access$0(this$1)).setEnabled(false);
    MapImage.access$0(MapImage.3.access$0(this$1)).setEnabled(false);
    MapImage.access$9(MapImage.3.access$0(this$1)).setEnabled(true);
    MapImage.access$4(MapImage.3.access$0(this$1)).setEnabled(false);
    ((Map)MapImage.3.access$0(this$1).getParent()).setSiblingsEnabled(false);
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.MapImage.3.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import java.io.IOException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.tizen.injector.location.core.injector.LocationInjector;
import org.tizen.injector.location.map.Map;
import org.tizen.injector.model.DefaultTableModel;
import org.tizen.injector.model.ITableVO;

class MapImage$3
  extends SelectionAdapter
{
  MapImage$3(MapImage paramMapImage) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    final ITableVO[] arrayOfITableVO = MapImage.access$1(this$0).getDatas();
    MapImage.access$7(this$0, new Job("Inject Job")
    {
      protected IStatus run(IProgressMonitor paramAnonymousIProgressMonitor)
      {
        try
        {
          MapImage.access$5(this$0, new LocationInjector());
          boolean bool = MapImage.access$6(this$0).inject(arrayOfITableVO, paramAnonymousIProgressMonitor);
          if (!bool) {
            cancel();
          }
          if (paramAnonymousIProgressMonitor.isCanceled()) {
            return Status.CANCEL_STATUS;
          }
        }
        catch (IOException localIOException)
        {
          return Status.CANCEL_STATUS;
        }
        return Status.OK_STATUS;
      }
    });
    MapImage.access$8(this$0).addJobChangeListener(new JobChangeAdapter()
    {
      public void scheduled(IJobChangeEvent paramAnonymousIJobChangeEvent)
      {
        MapImage.access$2(this$0).setEnabled(false);
        MapImage.access$0(this$0).setEnabled(false);
        MapImage.access$9(this$0).setEnabled(true);
        MapImage.access$4(this$0).setEnabled(false);
        ((Map)this$0.getParent()).setSiblingsEnabled(false);
      }
    });
    MapImage.access$8(this$0).schedule();
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.MapImage.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import org.eclipse.swt.SWTException;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.tizen.injector.location.map.Map;
import org.tizen.injector.model.DefaultTableModel;

class MapImage$4
  extends SelectionAdapter
{
  MapImage$4(MapImage paramMapImage) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    if (MapImage.access$0(this$0) != null) {
      try
      {
        boolean bool = MapImage.access$0(this$0).execute("deleteMarkers()");
        DebugLog.log("[Map] Browser execute deleteMakers() : " + (bool ? "Success" : "Fail"));
        if (!bool)
        {
          bool = MapImage.access$0(this$0).setText(MapImage.access$10(this$0));
          DebugLog.log("[Map] Browser reload : " + (bool ? "Success" : "Fail"));
        }
        MapImage.access$1(this$0).clear();
        ((Map)this$0.getParent()).refreshViewers();
        MapImage.access$2(this$0).setEnabled(MapImage.access$3(this$0));
        MapImage.access$4(this$0).setEnabled(MapImage.access$3(this$0));
      }
      catch (SWTException localSWTException)
      {
        localSWTException.printStackTrace();
      }
    } else {
      DebugLog.log("Browser not created.");
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.MapImage.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.tizen.injector.location.core.injector.LocationInjector;
import org.tizen.injector.location.map.Map;

class MapImage$5
  extends SelectionAdapter
{
  MapImage$5(MapImage paramMapImage) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    MapImage.access$6(this$0).setCancel(true);
    if (MapImage.access$8(this$0) != null) {
      try
      {
        MapImage.access$8(this$0).join();
      }
      catch (InterruptedException localInterruptedException)
      {
        localInterruptedException.printStackTrace();
      }
    }
    MapImage.access$2(this$0).setEnabled(true);
    MapImage.access$0(this$0).setEnabled(true);
    MapImage.access$4(this$0).setEnabled(true);
    MapImage.access$9(this$0).setEnabled(false);
    ((Map)this$0.getParent()).setSiblingsEnabled(true);
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.map.page.MapImage.5
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.map.page;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.tizen.injector.control.TableViewContentProvider;
import org.tizen.injector.control.TableViewLabelProvider;
import org.tizen.injector.location.core.injector.LocationInjector;
import org.tizen.injector.location.core.model.GeoLocationVO;
import org.tizen.injector.location.core.protocol.GeoLocation;
import org.tizen.injector.location.map.Map;
import org.tizen.injector.model.DefaultTableModel;
import org.tizen.injector.model.ITableVO;
import org.tizen.injector.provider.AbstractInjectorItem;
import org.tizen.injector.provider.AbstractInjectorPage;
import org.tizen.injector.util.FormPageUtil;

public class MapImage
  extends AbstractInjectorPage
{
  private Browser browser;
  private String googleMapScript;
  private TableViewer viewer;
  private DefaultTableModel model;
  private Button injectButton;
  private Button resetButton;
  private Button cancelButton;
  private LocationInjector injector = null;
  private Job injectJob = null;
  private String host = null;
  private int port = -1;
  
  public MapImage(AbstractInjectorItem paramAbstractInjectorItem, String paramString, DefaultTableModel paramDefaultTableModel)
  {
    super(paramAbstractInjectorItem, paramString);
    model = paramDefaultTableModel;
    model.clear();
  }
  
  protected void createContents()
  {
    createGoogleMapScript();
    createMapComposite();
    ((Map)getParent()).addViewer(viewer);
  }
  
  protected void registerReceivers() {}
  
  public void initializeContents() {}
  
  private boolean checkProxy()
  {
    System.setProperty("java.net.useSystemProxies", "true");
    try
    {
      List localList = ProxySelector.getDefault().select(new URI("http://www.google.com/"));
      Iterator localIterator = localList.iterator();
      if (localIterator.hasNext())
      {
        Proxy localProxy = (Proxy)localIterator.next();
        DebugLog.log("proxy hostname : " + localProxy.type());
        InetSocketAddress localInetSocketAddress = (InetSocketAddress)localProxy.address();
        if (localInetSocketAddress == null)
        {
          DebugLog.log("no proxy");
          return false;
        }
        host = localInetSocketAddress.getHostName();
        port = localInetSocketAddress.getPort();
        DebugLog.log("proxy hostname : " + host);
        DebugLog.log("proxy port : " + port);
        return true;
      }
    }
    catch (URISyntaxException localURISyntaxException)
    {
      DebugLog.log("check the URI syntax.");
    }
    catch (Exception localException)
    {
      DebugLog.log("checkProxy() : " + localException.getMessage());
    }
    return false;
  }
  
  private void createGoogleMapScript()
  {
    CheckNetThread localCheckNetThread = new CheckNetThread();
    if (checkProxy())
    {
      DebugLog.log("System proxy is used.");
      localCheckNetThread.start();
      synchronized (localCheckNetThread)
      {
        try
        {
          localCheckNetThread.wait(5000L);
        }
        catch (InterruptedException localInterruptedException1)
        {
          localInterruptedException1.printStackTrace();
        }
      }
      if (!localCheckNetThread.isError())
      {
        if (host != null)
        {
          System.setProperty("network.proxy_host", host);
          if (port != -1) {
            System.setProperty("network.proxy_port", port);
          }
        }
      }
      else
      {
        DebugLog.log("Failure to access the site using system proxy.");
        googleMapScript = localCheckNetThread.getErrorMsg();
      }
    }
    else
    {
      System.setProperty("java.net.useSystemProxies", "false");
      DebugLog.log("System proxy is not used.");
      localCheckNetThread.start();
      synchronized (localCheckNetThread)
      {
        try
        {
          localCheckNetThread.wait(5000L);
        }
        catch (InterruptedException localInterruptedException2)
        {
          localInterruptedException2.printStackTrace();
        }
      }
      if (localCheckNetThread.isError())
      {
        DebugLog.log("Failure to access the site.");
        googleMapScript = localCheckNetThread.getErrorMsg();
        return;
      }
    }
    googleMapScript = "<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" /><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/><style type=\"text/css\">html { height: 100% }body { height: 100%; margin: 0px; padding: 0px }#map_canvas { height: 100% }</style><script type=\"text/javascript\" src=\"http://maps.google.com/maps/api/js?sensor=false\"></script><script type=\"text/javascript\">var map;var markersArray = [];function initialize() {var latlng = new google.maps.LatLng(37.259, 127.055);var myOptions = {zoom: 16,center: latlng,disableDoubleClickZoom: true,keyboardShortcuts: false,mapTypeId: google.maps.MapTypeId.ROADMAP};map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);google.maps.event.addListener(map, 'dblclick', function(event) {placeMarker(event.latLng);});}function placeMarker(location) {var clickedLocation = new google.maps.LatLng(location);var marker = new google.maps.Marker({position: location,map: map});markersArray.push(marker);}function deleteMarkers() {if (markersArray) {for (i in markersArray) {markersArray[i].setMap(null);}markersArray.length = 0;}}</script></head><body oncontextmenu='return false' onload=\"initialize();\"><div id=\"map_canvas\" style=\"width:100%; height:100%\"></div></body></html>";
  }
  
  private Control createMapComposite()
  {
    Composite localComposite1 = formUtil.createComposite(parent, 1);
    browser = formUtil.createBrowser(localComposite1);
    browser.setJavascriptEnabled(true);
    browser.addProgressListener(new ProgressListener()
    {
      public void completed(ProgressEvent paramAnonymousProgressEvent)
      {
        DebugLog.log("[Map] Map Loading: Compelete");
      }
      
      public void changed(ProgressEvent paramAnonymousProgressEvent) {}
    });
    browser.setText(googleMapScript);
    browser.addMouseListener(new MouseAdapter()
    {
      public void mouseDoubleClick(MouseEvent paramAnonymousMouseEvent)
      {
        Job local1 = new Job("Add a Marker")
        {
          protected IStatus run(IProgressMonitor paramAnonymous2IProgressMonitor)
          {
            IWorkbenchWindow localIWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            if (localIWorkbenchWindow == null)
            {
              localObject = PlatformUI.getWorkbench().getWorkbenchWindows();
              localIWorkbenchWindow = localObject[0];
            }
            Object localObject = localIWorkbenchWindow.getShell();
            ((Shell)localObject).getDisplay().asyncExec(new Runnable()
            {
              public void run()
              {
                try
                {
                  int i = ((Double)browser.evaluate("return markersArray.length;")).intValue();
                  if (model.size() == i) {
                    return;
                  }
                  int j;
                  Double localDouble1;
                  Double localDouble2;
                  GeoLocationVO localGeoLocationVO;
                  GeoLocation localGeoLocation;
                  if (model.size() == i - 1)
                  {
                    j = i - 1;
                    localDouble1 = Double.valueOf(((Double)browser.evaluate("return markersArray[" + j + "].getPosition().lat();")).doubleValue());
                    localDouble2 = Double.valueOf(((Double)browser.evaluate("return markersArray[" + j + "].getPosition().lng();")).doubleValue());
                    localGeoLocationVO = new GeoLocationVO();
                    localGeoLocation = new GeoLocation(localDouble1.doubleValue(), localDouble2.doubleValue());
                    localGeoLocationVO.setSeq(i);
                    localGeoLocationVO.setLocation(localGeoLocation);
                    model.add(localGeoLocationVO);
                    ((Map)getParent()).refreshViewers();
                  }
                  else
                  {
                    model.clear();
                    for (j = 0; j < i; j++)
                    {
                      localDouble1 = Double.valueOf(((Double)browser.evaluate("return markersArray[" + j + "].getPosition().lat();")).doubleValue());
                      localDouble2 = Double.valueOf(((Double)browser.evaluate("return markersArray[" + j + "].getPosition().lng();")).doubleValue());
                      localGeoLocationVO = new GeoLocationVO();
                      localGeoLocation = new GeoLocation(localDouble1.doubleValue(), localDouble2.doubleValue());
                      localGeoLocationVO.setSeq(j + 1);
                      localGeoLocationVO.setLocation(localGeoLocation);
                      model.add(localGeoLocationVO);
                    }
                    ((Map)getParent()).refreshViewers();
                  }
                  injectButton.setEnabled(MapImage.this.validate());
                  resetButton.setEnabled(MapImage.this.validate());
                }
                catch (SWTException localSWTException) {}
              }
            });
            return Status.OK_STATUS;
          }
        };
        local1.schedule(100L);
      }
    });
    Composite localComposite2 = formUtil.createSection(localComposite1, Messages.MapImage_62);
    String[] arrayOfString = { Messages.MapImage_0, Messages.MapImage_1, Messages.MapImage_2 };
    viewer = formUtil.createTableViewer(localComposite2, arrayOfString, 1, 2816);
    viewer.setContentProvider(new TableViewContentProvider());
    viewer.setLabelProvider(new TableViewLabelProvider(viewer));
    viewer.setInput(model);
    Composite localComposite3 = formUtil.createComposite(localComposite1, 3);
    injectButton = formUtil.createButton(localComposite3, Messages.MapImage_66, 8);
    injectButton.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        final ITableVO[] arrayOfITableVO = model.getDatas();
        injectJob = new Job("Inject Job")
        {
          protected IStatus run(IProgressMonitor paramAnonymous2IProgressMonitor)
          {
            try
            {
              injector = new LocationInjector();
              boolean bool = injector.inject(arrayOfITableVO, paramAnonymous2IProgressMonitor);
              if (!bool) {
                cancel();
              }
              if (paramAnonymous2IProgressMonitor.isCanceled()) {
                return Status.CANCEL_STATUS;
              }
            }
            catch (IOException localIOException)
            {
              return Status.CANCEL_STATUS;
            }
            return Status.OK_STATUS;
          }
        };
        injectJob.addJobChangeListener(new JobChangeAdapter()
        {
          public void scheduled(IJobChangeEvent paramAnonymous2IJobChangeEvent)
          {
            injectButton.setEnabled(false);
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd