|
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
Create a new screen under the "EMS_Configuration" project and rename it as "STP".
Change the build type of the Screen to "Panel" using the menu command Build > Type > Panel.
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
Ensure that the "SwingBeans.list" tab of Beans Palette is selected.
Click and drop a JPanel bean in the "Center" position of the Draw Area and change its instance name as "ST_Details_Panel".
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.
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 |
Expand the BRIDGE-MIB node in the XML tree and scroll down to BRIDGE-MIB > mib-2 > dot1dBridge > dot1dStp.
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".
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.
Switch to the Config tab.
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.
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; |
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())); |
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.
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 |
Invoke the "GridBag Layout Customizer" window for the "Sys_Details_Panel" by right-clicking the screen and select "Layout Properties".
Arrange the components in the "GridBag Layout Customizer" window as given below.
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.
|