View Javadoc
1 /* 2 * ==================================================================== 3 * 4 * This code is subject to the freebxml License, Version 1.1 5 * 6 * Copyright (c) 2003 freebxml.org. All rights reserved. 7 * 8 * ==================================================================== 9 */ 10 11 package com.sun.xml.registry.client.browser; 12 13 import com.sun.xml.registry.client.browser.graph.JBGraphPanel; 14 15 import java.awt.*; 16 import java.awt.event.*; 17 18 import java.net.URL; 19 20 import java.util.ArrayList; 21 22 import javax.swing.*; 23 import javax.swing.event.*; 24 import javax.swing.plaf.FontUIResource; 25 import javax.swing.tree.*; 26 27 import javax.xml.registry.BulkResponse; 28 import javax.xml.registry.BusinessLifeCycleManager; 29 import javax.xml.registry.JAXRException; 30 import javax.xml.registry.JAXRResponse; 31 import javax.xml.registry.infomodel.ClassificationScheme; 32 import javax.xml.registry.infomodel.Concept; 33 import javax.xml.registry.infomodel.Key; 34 import javax.xml.registry.infomodel.RegistryObject; 35 36 import com.sun.xml.registry.client.browser.graph.JBGraph; 37 import com.sun.xml.registry.client.browser.graph.JBGraphModel; 38 import com.sun.xml.registry.client.browser.graph.JBGraphPanel; 39 40 import com.sun.xml.registry.client.browser.RegistryBrowser; 41 42 43 /*** 44 * The JTabbedPane for RegistryBrowser 45 * 46 * @author <a href="mailto:Farrukh.Najmi@Sun.COM">Farrukh S. Najmi</a> 47 */ 48 public class JBTabbedPane extends JTabbedPane implements java.beans.PropertyChangeListener { 49 50 DiscoveryPanel discoveryPanel=null; 51 JPanel submissionPanel=null; 52 static JAXRResourceBundle resourceBundle = JAXRResourceBundle.getInstance(); 53 54 55 /*** 56 * Class Constructor. 57 * 58 */ 59 public JBTabbedPane() throws JAXRException { 60 discoveryPanel = new DiscoveryPanel(); 61 addTab(resourceBundle.getString("tabbedPane.discovery"), discoveryPanel); 62 63 submissionPanel = new JPanel(); 64 submissionPanel.setLayout(new BorderLayout()); 65 66 67 JBGraphPanel graphPanel = new JBGraphPanel(); 68 JBGraph graph = new JBGraph(new JBGraphModel()); 69 graphPanel.setModel(graph); 70 graphPanel.setEnabled(true); 71 submissionPanel.add(graphPanel, 72 BorderLayout.CENTER); 73 74 setSelectedIndex(0); 75 76 //add lister authenticated bound property 77 RegistryBrowser.getInstance().addPropertyChangeListener(RegistryBrowser.PROPERTY_AUTHENTICATED, this); 78 } 79 80 /*** 81 * Action for the Find tool. 82 */ 83 public void findAction() { 84 discoveryPanel.find(); 85 } 86 87 /*** 88 * Listens to property changes in the bound property RegistryBrowser.PROPERTY_AUTHENTICATED. 89 * Hides certain menuItems when user is unAuthenticated. 90 */ 91 public void propertyChange(java.beans.PropertyChangeEvent ev) { 92 if (ev.getPropertyName().equals(RegistryBrowser.PROPERTY_AUTHENTICATED)) { 93 94 boolean authenticated = ((Boolean)ev.getNewValue()).booleanValue(); 95 96 //Show submission pane only if authenticated 97 if (authenticated) { 98 addTab(resourceBundle.getString("tabbedPane.submission"), submissionPanel); 99 } 100 else { 101 remove(submissionPanel); 102 } 103 setSelectedIndex(0); 104 //getRootPane().updateUI(); 105 } 106 } 107 108 }

This page was automatically generated by Maven