Ejemplo n.º 1
0
  public void init() {

    // <Begin_init>
    if (initialized == true) return;
    this.setSize(getPreferredSize().width + 682, getPreferredSize().height + 419);
    setTitle(NmsClientUtil.GetString("Router Display Panel"));
    Container container = getContentPane();
    container.setLayout(new BorderLayout());
    try {
      initVariables();
      setUpGUI(container);
      setUpProperties();
      setUpConnections();
    } catch (Exception ex) {
      showStatus(NmsClientUtil.GetString("Error in init method"), ex);
    }
    // let us set the initialzed variable to true so
    // we dont initialize again even if init is called
    initialized = true;
    setUpMenus();
    setUpToolBar();

    // <End_init>
    setIconImage(NmsClientUtil.getFrameIcon());
  }
Ejemplo n.º 2
0
    public void mousePressed(java.awt.event.MouseEvent arg0) {
      JPanel4.showCard("inter"); // No Internationalisation

      ((com.adventnet.nms.examples.routermap.IFDetails) JPanel4.getCard("inter"))
          .setValues((Properties) routerobject.elementAt(6)); // No Internationalisation
      JLabel1.setText(NmsClientUtil.GetString("Interface Details"));
    }
Ejemplo n.º 3
0
 public void actionPerformed(java.awt.event.ActionEvent arg0) {
   JPanel4.showCard("router"); // No Internationalisation
   Properties prop = (Properties) routerobject.elementAt(0);
   ((com.adventnet.nms.examples.routermap.RouterDetails) JPanel4.getCard("router"))
       .setValues((Properties) routerobject.elementAt(0)); // No Internationalisation
   JLabel1.setText(
       NmsClientUtil.GetString("Router details  :  ")
           + prop.getProperty("name")); // No Internationalisation
 }
Ejemplo n.º 4
0
 public void showStatus(String message, Exception ex) {
   // <Begin_showStatus_String_Exception>
   System.out.println(NmsClientUtil.GetString("Internal Error :") + message);
   ex.printStackTrace();
   // <End_showStatus_String_Exception>
 }
Ejemplo n.º 5
0
 public void showStatus(String message) {
   // <Begin_showStatus_String>
   System.out.println(NmsClientUtil.GetString("Internal Error :") + message);
   // <End_showStatus_String>
 }
Ejemplo n.º 6
0
  void refresh() {

    JPanel4.showCard("router"); // No Internationalisation
    if (routerobject != null) {
      ((com.adventnet.nms.examples.routermap.RouterDetails) JPanel4.getCard("router"))
          .setValues((Properties) routerobject.elementAt(0)); // No Internationalisation
      Properties prop = (Properties) routerobject.elementAt(0);
      RouterBtn.setBackground(
          SeverityInfo.getInstance()
              .getColor(Integer.parseInt(prop.getProperty("status")))); // No Internationalisation
      RouterBtn.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
      JLabel1.setText(
          NmsClientUtil.GetString("Router details  :  ")
              + prop.getProperty("name")); // No Internationalisation
    }
    if (routerobject.size() >= 2) {
      one.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(1);
      one.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      one.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
    if (routerobject.size() >= 3) {
      two.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(2);
      two.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      two.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
    if (routerobject.size() >= 4) {
      three.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(3);
      three.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      three.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
    if (routerobject.size() >= 5) {
      four.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(4);
      four.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      four.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
    if (routerobject.size() >= 6) {
      five.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(5);
      five.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      five.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
    if (routerobject.size() >= 7) {
      six.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(6);
      six.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      six.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
    if (routerobject.size() >= 8) {
      seven.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(7);
      seven.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      seven.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
    if (routerobject.size() >= 9) {
      eight.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(8);
      eight.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      eight.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
    if (routerobject.size() >= 10) {
      nine.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(9);
      nine.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      nine.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
    if (routerobject.size() >= 11) {
      ten.setVisible(true);
      Properties prop = (Properties) routerobject.elementAt(10);
      ten.setValues(
          SeverityInfo.getInstance().getColor(Integer.parseInt(prop.getProperty("status"))),
          prop.getProperty("ipAddress")); // No Internationalisation
      ten.setToolTipText(prop.getProperty("ipAddress")); // No Internationalisation
    }
  }
Ejemplo n.º 7
0
  public void setUpProperties() throws Exception {

    // <Begin_setUpProperties>

    try {
      Top.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(NmsClientUtil.GetString("Exception while setting properties for bean ") + Top, ex);
    }
    setResizable(false);
    try {
      JPanel1.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + JPanel1, ex);
    }

    try {
      RouterBtn.setFocusPainted(false);

      RouterBtn.setIcon(
          NmsClientUtil.getImageIcon(
              applet.getDocumentBase() + "../images/router_new1.png")); // No Internationalisation
      RouterBtn.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + RouterBtn, ex);
    }

    try {
      eight.setOpaque(true);
      eight.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + eight, ex);
    }
    eight.setVisible(false);
    try {
      one.setOpaque(true);
      one.setToolTipText(""); // No Internationalisation
      one.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(NmsClientUtil.GetString("Exception while setting properties for bean ") + one, ex);
    }
    one.setVisible(false);
    try {
      six.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(NmsClientUtil.GetString("Exception while setting properties for bean ") + six, ex);
    }
    six.setVisible(false);
    try {
      three.setOpaque(true);
      three.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + three, ex);
    }
    three.setVisible(false);
    try {
      four.setOpaque(true);
      four.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + four, ex);
    }
    four.setVisible(false);
    try {
      seven.setOpaque(true);
      seven.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + seven, ex);
    }
    seven.setVisible(false);
    try {
      two.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(NmsClientUtil.GetString("Exception while setting properties for bean ") + two, ex);
    }
    two.setVisible(false);
    try {
      ten.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(NmsClientUtil.GetString("Exception while setting properties for bean ") + ten, ex);
    }
    ten.setVisible(false);
    try {
      five.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + five, ex);
    }
    five.setVisible(false);
    try {
      nine.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + nine, ex);
    }
    nine.setVisible(false);
    try {
      JPanel2.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + JPanel2, ex);
    }

    try {
      JPanel3.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + JPanel3, ex);
    }

    try {
      JLabel1.setBackground(new Color(-1));
      JLabel1.setHorizontalTextPosition(0);
      JLabel1.setHorizontalAlignment(0);
      JLabel1.setText(NmsClientUtil.GetString("Router details"));
      JLabel1.setFont(new Font("Dialog", 1, 14)); // No Internationalisation
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + JLabel1, ex);
    }

    try {
      JPanel4.setBackground(new Color(-1));
      java.lang.String[] JPanel4cardAndClassNames_array = new java.lang.String[2];
      JPanel4cardAndClassNames_array[0] =
          "router=com.adventnet.nms.examples.routermap.RouterDetails"; // No Internationalisation
      JPanel4cardAndClassNames_array[1] =
          "inter=com.adventnet.nms.examples.routermap.IFDetails"; // No Internationalisation
      JPanel4.setCardAndClassNames(JPanel4cardAndClassNames_array);
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + JPanel4, ex);
    }

    try {
      JPanel5.setBackground(new Color(-1));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + JPanel5, ex);
    }

    try {
      RefreshBtn.setText(NmsClientUtil.GetString("Refresh"));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + RefreshBtn, ex);
    }

    try {
      CloseBtn.setText(NmsClientUtil.GetString("Close"));
    } catch (Exception ex) {
      showStatus(
          NmsClientUtil.GetString("Exception while setting properties for bean ") + CloseBtn, ex);
    }
    CloseBtn.setPreferredSize(
        new Dimension(
            CloseBtn.getPreferredSize().width + 12, CloseBtn.getPreferredSize().height + 0));
    JPanel5.setPreferredSize(
        new Dimension(
            JPanel5.getPreferredSize().width + 229, JPanel5.getPreferredSize().height + 4));
    JPanel4.setPreferredSize(
        new Dimension(
            JPanel4.getPreferredSize().width + 507, JPanel4.getPreferredSize().height + 293));
    JLabel1.setPreferredSize(
        new Dimension(
            JLabel1.getPreferredSize().width + 132, JLabel1.getPreferredSize().height + 8));
    JPanel3.setPreferredSize(
        new Dimension(
            JPanel3.getPreferredSize().width + 168, JPanel3.getPreferredSize().height + 6));

    // <End_setUpProperties>
  }