@Override
  public void init(IEditorSite pSite, IEditorInput pInput) throws PartInitException {
    setSite(pSite);
    setInput(pInput);

    // get selected object to show in editor
    Object tSelection = null;
    if (pInput instanceof EditorInput) {
      tSelection = ((EditorInput) pInput).getObj();
    }

    Logging.log(
        this, "init relay client for " + tSelection + " (class=" + tSelection.getClass() + ")");

    mRelayClient = (RelayClient) pInput.getAdapter(RelayClient.class);
    if (mRelayClient == null) {
      throw new PartInitException(pInput + " does not provide a valid input for " + this);
    }

    // add as observer for corresponding stream client application
    mRelayClient.addObserver(this);

    // update title of editor
    setPartName(mRelayClient.toString());
  }
Example #2
0
 public Logger getLogger() {
   if (simulation != null) {
     return simulation.getLogger();
   } else {
     return Logging.getInstance();
   }
 }
  @Override
  public Object getAdapter(
      Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
    Logging.trace(this, "adapting " + adaptableObject + " to type " + adapterType);

    if (adapterType == IContentOutlinePage.class) {
      return new GraphContentOutlinePage(adaptableObject);
    }

    return null;
  }
  @Override
  public void createPartControl(Composite pParent) {
    Logging.log(this, "Creating relay client GUI for " + mRelayClient.toString());

    EditorRowComposite tGrp = new EditorRowComposite(pParent, SWT.SHADOW_NONE);

    mLbBytes = tGrp.createRow("Data size:", " -1 bytes");
    mLbPackets = tGrp.createRow("Data count:", "-1 packets");
    mLbFoGSource = tGrp.createRow("FoG source:", "N/A");
    mLbIpDestination = tGrp.createRow("IP destination:", "N/A");

    mDisplay.timerExec(1000, mRepaintTimer);
  }
  @Override
  public void dispose() {
    Logging.log(this, "Destroyed relay client");

    if (mRelayClient != null) {
      // delete as observer for corresponding stream client application
      mRelayClient.deleteObserver(this);

      // terminate application
      mRelayClient.exit();
    }

    super.dispose();
  }
  public ConnectionEndPointUDPAudioProxy(
      Logger pLogger, String pDestName, int pDestPort, int pRcvPort)
      throws UnknownHostException, IOException {
    super(false, pLogger, null);

    long tStartTime;
    tStartTime = System.currentTimeMillis();
    mRcvSocket = new DatagramSocket(pRcvPort);

    Logging.log(
        this,
        "Created CEP audio proxy with name \""
            + pDestName
            + "\" for port: "
            + pRcvPort
            + " in "
            + (System.currentTimeMillis() - tStartTime)
            + " msec");
  }
 public RelayClientEditor() {
   Logging.log(this, "Created relay client");
   mDisplay = Display.getCurrent();
   mShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
 }