Package javax.comm

Examples of javax.comm.ParallelPort


     *
     *
     * @see
     */
    protected void showValue() {
  ParallelPort port = this.owner.port;

  if (this.owner.open) {

      /*
       * Get the port mode
View Full Code Here


     * @param ev
     *
     * @see
     */
    public void itemStateChanged(ItemEvent ev) {
  ParallelPort port;
  String       sel = (String) ev.getItem();
  int       value = 0;

  if (sel.equals("Any")) {
      value = ParallelPort.LPT_MODE_ANY;
  } else if (sel.equals("ECP")) {
      value = ParallelPort.LPT_MODE_ECP;
  } else if (sel.equals("EPP")) {
      value = ParallelPort.LPT_MODE_EPP;
  } else if (sel.equals("NIBBLE")) {
      value = ParallelPort.LPT_MODE_NIBBLE;
  } else if (sel.equals("PS2")) {
      value = ParallelPort.LPT_MODE_PS2;
  } else if (sel.equals("SPP")) {
      value = ParallelPort.LPT_MODE_SPP;
  } else {
      this.showValue();

      return;
  }

  port = this.owner.port;

  if (port != null) {

      /*
       * Set the mode.
       */
      try {
    port.setMode(value);
      } catch (UnsupportedCommOperationException e) {
    System.out.println("Cannot set mode to " + sel + " for port "
           + port.getName());
      }
  }

  this.owner.showValues();
    }
View Full Code Here

     *
     *
     * @see
     */
    private void cleanup() {
  ParallelPort p;

  while (portNum > 0) {
      portNum--;
      panelNum--;

      /*
       * Close the port
       */
      p = portDisp[portNum].getPort();

      if (p != null) {
    System.out.println("Closing port " + portNum + " ("
           + p.getName() + ")");
    portDisp[portNum].closePBBPort();
      }
  }
    }
View Full Code Here

    }
  }

  public void itemStateChanged(ItemEvent  ev)
  {
    ParallelPort  port;
    String     sel = (String) ev.getItem();
    int    value = 0;

    if (sel.equals("Any"))
    {
      value = ParallelPort.LPT_MODE_ANY;
    }

    else if (sel.equals("ECP"))
    {
      value = ParallelPort.LPT_MODE_ECP;
    }

    else if (sel.equals("EPP"))
    {
      value = ParallelPort.LPT_MODE_EPP;
    }

    else if (sel.equals("NIBBLE"))
    {
      value = ParallelPort.LPT_MODE_NIBBLE;
    }

    else if (sel.equals("PS2"))
    {
      value = ParallelPort.LPT_MODE_PS2;
    }

    else if (sel.equals("SPP"))
    {
      value = ParallelPort.LPT_MODE_SPP;
    }

    else
    {
      this.showValue();
      return;
    }


    port = this.owner.port;

    if (port != null)
    {
      /*
       *  Set the mode.
       */

      try
      {
        port.setMode(value);
      }

      catch (UnsupportedCommOperationException e)
      {
        System.out.println("Cannot set mode to "
               + sel + " for port "
               + port.getName());
      }

    }

    this.owner.showValues();
View Full Code Here

    System.exit(0);
  }

  private void cleanup()
  {
    ParallelPort  p;

    while (portNum > 0)
    {
      portNum--;
      panelNum--;

      /*
       *  Close the port
       */

      p = portDisp[portNum].getPort();

      if (p != null)
      {
        System.out.println("Closing port "
               + portNum
               + " ("
               + p.getName()
               + ")");

        portDisp[portNum].closePBBPort();
      }
    }
View Full Code Here

TOP

Related Classes of javax.comm.ParallelPort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.