1 26 27 package org.objectweb.openccm.explorer.CosTrading.gui; 28 29 30 import javax.swing.JPanel ; 31 import java.awt.Color ; 32 import javax.swing.BoxLayout ; 33 import javax.swing.Box ; 34 import javax.swing.border.TitledBorder ; 35 import javax.swing.JLabel ; 36 37 import org.objectweb.openccm.explorer.CosTrading.Query; 38 39 46 public class QueryPanel extends DefaultNodeViewPanel { 47 48 54 55 protected Query query_; 56 57 63 66 public QueryPanel() { 67 setBackground(Color.white); 68 setLayout(new BoxLayout (this, BoxLayout.Y_AXIS)); 69 } 70 71 77 83 86 public void onSetTreeView() { 87 if (getTreeView() != null) { 88 query_ = (Query)getTreeView().getSelectedObject(); 89 if (query_ != null) { 90 91 JPanel queryPanel = new JPanel (); 93 queryPanel.setBackground(Color.white); 94 queryPanel.setBorder(new TitledBorder (null," " + query_.getQueryLabel() + " ",TitledBorder.CENTER,TitledBorder.TOP)); 95 96 JLabel stn_lab = new JLabel ("Service Type: " + query_.getServiceTypeName()); 98 JLabel constr_lab = new JLabel ("Constraint: " + query_.getConstraint()); 99 JLabel pref_lab = new JLabel ("Preferences: " + query_.getPref()); 100 101 Box box = Box.createVerticalBox(); 103 box.add(stn_lab); 104 box.add(Box.createVerticalStrut(10)); 105 box.add(constr_lab); 106 box.add(Box.createVerticalStrut(10)); 107 box.add(pref_lab); 108 109 queryPanel.add(box); 111 add(queryPanel); 112 } 113 } 114 } 115 } 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | Popular Tags |