Examples of Equipamento


Examples of br.com.procempa.modus.entity.Equipamento

          visita.setTelecentro(UserContext.getInstance()
              .getTelecentro());

          // Se n�o for lista de espera, seta o equipamento,
          // sen�o, seta null no equipamento
          Equipamento eq = (Equipamento) equipamentoCombo
              .getSelectedItem();
          if (eq != null) {
            if (eq.getId() != -1) {
              visita.setEquipamento(eq);
            } else {
              visita.setEquipamento(null);
            }
          }
View Full Code Here

Examples of br.com.procempa.modus.entity.Equipamento

    public void setValueAt(Object aValue, int row, int column) {
      if (column == COLUMN_EQUIPAMENTO) {
        try {
          Visita visita = (Visita) getList().get(row);

          Equipamento eq = EquipamentoDataServices
              .getRotulo((String) aValue);
          visita.setEquipamento(eq);

          visita = (Visita) VisitaDataServices
              .persist((Visita) getList().get(row));
View Full Code Here

Examples of br.com.procempa.modus.entity.Equipamento

        }
      }
    }

    void sendWarm(Visita visita, final String command) {
      final Equipamento eq = EquipamentoDataServices
          .getEquipamento(visita.getEquipamento().getId());

      if (eq != null && eq.isOpened()) {
        new Thread(new Runnable() {
          public void run() {
            try {
              SocketUtils.sendCommand(eq.getIpAddress(), eq
                  .getPort(), command);

            } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
View Full Code Here

Examples of br.com.procempa.modus.entity.Equipamento

   * @param id
   *            identificador do equipamento
   * @return inst�ncia de Equipamento
   */
  public static Equipamento getEquipamento(Long id) {
    Equipamento eq = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      eq = (Equipamento) pa.find(Equipamento.class, id);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of br.com.procempa.modus.entity.Equipamento

   * @throws Exception
   */
  public static void remove(Long id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Equipamento eq = (Equipamento) pa.find(Equipamento.class, id);
      if (!EquipamentoDataServices.temVisita(eq)){
        pa.remove(eq);
      }
    } catch (Exception e) {
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
View Full Code Here

Examples of br.com.procempa.modus.entity.Equipamento

    Action actionStation = new AbstractAction("", IconFactory
        .createEquipamentoFree16()) {
      private static final long serialVersionUID = 4680946165447301272L;

      public void actionPerformed(ActionEvent e) {
        Equipamento eq = (Equipamento) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        // Atualiza equipamento
        eq = EquipamentoDataServices.getEquipamento(eq.getId());
        if (eq.isOpened()) {
          EquipamentoDataServices.closeStation(eq);
        } else if (eq.isClosed()) {
          EquipamentoDataServices.openStation(eq);
        }
        refresh();
        stationButton.setEnabled(false);
        downMonitorButton.setEnabled(false);       
      }
    };

    stationButton.setAction(actionStation);
    stationButton.setToolTipText("Libera/bloqueia equipamento");
    addToolBarButton(stationButton);
    stationButton.setEnabled(false);

    Action actionMonitorDown = new AbstractAction("", IconFactory
        .createDown16()) {

      private static final long serialVersionUID = -489877560767758884L;

      public void actionPerformed(ActionEvent e) {
        Equipamento eq = (Equipamento) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        // Atualiza equipamento
        eq = EquipamentoDataServices.getEquipamento(eq.getId());
        if (eq.isControled()) {
          EquipamentoDataServices.downMonitor(eq);
        }
        refresh();
        stationButton.setEnabled(false);
        downMonitorButton.setEnabled(false);
View Full Code Here

Examples of br.com.procempa.modus.entity.Equipamento

    MouseListener tableMouseListener = new TableMouseListener(this) {

      public void mouseClicked(MouseEvent e) {
        super.mouseClicked(e);
        if (panel.getTable().getSelectedRowCount() == 1) {
          Equipamento eq = (Equipamento) getTable().getValueAt(
              getTable().getSelectedRow(), -1);
          stationButton.setEnabled(true);
          downMonitorButton.setEnabled(true);
          if (eq.isOpened()) {
            stationButton.setIcon(IconFactory
                .createEquipamentoBlock16());
            stationButton.setToolTipText("Bloqueia Equipamento");

          } else if (eq.isClosed() || eq.isReady()) {
            stationButton.setIcon(IconFactory
                .createEquipamentoFree16());
            stationButton.setToolTipText("Libera Equipamento");
          } else {
            stationButton.setEnabled(false);
View Full Code Here

Examples of br.com.procempa.modus.entity.Equipamento

        if (null == telecentro.getUmUsuarioPorEquipamento() || telecentro.getUmUsuarioPorEquipamento()) {
          items = EquipamentoDataServices.getLivres(telecentro);
        } else {
          items = EquipamentoDataServices.getList(telecentro);
        }
        Equipamento e = new Equipamento();
        e.setRotulo("Lista de Espera");
        e.setId(new Long(-1));
        items.add(e);       
      } else {
        items = EquipamentoDataServices.getList(telecentro);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of br.com.procempa.modus.entity.Equipamento

    Action actionStation = new AbstractAction("", IconFactory
        .createEquipamentoFree16()) {
      private static final long serialVersionUID = 4680946165447301272L;

      public void actionPerformed(ActionEvent e) {
        Equipamento eq = (Equipamento) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        // Atualiza equipamento
        eq = EquipamentoDataServices.getEquipamento(eq.getId());
        if (eq.isOpened()) {
          EquipamentoDataServices.closeStation(eq);
        } else if (eq.isClosed()) {
          EquipamentoDataServices.openStation(eq);
        }
        refresh();
        stationButton.setEnabled(false);
        downMonitorButton.setEnabled(false);       
      }
    };

    stationButton.setAction(actionStation);
    stationButton.setToolTipText("Libera/bloqueia equipamento");
    addToolBarButton(stationButton);
    stationButton.setEnabled(false);

    Action actionMonitorDown = new AbstractAction("", IconFactory
        .createDown16()) {

      private static final long serialVersionUID = -489877560767758884L;

      public void actionPerformed(ActionEvent e) {
        Equipamento eq = (Equipamento) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        // Atualiza equipamento
        eq = EquipamentoDataServices.getEquipamento(eq.getId());
        if (eq.isControled()) {
          EquipamentoDataServices.downMonitor(eq);
        }
        refresh();
        stationButton.setEnabled(false);
        downMonitorButton.setEnabled(false);
View Full Code Here

Examples of br.com.procempa.modus.entity.Equipamento

    MouseListener tableMouseListener = new TableMouseListener(this) {

      public void mouseClicked(MouseEvent e) {
        super.mouseClicked(e);
        if (panel.getTable().getSelectedRowCount() == 1) {
          Equipamento eq = (Equipamento) getTable().getValueAt(
              getTable().getSelectedRow(), -1);
          stationButton.setEnabled(true);
          downMonitorButton.setEnabled(true);
          if (eq.isOpened()) {
            stationButton.setIcon(IconFactory
                .createEquipamentoBlock16());
            stationButton.setToolTipText("Bloqueia Equipamento");

          } else if (eq.isClosed() || eq.isReady()) {
            stationButton.setIcon(IconFactory
                .createEquipamentoFree16());
            stationButton.setToolTipText("Libera Equipamento");
          } else {
            stationButton.setEnabled(false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.