OntPotsCodecProfileMenu.java :  » App » learnandroid » com » lgnortel » profile » ont » manager » menu » pots » Android Open Source

Android Open Source » App » learnandroid 
learnandroid » com » lgnortel » profile » ont » manager » menu » pots » OntPotsCodecProfileMenu.java

package com.lgnortel.profile.ont.manager.menu.pots;

import java.awt.Component;

import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPanel;

import com.lgnortel.equipment.menu.MenuAbs;
import com.lgnortel.equipment.menu.UNIT;
import com.lgnortel.platform.db.DBDataDesc;
import com.lgnortel.profile.common.ProfileChildNodeIF;
import com.lgnortel.profile.common.ProfileComplexIF;
import com.lgnortel.profile.common.ProfileNodeMenu;
import com.lgnortel.profile.common.ProfileTotalGetComplexIF;
import com.lgnortel.profile.ont.manager.frame.ONTPotsProfileConfigView;
import com.lgnortel.profile.ont.manager.view.pots.CmdTotalCodecProfileView;
import com.lgnortel.profile.ont.manager.view.pots.CodecProfileComplexView;
import com.lgnortel.r4.r4equipment.common.TotalViewInterface;
import com.lgnortel.r4.r4equipment.common.ViewNameInterface;

/**
 * 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: OntQoSMenu.java<br>
 * Description: Ont Qos Management menu.<br>
 * Copyright: Copyright(c) 2009 LG-NORTEL ALL Rights Reserved<br>
 * Company: LG-Nortel<br>
 * 
 * @author Jonghwa, Lee
 * @version 0.1
 * @created 2009. 4. 14.
 * @modified 2009. 4. 14.
 * @product EFA R4.0 EMS
 * @sw_block Client Block
 */
public class OntPotsCodecProfileMenu extends MenuAbs implements ProfileChildNodeIF{
  public OntPotsCodecProfileMenu() {
  }

  private ProfileNodeMenu profileMenu;
  
  /**
   * Title: QosPolicerMenuItem.java<br>
   * Description: Classification submenu in QoS Menu<br>
   * Copyright: Copyright(c) 2009 LG-NORTEL ALL Rights Reserved<br>
   * Company: LG-Nortel<br>
   * 
   * @author SangHee, Kim
   * @version 0.1
   * @created 2009. 5. 13.
   * @modified 2009. 5. 13.
   * @product EFA R4.0 EMS
   * @sw_block client block
   */
  class OntPotsCodecProfileMenuItem extends JMenuItem implements ViewNameInterface{


    /**
     * 
     */
    private static final long serialVersionUID = 3032609358389145222L;

    public OntPotsCodecProfileMenuItem(String profile) {
      super(profile);
    }

    @Override
    public Class<?> getViewName() {
      return CmdTotalCodecProfileView.class;
    }
  }
  
  /* (non-Javadoc)
   * @see com.lgnortel.equipment.menu.MenuIF#getMenu(int, int, int)
   */
  @Override
  public JMenu getMenu(UNIT unit) {
    menu = new JMenu(DBDataDesc.CODEC_PROFILE_MO);
    return menu;
  }
  
  public JMenu getMenu(UNIT unit, String[] profile) {
    profileMenu = new ProfileNodeMenu(DBDataDesc.CODEC_PROFILE_MO, this);
    switch (unit) {
    case DEFAULT:
    case SW:
      for(int i=0; i<profile.length; i++) {
        profileMenu.add(new OntPotsCodecProfileMenuItem(profile[i]));
      }
      break;
    
    case PI:
      break;
      
    case ONT:
      break;
      
    case ONU:
    case MC:
    case NI:
    default:
      menu = null;
      break;
    }
    return profileMenu;
  }

  @Override
  public void getProfileChildNode(String profileName,ProfileComplexIF emptyComplex,int viewId) {
//    CodecProfileComplexView qosPolicerComplexView=   new CodecProfileComplexView(profileName);
//    qosPolicerComplexView.setViewId(MainMenuBar.ONT_POTS_PROFILE_MANAGER_VIEWID);
//    qosPolicerComplexView.add(profileName);
    
    TotalViewInterface totalView = new CmdTotalCodecProfileView(profileName);
    totalView.setViewId(viewId);
    ProfileComplexIF complexIf=((ProfileTotalGetComplexIF)totalView).getComplex();
    ((CodecProfileComplexView)complexIf).add(profileName);
    
    Component con = (JPanel)emptyComplex;
    while(con.getParent() != null){
      con = con.getParent();
      if (con instanceof ONTPotsProfileConfigView){
        break;
      }
    }
    ((ONTPotsProfileConfigView)con).changeMenu(totalView);
  }

  @Override
  public JMenu getProfileChildNodeList() {
    return new OntPotsProfileMenuList().getMenuCodecProfile(UNIT.DEFAULT);
  }
}
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.