📄 memebertree.java
字号:
} else if (node.toString().equals("Link Protocols")) { boolean is80211NodeSet =false, is8023NodeSet =false, isWwanNodeSet =false, isBluetoothPanNodeSet =false; DefaultMutableTreeNode protocol80211Node=null,protocol8023Node =null,protocolWwanNode =null,ProtocolBluetoothPanNode =null; if(myLinkProtocolClass==null) { myLinkProtocolClass = new LinkProtocolClass(); } LinkProtocolCollection myLinkProtocolCollection = (LinkProtocolCollection)myLinkProtocolClass.GetInstances(); myLinkProtocolCollection.Reset(); while(myLinkProtocolCollection.HasNext()) { LinkProtocolInstance myLinkProtocolInstance = (LinkProtocolInstance)myLinkProtocolCollection.Next(); if(myLinkProtocolInstance.GetType().equals("ProtocolBluetoothPan")) { if(isBluetoothPanNodeSet == false) { ProtocolBluetoothPanNode = new DefaultMutableTreeNode("BluetoothPan Protocol"); isBluetoothPanNodeSet = true; } if(myProtocolBluetoothPanClass==null) { myProtocolBluetoothPanClass = new ProtocolBluetoothPanClass(); } ProtocolBluetoothPanInstance myProtocolBluetoothPanInstance = (ProtocolBluetoothPanInstance)myProtocolBluetoothPanClass.GetInstance(myLinkProtocolInstance.GetKey()); DefaultMutableTreeNode ProtocolBluetoothPanInstanceNode = new DefaultMutableTreeNode(myProtocolBluetoothPanInstance.Id.GetValue()); ProtocolBluetoothPanNode.add(ProtocolBluetoothPanInstanceNode); deviceSet.put(ProtocolBluetoothPanInstanceNode,myProtocolBluetoothPanInstance); devicekeySet.put(ProtocolBluetoothPanInstanceNode,myProtocolBluetoothPanInstance.GetKey()); } else if(myLinkProtocolInstance.GetType().equals("Protocol802_3")) { if(is8023NodeSet == false) { protocol8023Node = new DefaultMutableTreeNode("802.3 Protocol"); is8023NodeSet = true; } if(myProtocol802_3Class==null) { myProtocol802_3Class = new Protocol802_3Class(); } Protocol802_3Instance myProtocol802_3Instance = (Protocol802_3Instance)myProtocol802_3Class.GetInstance(myLinkProtocolInstance.GetKey()); DefaultMutableTreeNode protocol8023InstanceNode = new DefaultMutableTreeNode(myProtocol802_3Instance.Id.GetValue()); protocol8023Node.add(protocol8023InstanceNode); deviceSet.put(protocol8023InstanceNode,myProtocol802_3Instance); devicekeySet.put(protocol8023InstanceNode,myProtocol802_3Instance.GetKey()); } else if (myLinkProtocolInstance.GetType().equals("Protocol802_11")) { if(is80211NodeSet == false) { protocol80211Node = new DefaultMutableTreeNode("802.11 Protocol"); is80211NodeSet = true; } if(myProtocol802_11Class==null) { myProtocol802_11Class = new Protocol802_11Class(); } Protocol802_11Instance myProtocol802_11Instance = (Protocol802_11Instance)myProtocol802_11Class.GetInstance(myLinkProtocolInstance.GetKey()); DefaultMutableTreeNode protocol80211InstanceNode = new DefaultMutableTreeNode(myProtocol802_11Instance.Id.GetValue()); protocol80211Node.add(protocol80211InstanceNode); deviceSet.put(protocol80211InstanceNode,myProtocol802_11Instance); devicekeySet.put(protocol80211InstanceNode,myProtocol802_11Instance.GetKey()); } else if (myLinkProtocolInstance.GetType().equals("ProtocolGprs")||myLinkProtocolInstance.GetType().equals("ProtocolCdma")) {// SCR #1394 if(isWwanNodeSet == false) { protocolWwanNode = new DefaultMutableTreeNode("Wwan Protocol"); isWwanNodeSet = true; } if(myProtocolWwanClass==null) { myProtocolWwanClass = new ProtocolWwanClass(); } ProtocolWwanInstance myProtocolWwanInstance = (ProtocolWwanInstance)myProtocolWwanClass.GetInstance(myLinkProtocolInstance.GetKey()); DefaultMutableTreeNode protocolWwanInstanceNode = new DefaultMutableTreeNode(myProtocolWwanInstance.Id.GetValue()); protocolWwanNode.add(protocolWwanInstanceNode); deviceSet.put(protocolWwanInstanceNode,myProtocolWwanInstance); devicekeySet.put(protocolWwanInstanceNode,myProtocolWwanInstance.GetKey()); } } if(ProtocolBluetoothPanNode != null) node.add(ProtocolBluetoothPanNode); if(protocol8023Node != null) node.add(protocol8023Node); if(protocol80211Node != null) node.add(protocol80211Node); if(protocolWwanNode != null) node.add(protocolWwanNode); } else if (node.toString().equals("Contexts")) { if(myContextClass==null) { myContextClass = new ContextClass(); } // add connectivity node ConnectivityInstance myConnectivityInstance = (ConnectivityInstance)myContextClass.GetInstance("Connectivity"); if (myConnectivityInstance != null) { DefaultMutableTreeNode connectivityNode = new DefaultMutableTreeNode("Connectivity"); deviceSet.put(connectivityNode, myConnectivityInstance); devicekeySet.put(connectivityNode, "Connectivity"); node.add(connectivityNode); } // add Display node DisplayInstance myDisplayInstance = (DisplayInstance)myContextClass.GetInstance("Display"); if (myDisplayInstance != null) { DefaultMutableTreeNode DisplayNode = new DefaultMutableTreeNode("Display"); deviceSet.put(DisplayNode, myDisplayInstance); devicekeySet.put(DisplayNode, "Display"); node.add(DisplayNode); } // add Storage node StorageInstance myStorageInstance = (StorageInstance)myContextClass.GetInstance("Storage"); if (myStorageInstance != null) { DefaultMutableTreeNode StorageNode = new DefaultMutableTreeNode("Storage"); deviceSet.put(StorageNode, myStorageInstance); devicekeySet.put(StorageNode, "Storage"); node.add(StorageNode); } // add Power node PowerInstance myPowerInstance = (PowerInstance)myContextClass.GetInstance("Power"); if (myPowerInstance != null) { DefaultMutableTreeNode powerNode = new DefaultMutableTreeNode("Power"); deviceSet.put(powerNode, myPowerInstance); devicekeySet.put(powerNode, "Power"); node.add(powerNode); } // add Bandwidth node BandwidthInstance myBandwidthInstance = (BandwidthInstance)myContextClass.GetInstance("Bandwidth"); if (myBandwidthInstance != null) { DefaultMutableTreeNode bandwidthNode = new DefaultMutableTreeNode("Bandwidth"); deviceSet.put(bandwidthNode, myBandwidthInstance); devicekeySet.put(bandwidthNode, "Bandwidth"); node.add(bandwidthNode); } } return node; } private void openPropertyFrame(DefaultMutableTreeNode node) throws IntelMobileException { class frameHandle { public String Key; public String Type; JFrame frame; } Class instanceType = deviceSet.get(node).getClass(); String Key=((InstanceObject)deviceSet.get(node)).GetKey(); //Check if the window has been open, if so then show it for(int i=0;i<vectPropertyWindows.size();i++) { frameHandle handle=(frameHandle)vectPropertyWindows.get(i); if(instanceType.toString().equals(handle.Type) && Key.equals(handle.Key)) { handle.frame.show(); return; } } frameHandle newFrameHandle=new frameHandle(); newFrameHandle.Type=instanceType.toString(); newFrameHandle.Key=Key; if(instanceType.toString().indexOf("ProcessorInstance")!=-1) { ProcessorFrame processorFrame = new ProcessorFrame(((ProcessorInstance)deviceSet.get(node)).GetKey()); newFrameHandle.frame=(JFrame)processorFrame; processorFrame.setLocationRelativeTo(null); processorFrame.show(); } else if(instanceType.toString().indexOf("BatteryInstance")!=-1) { BatteryFrame batteryFrame = new BatteryFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)batteryFrame; batteryFrame.setLocationRelativeTo(null); batteryFrame.show(); } else if(instanceType.toString().indexOf("PhysicalDiskInstance")!=-1) { PhysicalDiskFrame physicaldiskFrame = new PhysicalDiskFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)physicaldiskFrame; physicaldiskFrame.setLocationRelativeTo(null); physicaldiskFrame.show(); } else if(instanceType.toString().indexOf("LogicalDiskInstance")!=-1) { LogicalDiskFrame myLogicalDiskFrame = new LogicalDiskFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)myLogicalDiskFrame; myLogicalDiskFrame.setLocationRelativeTo(null); myLogicalDiskFrame.show(); } else if(instanceType.toString().indexOf("MemoryInstance")!=-1) { MemoryFrame myMemoryFrame = new MemoryFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)myMemoryFrame; myMemoryFrame.setLocationRelativeTo(null); myMemoryFrame.show(); } else if(instanceType.toString().indexOf("DisplayAdapterInstance")!=-1) { DisplayAdapterFrame myDisplayAdapterFrame = new DisplayAdapterFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)myDisplayAdapterFrame; myDisplayAdapterFrame.setLocationRelativeTo(null); myDisplayAdapterFrame.show(); } else if (instanceType.toString().indexOf("WiredAdapter")!=-1) { NetAdapterFrame networkadapterFrame = new NetAdapterFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)networkadapterFrame; networkadapterFrame.setLocationRelativeTo(null); networkadapterFrame.show(); } else if (instanceType.toString().indexOf("RadioAdapter")!=-1) { RadioAdapterFrame radioadapterFrame = new RadioAdapterFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)radioadapterFrame; radioadapterFrame.setLocationRelativeTo(null); radioadapterFrame.show(); } else if (instanceType.toString().indexOf("Protocol802_11")!=-1) { LinkProtocol802_11Frame protocol802_11Frame = new LinkProtocol802_11Frame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)protocol802_11Frame; protocol802_11Frame.setLocationRelativeTo(null); protocol802_11Frame.show(); } else if (instanceType.toString().indexOf("Protocol802_3")!=-1) { LinkProtocol802_3Frame protocol802_3Frame = new LinkProtocol802_3Frame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)protocol802_3Frame; protocol802_3Frame.setLocationRelativeTo(null); protocol802_3Frame.show(); } else if (instanceType.toString().indexOf("ProtocolBluetoothPan")!=-1) { LinkProtocolBluetoothPanFrame ProtocolBluetoothPanFrame = new LinkProtocolBluetoothPanFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)ProtocolBluetoothPanFrame; ProtocolBluetoothPanFrame.setLocationRelativeTo(null); ProtocolBluetoothPanFrame.show(); } else if (instanceType.toString().indexOf("ProtocolGprs")!=-1) { LinkProtocolWwanFrame protocolWwanFrame = new LinkProtocolWwanFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)protocolWwanFrame; protocolWwanFrame.setLocationRelativeTo(null); protocolWwanFrame.show(); } else if (instanceType.toString().indexOf("ProtocolCdma")!=-1) { LinkProtocolWwanFrame protocolWwanFrame = new LinkProtocolWwanFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)protocolWwanFrame; protocolWwanFrame.setLocationRelativeTo(null); protocolWwanFrame.show(); } else if (instanceType.toString().indexOf("Connectivity")!=-1) { ConnectivityFrame connectivityFrame = new ConnectivityFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)connectivityFrame; connectivityFrame.setLocationRelativeTo(null); connectivityFrame.show(); } else if (instanceType.toString().indexOf("Display")!=-1) { DisplayFrame myDisplayFrame = new DisplayFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)myDisplayFrame; myDisplayFrame.setLocationRelativeTo(null); myDisplayFrame.show(); } else if (instanceType.toString().indexOf("Storage")!=-1) { StorageFrame myStorageFrame = new StorageFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)myStorageFrame; myStorageFrame.setLocationRelativeTo(null); myStorageFrame.show(); } else if (instanceType.toString().indexOf("Power")!=-1) { PowerFrame powerFrame = new PowerFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)powerFrame; powerFrame.setLocationRelativeTo(null); powerFrame.show(); } else if (instanceType.toString().indexOf("Bandwidth")!=-1) { BandwidthFrame bandwidthFrame = new BandwidthFrame(devicekeySet.get(node).toString()); newFrameHandle.frame=(JFrame)bandwidthFrame; bandwidthFrame.setLocationRelativeTo(null); bandwidthFrame.show(); } vectPropertyWindows.add(newFrameHandle); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -