1 26 package org.objectweb.util.explorer.swing.panel; 27 28 import java.awt.BorderLayout ; 29 import java.awt.Color ; 30 31 import javax.swing.BoxLayout ; 32 import javax.swing.JLabel ; 33 import javax.swing.JPanel ; 34 35 import org.objectweb.util.explorer.api.Panel; 36 import org.objectweb.util.explorer.api.TreeView; 37 38 44 public class WhitePanel 45 implements Panel { 46 47 JPanel panel_; 48 49 52 public WhitePanel() { 53 this(""); 54 } 55 56 60 public WhitePanel(String message) { 61 panel_ = new JPanel (); 62 panel_.setBackground(Color.white); 63 panel_.setLayout(new BoxLayout (panel_, BoxLayout.Y_AXIS)); 64 panel_.add(new JLabel (message), BorderLayout.CENTER); 65 } 66 67 70 public void selected(TreeView treeView) { 71 Object o = treeView.getSelectedObject(); 72 if (o != null) 73 panel_.add(new JLabel (o.toString()), BorderLayout.CENTER); 74 } 75 76 80 public Object getPanel(){ 81 return panel_; 82 } 83 84 87 public void unselected(TreeView treeView) { 88 } 89 90 } 91 | Popular Tags |