CmdTotalDhcpView.java :  » App » learnandroid » com » lgnortel » r4 » r4equipment » management » olt » accessmanagement » dhcp » Android Open Source

Android Open Source » App » learnandroid 
learnandroid » com » lgnortel » r4 » r4equipment » management » olt » accessmanagement » dhcp » CmdTotalDhcpView.java
package com.lgnortel.r4.r4equipment.management.olt.accessmanagement.dhcp;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JPanel;

import com.lgnortel.r4.r4equipment.common.TotalViewInterface;

/**
 * Copyright (c) 2008 LG-Nortel, Inc. All Rights Reserved.
 * 
 * CONFIDENTIALITY AND LIMITED USE: This software, including any software of <br>
 * third parties embodied herein, contains code, information, data and concepts <br>
 * which are confidential and/or proprietary to LG-Nortel and such third <br>
 * parties. This software is licensed for use solely in accordance with the <br>
 * terms and conditions of the applicable license agreement with LG-Nortel or <br>
 * its authorized distributor, and not for any other use or purpose. No <br>
 * redistribution of this software by any party is permitted. <br>
 * 
 * Title: CmdTotalDhcpView.java<br>
 * Description: CmdTotalDhcpView in the DHCP function of DHCP submenu in Access Management Menu in Equipment View <br>
 * <br>
 * Copyright: Copyright(c) 2008 LG-NORTEL ALL Rights Reserved<br>
 * Company: LG-Nortel<br>
 * 
 * @author kim sang hee
 * @version 0.1
 * @created 2009. 1. 22.
 * @modified 2009. 1. 22.
 * @product EFA4.0 EMS
 * @sw_block client block
 */

public class CmdTotalDhcpView extends JPanel implements TotalViewInterface {
  /**
   * 
   */
  private static final long serialVersionUID = 7613363494390402666L;

  int viewId;
  int neId;
  
  private DhcpComplexView pnlDhcp;
  
  /**
   * the constructor.
   * 
   * @param _neId
   *            the node id.
   * @param _shelfId
   *            the shelf id.
   */

  public CmdTotalDhcpView(int _neId) {
    try {
      this.neId = _neId;
      jbInit();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  /**
   * the constructor
   * 
   * @param neId
   *            :node id
   * @param shelfId
   *            :shelf id
   * @param slotId
   *            :slot id
   * @param portId
   *            :port
   */

  public CmdTotalDhcpView(int neId, int shelfId, int slotId, int portId) {
    this(neId);
  }

  /**
   * Request Initial data
   */

  public void requestInitialCmd() {
    pnlDhcp.get();
  }

  /**
   * set the view id.
   * 
   * @param lViewId
   *            the view id.
   */

  public void setViewId(int lViewId) {
    this.viewId = lViewId;
    pnlDhcp.setViewId(lViewId);
  }

  /**
   * get the view id.
   * 
   * @return a int value for view id.
   */

  public int getViewId() {
    return viewId;
  }

  private void jbInit() throws Exception {
    pnlDhcp = new DhcpComplexView(neId, "DHCP");
  
    
    this.setLayout(new GridBagLayout());
    this.add(pnlDhcp, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0));
  }

  /**
   * the response method.
   * 
   * @param viewId
   *            the view id.
   * @param userId
   *            the user id.
   * @param nodeId
   *            the node id.
   * @param cmdCode
   *            the command code.
   * @param data
   *            the Object array for the data.
   * @param result
   *            the int value about the result.
   * @return the true if call the method.
   */

  public boolean cmdResponse(int viewId, int userId, int nodeId, int cmdCode, Object[] data, int result, String errMessage) {
    if (null == data || 0 == data.length) {

    } else {
      pnlDhcp.cmdResponse(viewId, userId, nodeId, cmdCode, data, result, errMessage);
    }
    return true;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.