5.7.2.2.2 Designing Spanning Tree Details Panel

 

The Spanning Tree Details Panel is to show the Spanning Tree Details such as Bridge Priority, Maximum Age, Hello Time, and Forward Delay and configure them at run time. This Panel is in the "STP" tab of the Switch Configuration Application at run time. This topic explains the step-by-step procedure to build this panel screen.

  

Steps Involved

 

Initial Settings

  1. Create a new screen under the "EMS_Configuration" project and rename it as "STP".

  2. Change the build type of the Screen to "Panel" using the menu command Build > Type > Panel.

  3. Change the layout of the Screen to "Border Layout" by right-clicking the Draw Area to invoke the screen pop-up menu, select Layouts > Border.

Dropping and Laying Out Components

  1. Ensure that the "SwingBeans.list" tab of Beans Palette is selected.

  2. Click and drop a JPanel bean in the "Center" position of the Draw Area and change its instance name as "ST_Details_Panel".

  3. Change the layout of the "ST_Details_Panel" to "GridBag Layout" by right-clicking the Draw Area to invoke the screen pop-up menu, select Layouts > GridBag Layout.

  4. Drop a JLabel from the SwingBeans.list tab of BeansPalette and change its instance name as "bridge_priorityL" and provide "text" property value "Bridge Priority" in the Property Form. Similarly drop three more JLabel and change their properties in Property Form as given in the table below

Instance Name

Text Property

max_ageL

Max.Age

hello_timeL

Hello Time

forw_delayL

Forward Delay

 

  1. Expand the BRIDGE-MIB node in the XML tree and scroll down to BRIDGE-MIB > mib-2  > dot1dBridge  > dot1dStp.

  2. Click and drop the "dot1dStpPriority" representation ("View1" node under this node) from the XML tree in the "ST_Details_Panel" bean. Change the instance name of the dropped bean "bridge_priorityTF".

  3. Drop a JTextField from the SwingBeans.list tab of BeansPalette and change its instance name as "max_ageTF". Similarly, drop two more text fields and change their instance names as "hello_timeTF" and "forw_delay_TF" respectively.

  4. Switch to the Config tab.

  5. Select the "dot1dStpBridgeMaxAge" node from the XML Tree, and click the "Add Attribute" button to add the attributes from the Xml Tree to the Config Tree.

  6. Edit the code in the "Code Area" and change the bolded code line as given below.

Properties valueProp = new Properties();

valueProp.setProperty(LABEL,"dot1dStpBridgeMaxAge");

valueProp.setProperty(TYPE,"2");

valueProp.setProperty(VALUE,String.valueOf(max_ageTF.getText()));

return valueProp;

  1. Similarly repeat the above steps for the nodes dot1dStpBridgeHelloTime, dot1dStpBridgeForwardDelay. The corresponding code lines to be modified are respectively.

valueProp.setProperty(VALUE,String.valueOf(hello_timeTF.getText()));

 

valueProp.setProperty(VALUE,String.valueOf(forw_delay_TF.getText()));

  1. Click and drop the "dot1dStpBridgeMaxAge" node from the XML Tree on the "max_ageTF" bean to invoke the Client Property dialog. Select the "setText" method from the "Result Method" list and click OK  button to close the Client Property dialog.

  2. Follow the above step (Step-7) to drop the nodes and setting the "setText" method in Client Property dialog.

Bean Instance Name

Node to be Dropped from XML Tree

hello_timeTF

dot1dStpBrideHelloTime

forw_delay_TF

dot1dStpBridgeForwardDelay

 

  1. Invoke the "GridBag Layout Customizer" window for the "Sys_Details_Panel" by right-clicking the screen and select "Layout Properties".

  2. Arrange the components in the "GridBag Layout Customizer" window as given below.

  3. In the GridBag Layout Customizer, set the following properties for all the components:

 

Property

Value

Fill

Horizontal

Insets

5,5,5,5

 

Component (Identified  with Instance Name)

Grid

Anchor

IPadX

WeightX

GridX

GridY

bridge_priorityL

0

0

EAST

4

0.0

max_ageL

1

hello_timeL

2

forw_delayL

3

bridge_priorityTF

1

0

WEST

0

0.1

max_ageTF

1

hello_timeTF

2

forw_delay_TF

3

 

This design of "Spanning Tree Details" screen is complete.

 

Save the "STP" screen using the menu command File > Save > Screen.  

 

Compile the "STP" screen using the menu command Build > Compile.

 

 



Copyright © 2009 ZOHO Corp. All Rights Reserved.