org/objectweb/proactive/ext/security/gui/RuleEditor.java

00001 /* 
00002  * ################################################################
00003  * 
00004  * ProActive: The Java(TM) library for Parallel, Distributed, 
00005  *            Concurrent computing with Security and Mobility
00006  * 
00007  * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
00008  * Contact: proactive@objectweb.org
00009  * 
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or any later version.
00014  *  
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  * 
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00023  * USA
00024  *  
00025  *  Initial developer(s):               The ProActive Team
00026  *                        http://www.inria.fr/oasis/ProActive/contacts.html
00027  *  Contributor(s): 
00028  * 
00029  * ################################################################
00030  */ 
00031 package org.objectweb.proactive.ext.security.gui;
00032 
00033 import javax.swing.JButton;
00034 import javax.swing.JList;
00035 import javax.swing.JPanel;
00036 import javax.swing.JScrollPane;
00037 import javax.swing.JTabbedPane;
00038 
00039 
00044 public class RuleEditor extends JPanel {
00045     private JTabbedPane jTabbedPane = null;
00046     private RuleCommunication ruleCommunicationRequest = null;
00047     private RuleCommunication ruleCommunicationRequest1 = null;
00048     private JScrollPane jScrollPane = null;
00049     private JScrollPane jScrollPane1 = null;
00050     private JList jListFrom = null;
00051     private JList jListTo = null;
00052     private JButton addFrom = null;
00053     private JButton removeFrom = null;
00054     private JButton addTo = null;
00055     private JButton removeTo = null;
00056 
00060     public RuleEditor() {
00061         super();
00062         initialize();
00063     }
00064 
00070     private void initialize() {
00071         this.setLayout(null);
00072         this.setSize(613, 454);
00073         this.add(getJTabbedPane(), null);
00074         this.add(getJScrollPane(), null);
00075         this.add(getJScrollPane1(), null);
00076         this.add(getAddFrom(), null);
00077         this.add(getRemoveFrom(), null);
00078         this.add(getAddTo(), null);
00079         this.add(getRemoveTo(), null);
00080     }
00081 
00087     private JTabbedPane getJTabbedPane() {
00088         if (jTabbedPane == null) {
00089             jTabbedPane = new JTabbedPane();
00090             jTabbedPane.setBounds(22, 244, 328, 201);
00091             jTabbedPane.addTab("Request", null, getRuleCommunicationRequest(),
00092                 null);
00093             jTabbedPane.addTab("Reply", null, getRuleCommunicationRequest1(),
00094                 null);
00095         }
00096         return jTabbedPane;
00097     }
00098 
00104     private RuleCommunication getRuleCommunicationRequest() {
00105         if (ruleCommunicationRequest == null) {
00106             ruleCommunicationRequest = new RuleCommunication();
00107         }
00108         return ruleCommunicationRequest;
00109     }
00110 
00116     private RuleCommunication getRuleCommunicationRequest1() {
00117         if (ruleCommunicationRequest1 == null) {
00118             ruleCommunicationRequest1 = new RuleCommunication();
00119         }
00120         return ruleCommunicationRequest1;
00121     }
00122 
00128     private JScrollPane getJScrollPane() {
00129         if (jScrollPane == null) {
00130             jScrollPane = new JScrollPane();
00131             jScrollPane.setBounds(22, 17, 263, 196);
00132             jScrollPane.setViewportView(getJListFrom());
00133         }
00134         return jScrollPane;
00135     }
00136 
00142     private JScrollPane getJScrollPane1() {
00143         if (jScrollPane1 == null) {
00144             jScrollPane1 = new JScrollPane();
00145             jScrollPane1.setBounds(294, 18, 283, 195);
00146             jScrollPane1.setViewportView(getJListTo());
00147         }
00148         return jScrollPane1;
00149     }
00150 
00156     private JList getJListFrom() {
00157         if (jListFrom == null) {
00158             jListFrom = new JList();
00159         }
00160         return jListFrom;
00161     }
00162 
00168     private JList getJListTo() {
00169         if (jListTo == null) {
00170             jListTo = new JList();
00171         }
00172         return jListTo;
00173     }
00174 
00180     private JButton getAddFrom() {
00181         if (addFrom == null) {
00182             addFrom = new JButton();
00183             addFrom.setBounds(115, 218, 66, 20);
00184             addFrom.setText("Add");
00185         }
00186         return addFrom;
00187     }
00188 
00194     private JButton getRemoveFrom() {
00195         if (removeFrom == null) {
00196             removeFrom = new JButton();
00197             removeFrom.setBounds(184, 217, 89, 22);
00198             removeFrom.setText("Remove");
00199             removeFrom.addActionListener(new java.awt.event.ActionListener() {
00200                     public void actionPerformed(java.awt.event.ActionEvent e) {
00201                         jListFrom.remove(jListFrom.getSelectedIndex());
00202                     }
00203                 });
00204         }
00205         return removeFrom;
00206     }
00207 
00213     private JButton getAddTo() {
00214         if (addTo == null) {
00215             addTo = new JButton();
00216             addTo.setBounds(422, 218, 61, 20);
00217             addTo.setText("Add");
00218             addTo.addActionListener(new java.awt.event.ActionListener() {
00219                     public void actionPerformed(java.awt.event.ActionEvent e) {
00220                         System.out.println("actionPerformed()");
00221                     }
00222                 });
00223         }
00224         return addTo;
00225     }
00226 
00232     private JButton getRemoveTo() {
00233         if (removeTo == null) {
00234             removeTo = new JButton();
00235             removeTo.setBounds(492, 217, 83, 23);
00236             removeTo.setText("Remove");
00237             removeTo.addActionListener(new java.awt.event.ActionListener() {
00238                     public void actionPerformed(java.awt.event.ActionEvent e) {
00239                         jListTo.remove(jListTo.getSelectedIndex());
00240                     }
00241                 });
00242         }
00243         return removeTo;
00244     }
00245 } //  @jve:decl-index=0:visual-constraint="24,28"

Generated on Mon Jan 22 15:16:11 2007 for ProActive by  doxygen 1.5.1