1 26 27 package org.objectweb.openccm.explorer.CosTrading.gui; 28 29 30 import java.awt.Color ; 31 import javax.swing.BoxLayout ; 32 import javax.swing.Box ; 33 import javax.swing.border.TitledBorder ; 34 import javax.swing.table.TableModel ; 35 import javax.swing.JLabel ; 36 import javax.swing.JPanel ; 37 import javax.swing.JTable ; 38 import javax.swing.JScrollPane ; 39 40 41 import org.omg.CosTrading.ProxyPackage.ProxyInfo; 42 43 54 public class ProxyInfoPanel 55 extends DefaultNodeViewPanel 56 { 57 58 64 65 protected ProxyInfo proxyInfo_; 66 67 73 76 public ProxyInfoPanel() { 77 setBackground(Color.white); 78 setLayout(new BoxLayout (this, BoxLayout.Y_AXIS)); 79 } 80 81 87 93 99 102 public void onSetTreeView() { 103 if (getTreeView() != null) { 104 proxyInfo_ = (ProxyInfo)getTreeView().getSelectedObject(); 105 if (proxyInfo_ != null) { 106 107 JLabel st = new JLabel ("Service Type: " + proxyInfo_.type); 109 110 TableModel dataModel = new OfferPropsTableModel(proxyInfo_.properties); 112 JTable table = new JTable (dataModel); 113 table.setBackground(Color.white); 114 115 JScrollPane scroll = new JScrollPane (table); 117 scroll.getViewport().setBackground(Color.white); 118 scroll.setBackground(Color.white); 119 120 Box props_box = Box.createVerticalBox(); 121 props_box.add(Box.createVerticalGlue()); 122 props_box.add(scroll); 123 props_box.add(Box.createVerticalGlue()); 124 125 JPanel propertiesPanel = new JPanel (); 126 propertiesPanel.setBackground(Color.white); 127 propertiesPanel.setBorder(new TitledBorder (null," Properties ",TitledBorder.CENTER,TitledBorder.TOP)); 128 propertiesPanel.setLayout(new java.awt.GridLayout (1, 1)); 129 propertiesPanel.add(props_box); 130 131 JLabel match = new JLabel ("If match all: " + proxyInfo_.if_match_all); 133 134 JLabel recipe = new JLabel ("Constraint recipe: " + proxyInfo_.recipe); 136 137 Box box = Box.createVerticalBox(); 139 box.add(st); 140 box.add(Box.createVerticalStrut(10)); 141 box.add(propertiesPanel); 142 box.add(Box.createVerticalStrut(10)); 143 box.add(match); 144 box.add(Box.createVerticalStrut(10)); 145 box.add(recipe); 146 147 add(box); 148 } 149 } 150 } 151 } 152 | Popular Tags |