1 6 7 package SOFA.SOFAnet.Browser; 8 9 import SOFA.SOFAnet.Admin.RMI.*; 10 import javax.swing.*; 11 12 import SOFA.SOFAnet.Search.RMI.RMISearchConfiguration; 13 import java.awt.Frame ; 14 import java.rmi.RemoteException ; 15 16 20 public class OperationsPanel extends javax.swing.JPanel 21 { 22 private RMIAdminInterface admin; 23 24 25 public OperationsPanel(RMIAdminInterface admin) 26 { 27 this.admin = admin; 28 initComponents(); 29 } 30 31 36 private void initComponents() { 38 jPanel1 = new javax.swing.JPanel (); 39 jPanel4 = new javax.swing.JPanel (); 40 installBundleButton = new javax.swing.JButton (); 41 uninstallBundleButton = new javax.swing.JButton (); 42 createBinaryBundleButton = new javax.swing.JButton (); 43 deleteBinaryBundleButton = new javax.swing.JButton (); 44 createUserBundleButton = new javax.swing.JButton (); 45 createComponentBundleButton = new javax.swing.JButton (); 46 jPanel2 = new javax.swing.JPanel (); 47 jPanel5 = new javax.swing.JPanel (); 48 testPushBundleButton = new javax.swing.JButton (); 49 testPullBundleButton = new javax.swing.JButton (); 50 pushBundleButton = new javax.swing.JButton (); 51 pullBundleButton = new javax.swing.JButton (); 52 createBundleOfferButton = new javax.swing.JButton (); 53 testPushBundleOfferButton = new javax.swing.JButton (); 54 pushBundleOfferButton = new javax.swing.JButton (); 55 generateTriggersOfContractButton = new javax.swing.JButton (); 56 deleteTriggersOfContractButton = new javax.swing.JButton (); 57 jPanel3 = new javax.swing.JPanel (); 58 jPanel6 = new javax.swing.JPanel (); 59 shareBundleButton = new javax.swing.JButton (); 60 unshareBundleButton = new javax.swing.JButton (); 61 acquireSharedBundleButton = new javax.swing.JButton (); 62 stopShareClientButton = new javax.swing.JButton (); 63 makeBundleInSharingPresentButton = new javax.swing.JButton (); 64 searchBundleButton = new javax.swing.JButton (); 65 editSearchNetConfigurationButton = new javax.swing.JButton (); 66 applySearchNetConfiguration = new javax.swing.JButton (); 67 68 setLayout(new java.awt.GridLayout (1, 0)); 69 70 setPreferredSize(new java.awt.Dimension (700, 500)); 71 jPanel1.setLayout(new java.awt.BorderLayout ()); 72 73 jPanel1.setBorder(new javax.swing.border.TitledBorder ("Local")); 74 jPanel4.setLayout(new java.awt.GridLayout (6, 0)); 75 76 installBundleButton.setText("Install Bundle"); 77 installBundleButton.addActionListener(new java.awt.event.ActionListener () 78 { 79 public void actionPerformed(java.awt.event.ActionEvent evt) 80 { 81 installBundleButtonActionPerformed(evt); 82 } 83 }); 84 85 jPanel4.add(installBundleButton); 86 87 uninstallBundleButton.setText("Uninstall Bundle"); 88 uninstallBundleButton.addActionListener(new java.awt.event.ActionListener () 89 { 90 public void actionPerformed(java.awt.event.ActionEvent evt) 91 { 92 uninstallBundleButtonActionPerformed(evt); 93 } 94 }); 95 96 jPanel4.add(uninstallBundleButton); 97 98 createBinaryBundleButton.setText("Create Binary Bundle"); 99 createBinaryBundleButton.addActionListener(new java.awt.event.ActionListener () 100 { 101 public void actionPerformed(java.awt.event.ActionEvent evt) 102 { 103 createBinaryBundleButtonActionPerformed(evt); 104 } 105 }); 106 107 jPanel4.add(createBinaryBundleButton); 108 109 deleteBinaryBundleButton.setText("Delete Binary Bundle"); 110 deleteBinaryBundleButton.addActionListener(new java.awt.event.ActionListener () 111 { 112 public void actionPerformed(java.awt.event.ActionEvent evt) 113 { 114 deleteBinaryBundleButtonActionPerformed(evt); 115 } 116 }); 117 118 jPanel4.add(deleteBinaryBundleButton); 119 120 createUserBundleButton.setText("Create User Bundle"); 121 createUserBundleButton.addActionListener(new java.awt.event.ActionListener () 122 { 123 public void actionPerformed(java.awt.event.ActionEvent evt) 124 { 125 createUserBundleButtonActionPerformed(evt); 126 } 127 }); 128 129 jPanel4.add(createUserBundleButton); 130 131 createComponentBundleButton.setText("Create Component Bundle"); 132 createComponentBundleButton.addActionListener(new java.awt.event.ActionListener () 133 { 134 public void actionPerformed(java.awt.event.ActionEvent evt) 135 { 136 createComponentBundleButtonActionPerformed(evt); 137 } 138 }); 139 140 jPanel4.add(createComponentBundleButton); 141 142 jPanel1.add(jPanel4, java.awt.BorderLayout.NORTH); 143 144 add(jPanel1); 145 146 jPanel2.setLayout(new java.awt.BorderLayout ()); 147 148 jPanel2.setBorder(new javax.swing.border.TitledBorder ("Network")); 149 jPanel5.setLayout(new java.awt.GridLayout (9, 0)); 150 151 testPushBundleButton.setText("Test Push Bundle"); 152 testPushBundleButton.addActionListener(new java.awt.event.ActionListener () 153 { 154 public void actionPerformed(java.awt.event.ActionEvent evt) 155 { 156 testPushBundleButtonActionPerformed(evt); 157 } 158 }); 159 160 jPanel5.add(testPushBundleButton); 161 162 testPullBundleButton.setText("Test Pull Bundle"); 163 testPullBundleButton.addActionListener(new java.awt.event.ActionListener () 164 { 165 public void actionPerformed(java.awt.event.ActionEvent evt) 166 { 167 testPullBundleButtonActionPerformed(evt); 168 } 169 }); 170 171 jPanel5.add(testPullBundleButton); 172 173 pushBundleButton.setText("Push Bundle"); 174 pushBundleButton.addActionListener(new java.awt.event.ActionListener () 175 { 176 public void actionPerformed(java.awt.event.ActionEvent evt) 177 { 178 pushBundleButtonActionPerformed(evt); 179 } 180 }); 181 182 jPanel5.add(pushBundleButton); 183 184 pullBundleButton.setText("Pull Bundle"); 185 pullBundleButton.addActionListener(new java.awt.event.ActionListener () 186 { 187 public void actionPerformed(java.awt.event.ActionEvent evt) 188 { 189 pullBundleButtonActionPerformed(evt); 190 } 191 }); 192 193 jPanel5.add(pullBundleButton); 194 195 createBundleOfferButton.setText("Create Bundle Offer"); 196 createBundleOfferButton.addActionListener(new java.awt.event.ActionListener () 197 { 198 public void actionPerformed(java.awt.event.ActionEvent evt) 199 { 200 createBundleOfferButtonActionPerformed(evt); 201 } 202 }); 203 204 jPanel5.add(createBundleOfferButton); 205 206 testPushBundleOfferButton.setText("Test Push Bundle Offer"); 207 testPushBundleOfferButton.addActionListener(new java.awt.event.ActionListener () 208 { 209 public void actionPerformed(java.awt.event.ActionEvent evt) 210 { 211 testPushBundleOfferButtonActionPerformed(evt); 212 } 213 }); 214 215 jPanel5.add(testPushBundleOfferButton); 216 217 pushBundleOfferButton.setText("Push Bundle Offer"); 218 pushBundleOfferButton.addActionListener(new java.awt.event.ActionListener () 219 { 220 public void actionPerformed(java.awt.event.ActionEvent evt) 221 { 222 pushBundleOfferButtonActionPerformed(evt); 223 } 224 }); 225 226 jPanel5.add(pushBundleOfferButton); 227 228 generateTriggersOfContractButton.setText("Generate Triggers of Contract"); 229 generateTriggersOfContractButton.addActionListener(new java.awt.event.ActionListener () 230 { 231 public void actionPerformed(java.awt.event.ActionEvent evt) 232 { 233 generateTriggersOfContractButtonActionPerformed(evt); 234 } 235 }); 236 237 jPanel5.add(generateTriggersOfContractButton); 238 239 deleteTriggersOfContractButton.setText("Delete Triggers of Contract"); 240 deleteTriggersOfContractButton.addActionListener(new java.awt.event.ActionListener () 241 { 242 public void actionPerformed(java.awt.event.ActionEvent evt) 243 { 244 deleteTriggersOfContractButtonActionPerformed(evt); 245 } 246 }); 247 248 jPanel5.add(deleteTriggersOfContractButton); 249 250 jPanel2.add(jPanel5, java.awt.BorderLayout.NORTH); 251 252 add(jPanel2); 253 254 jPanel3.setLayout(new java.awt.BorderLayout ()); 255 256 jPanel3.setBorder(new javax.swing.border.TitledBorder ("Sharing & Searching")); 257 jPanel6.setLayout(new java.awt.GridLayout (8, 0)); 258 259 shareBundleButton.setText("Share Bundle"); 260 shareBundleButton.addActionListener(new java.awt.event.ActionListener () 261 { 262 public void actionPerformed(java.awt.event.ActionEvent evt) 263 { 264 shareBundleButtonActionPerformed(evt); 265 } 266 }); 267 268 jPanel6.add(shareBundleButton); 269 270 unshareBundleButton.setText("Unshare Bundle"); 271 unshareBundleButton.addActionListener(new java.awt.event.ActionListener () 272 { 273 public void actionPerformed(java.awt.event.ActionEvent evt) 274 { 275 unshareBundleButtonActionPerformed(evt); 276 } 277 }); 278 279 jPanel6.add(unshareBundleButton); 280 281 acquireSharedBundleButton.setText("Acquire Shared Bundle"); 282 acquireSharedBundleButton.addActionListener(new java.awt.event.ActionListener () 283 { 284 public void actionPerformed(java.awt.event.ActionEvent evt) 285 { 286 acquireSharedBundleButtonActionPerformed(evt); 287 } 288 }); 289 290 jPanel6.add(acquireSharedBundleButton); 291 292 stopShareClientButton.setText("Stop Share Client"); 293 stopShareClientButton.addActionListener(new java.awt.event.ActionListener () 294 { 295 public void actionPerformed(java.awt.event.ActionEvent evt) 296 { 297 stopShareClientButtonActionPerformed(evt); 298 } 299 }); 300 301 jPanel6.add(stopShareClientButton); 302 303 makeBundleInSharingPresentButton.setText("Make Bundle In Sharing Present"); 304 makeBundleInSharingPresentButton.addActionListener(new java.awt.event.ActionListener () 305 { 306 public void actionPerformed(java.awt.event.ActionEvent evt) 307 { 308 makeBundleInSharingPresentButtonActionPerformed(evt); 309 } 310 }); 311 312 jPanel6.add(makeBundleInSharingPresentButton); 313 314 searchBundleButton.setText("Search Bundle"); 315 searchBundleButton.addActionListener(new java.awt.event.ActionListener () 316 { 317 public void actionPerformed(java.awt.event.ActionEvent evt) 318 { 319 searchBundleButtonActionPerformed(evt); 320 } 321 }); 322 323 jPanel6.add(searchBundleButton); 324 325 editSearchNetConfigurationButton.setText("Edit SearchNet Configuration"); 326 editSearchNetConfigurationButton.addActionListener(new java.awt.event.ActionListener () 327 { 328 public void actionPerformed(java.awt.event.ActionEvent evt) 329 { 330 editSearchNetConfigurationButtonActionPerformed(evt); 331 } 332 }); 333 334 jPanel6.add(editSearchNetConfigurationButton); 335 336 applySearchNetConfiguration.setText("Apply SearchNet Configuration"); 337 applySearchNetConfiguration.addActionListener(new java.awt.event.ActionListener () 338 { 339 public void actionPerformed(java.awt.event.ActionEvent evt) 340 { 341 applySearchNetConfigurationActionPerformed(evt); 342 } 343 }); 344 345 jPanel6.add(applySearchNetConfiguration); 346 347 jPanel3.add(jPanel6, java.awt.BorderLayout.NORTH); 348 349 add(jPanel3); 350 351 } 353 private void makeBundleInSharingPresentButtonActionPerformed(java.awt.event.ActionEvent evt) { MakeBundleInSharingPresentDialog.showDialog(this, admin, "", true); 356 } 358 private void applySearchNetConfigurationActionPerformed(java.awt.event.ActionEvent evt) { try 361 { 362 admin.applyRMISearchConfiguration(); 363 } 364 catch (RemoteException e) 365 { 366 JOptionPane.showMessageDialog(this, "RMI Error occured while accessing SOFA net node:\n" + e, "Error", JOptionPane.ERROR_MESSAGE); 367 return; 368 } 369 370 JOptionPane.showMessageDialog(this, "SearchNet conenctions created using actual configuration of SearchNet"); 371 } 373 private void editSearchNetConfigurationButtonActionPerformed(java.awt.event.ActionEvent evt) { RMISearchConfiguration configuration = null; 376 try 377 { 378 configuration = admin.getRMISearchConfiguration(); 379 } 380 catch (RemoteException e) 381 { 382 JOptionPane.showMessageDialog(this, "RMI Error occured while accessing SOFA net node:\n" + e, "Error", JOptionPane.ERROR_MESSAGE); 383 return; 384 } 385 386 Frame frame = JOptionPane.getFrameForComponent(this); 387 RMISearchConfigurationEditDialog dialog = new RMISearchConfigurationEditDialog(frame, true, configuration); 388 dialog.setLocationRelativeTo(this); 389 dialog.setVisible(true); 390 391 if (dialog.isOK()) 392 { 393 try 394 { 395 admin.setRMISearchConfiguration(configuration); 396 if (dialog.apply()) admin.applyRMISearchConfiguration(); 397 } 398 catch (RemoteException e) 399 { 400 JOptionPane.showMessageDialog(this, "RMI Error occured while accessing SOFA net node:\n" + e, "Error", JOptionPane.ERROR_MESSAGE); 401 return; 402 } 403 } 404 } 406 private void deleteTriggersOfContractButtonActionPerformed(java.awt.event.ActionEvent evt) { DeleteTriggersOfContractDialog.showDialog(this, admin, ""); 409 } 411 private void generateTriggersOfContractButtonActionPerformed(java.awt.event.ActionEvent evt) { GenerateTriggersOfContractDialog.showDialog(this, admin, ""); 414 } 416 private void searchBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { SearchDialog.showDialog(this, admin); 419 } 421 private void stopShareClientButtonActionPerformed(java.awt.event.ActionEvent evt) { StopShareClientDialog.showDialog(this, admin, ""); 424 } 426 private void acquireSharedBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { AcquireSharedBundleDialog.showDialog(this, admin, "", ""); 429 } 431 private void unshareBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { UnshareBundleDialog.showDialog(this, admin, ""); 434 } 436 private void shareBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { ShareBundleDialog.showDialog(this, admin, ""); 439 } 441 private void pushBundleOfferButtonActionPerformed(java.awt.event.ActionEvent evt) { PushBundleOfferDialog.showDialog(this, admin, ""); 444 } 446 private void testPushBundleOfferButtonActionPerformed(java.awt.event.ActionEvent evt) { TestPushBundleOfferDialog.showDialog(this, admin, ""); 449 } 451 private void createBundleOfferButtonActionPerformed(java.awt.event.ActionEvent evt) { CreateBundleOfferDialog.showDialog(this, admin, ""); 454 } 456 private void pullBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { PullBundleDialog.showDialog(this, admin, ""); 459 } 461 private void pushBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { PushBundleDialog.showDialog(this, admin, ""); 464 } 466 private void testPullBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { TestPullBundleDialog.showDialog(this, admin, ""); 469 } 471 private void testPushBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { TestPushBundleDialog.showDialog(this, admin, ""); 474 } 476 private void createComponentBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { CreateComponentBundleDialog.showDialog(this, admin, ""); 479 } 481 private void createUserBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { CreateUserBundleDialog.showDialog(this, admin, "", null); 484 } 486 private void deleteBinaryBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { DeleteBinaryBundleDialog.showDialog(this, admin, ""); 489 } 491 private void createBinaryBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { CreateBinaryBundleDialog.showDialog(this, admin, ""); 494 } 496 private void uninstallBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { UninstallBundleDialog.showDialog(this, admin, ""); 499 } 501 private void installBundleButtonActionPerformed(java.awt.event.ActionEvent evt) { InstallBundleDialog.showDialog(this, admin, ""); 504 } 506 507 private javax.swing.JButton acquireSharedBundleButton; 509 private javax.swing.JButton applySearchNetConfiguration; 510 private javax.swing.JButton createBinaryBundleButton; 511 private javax.swing.JButton createBundleOfferButton; 512 private javax.swing.JButton createComponentBundleButton; 513 private javax.swing.JButton createUserBundleButton; 514 private javax.swing.JButton deleteBinaryBundleButton; 515 private javax.swing.JButton deleteTriggersOfContractButton; 516 private javax.swing.JButton editSearchNetConfigurationButton; 517 private javax.swing.JButton generateTriggersOfContractButton; 518 private javax.swing.JButton installBundleButton; 519 private javax.swing.JPanel jPanel1; 520 private javax.swing.JPanel jPanel2; 521 private javax.swing.JPanel jPanel3; 522 private javax.swing.JPanel jPanel4; 523 private javax.swing.JPanel jPanel5; 524 private javax.swing.JPanel jPanel6; 525 private javax.swing.JButton makeBundleInSharingPresentButton; 526 private javax.swing.JButton pullBundleButton; 527 private javax.swing.JButton pushBundleButton; 528 private javax.swing.JButton pushBundleOfferButton; 529 private javax.swing.JButton searchBundleButton; 530 private javax.swing.JButton shareBundleButton; 531 private javax.swing.JButton stopShareClientButton; 532 private javax.swing.JButton testPullBundleButton; 533 private javax.swing.JButton testPushBundleButton; 534 private javax.swing.JButton testPushBundleOfferButton; 535 private javax.swing.JButton uninstallBundleButton; 536 private javax.swing.JButton unshareBundleButton; 537 539 } 540 | Popular Tags |