org.tizen.injector.sensor.proximity_1.0.0.201310291329

16:50:08.503 INFO  jd.cli.Main - Decompiling org.tizen.injector.sensor.proximity_1.0.0.201310291329.jar
package org.tizen.injector.sensor.proximity;

import org.tizen.injector.provider.AbstractInjectorItem;
import org.tizen.injector.sensor.proximity.page.ProximityPage;

public class Proximity
  extends AbstractInjectorItem
{
  protected void addPages()
  {
    addPage(new ProximityPage(this, "Proximity"));
  }
}

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

public class ProximityConstants
{
  public static final String ON = "ON";
  public static final String OFF = "OFF";
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class ProximityPage$1
  extends SelectionAdapter
{
  ProximityPage$1(ProximityPage paramProximityPage) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    ProximityPage.access$0(this$0, 0);
    super.widgetSelected(paramSelectionEvent);
    this$0.sendMessage(ProximityPage.access$1(this$0));
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class ProximityPage$2
  extends SelectionAdapter
{
  ProximityPage$2(ProximityPage paramProximityPage) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    ProximityPage.access$0(this$0, 8);
    super.widgetSelected(paramSelectionEvent);
    this$0.sendMessage(ProximityPage.access$1(this$0));
  }
}

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

import java.io.IOException;
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.tizen.common.connection.ConnectionPlugin;
import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
import org.tizen.injector.protocol.sensor.TestSensorMessage;
import org.tizen.injector.provider.AbstractInjectorItem;
import org.tizen.injector.provider.AbstractInjectorPage;
import org.tizen.injector.socket.TelephonySocket;
import org.tizen.injector.util.FormPageUtil;
import org.tizen.injector.view.InjectorView;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.service.FileEntry;

public class ProximityPage
  extends AbstractInjectorPage
  implements ConnectionPlugin.ISelectionListener
{
  private final String sensorNumber = "2\n";
  private IDevice currentDevice = null;
  private Button[] radioButton;
  private int proximity_status;
  
  public ProximityPage(AbstractInjectorItem paramAbstractInjectorItem, String paramString)
  {
    super(paramAbstractInjectorItem, paramString);
  }
  
  protected void createContents()
  {
    InjectorView.getDefault().addSelectionListener(this);
    currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
    Composite localComposite = formUtil.createComposite(parent, 2);
    radioButton = new Button[2];
    radioButton[0] = formUtil.createButton(localComposite, "ON", 16);
    radioButton[1] = formUtil.createButton(localComposite, "OFF", 16);
    radioButton[1].setSelection(true);
    proximity_status = 8;
    radioButton[0].addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        proximity_status = 0;
        super.widgetSelected(paramAnonymousSelectionEvent);
        sendMessage(proximity_status);
      }
    });
    radioButton[1].addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        proximity_status = 8;
        super.widgetSelected(paramAnonymousSelectionEvent);
        sendMessage(proximity_status);
      }
    });
    boolean bool = checkDeviceConnectedAlready();
    if (bool) {
      connect();
    }
  }
  
  private boolean checkDeviceConnectedAlready()
  {
    return currentDevice != null;
  }
  
  protected void registerReceivers() {}
  
  public void sendMessage(int paramInt)
  {
    TestSensorMessage localTestSensorMessage = new TestSensorMessage(paramInt);
    try
    {
      injectorSocket.sendSensor("2\n" + localTestSensorMessage.getMessage());
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  public void connect()
  {
    currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
    sendMessage(proximity_status);
  }
  
  public void disconnect() {}
  
  protected void finalize()
    throws Throwable
  {
    InjectorView.getDefault().removeSelectionListener(this);
    super.finalize();
  }
  
  public void selectionChanged(FileEntry paramFileEntry)
  {
    if (paramFileEntry == null)
    {
      disconnect();
    }
    else
    {
      String str = paramFileEntry.getDevice().getSerialNumber();
      if (currentDevice == null)
      {
        if (str != null) {
          connect();
        }
      }
      else if (currentDevice.getSerialNumber() != str)
      {
        disconnect();
        connect();
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.sensor.proximity.page.ProximityPage
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

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