Package vg.core.request

Examples of vg.core.request.IUIRequestOwner


      }
    });
    gbc = new GridBagConstraints(1,31,10,0,  GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5)0,0);
    this.add(this.createTabButton,gbc);
    //create request owner
    this.owner = new IUIRequestOwner() {
      public void callRequestOwner(Object obj) {
      }
    };
  }
View Full Code Here


    // Set default style for vertexes
    currentGraph.setStylesheet(JGraphSettings.getStylesheet());
    JGraphSettings.addListner(settingListner);

    this.requestOwner = new IUIRequestOwner() {
      public void callRequestOwner(Object obj) {
        // TODO
      }
    };
View Full Code Here

              }
              VisualGraph.windowMessage.errorMessage("Fail.\nException : " + ex.getMessage(), "Thread error");
            }
          }
          try {
            IUIRequestOwner owner = bufInner.getOwner();
            if(owner != null) {
              owner.callRequestOwner(new AUIRequest(EUIRequestType.PASS, null){});
            }
          } catch(Throwable ex) {
            VisualGraph.log.printException(ex);
          }
        }
View Full Code Here

        AUIRequest request = (AUIRequest)arg;
        switch(request.getType()) {
          case DEF_CLOSE_CURRENT_TAB:
          {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            int index = this.tabs.getSelectedIndex();
            if(index >= 0) {
              for(Integer buf : this.comTabIdAndTab.keySet()) {
                Integer value = this.comTabIdAndTab.get(buf);
                if(value != null && value.equals(index)) {
                  closeTab(buf);
                  break;
                }
              }
            }
            // call request owner method (OK REQUEST)
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.OK, null) {});
            }
            break;
          }
          case DEF_CLOSE_TAB: {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            UIRequestCloseTab req = (UIRequestCloseTab)request;
            Set<Integer>tabSet = req.getTabSet();
            if(tabSet != null) {
              for(Integer buf : tabSet) {
                closeTab(buf);
              }
            }
            // call request owner method (OK REQUEST)
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.OK, null) {});
            }
            break;
          }
          case DEF_OPEN_SUB_GRAPH:
          {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            UIRequestOpenSubGraph req = (UIRequestOpenSubGraph)request;
            final IGraphView igv = req.getSubGraphView();
            SwingUtilities.invokeLater(new Runnable() {
              public void run() {
                if(igv != null) {
                  addTab(igv.getTitle(), igv);
                }         
              }
            });
            // call request owner method (OK REQUEST)
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.OK, null) {});
            }
            break;
          }
          case DEF_SELECT_TAB:
          {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            UIRequestSelectTab req = (UIRequestSelectTab)request;
            final Integer tabId = req.getTabId();
            // find tab
            SwingUtilities.invokeLater(new Runnable() {
              public void run() {
                tabs.setSelectedIndex(DesktopPanel.this.comTabIdAndTab.get(tabId));
              }
            });
            // call request owner method (OK REQUEST)
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.OK, null) {});
            }
            break;
          }
          case DEF_REPLACE_CURRENT_TAB:
          {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            UIRequestReplaceCurrentTab req = (UIRequestReplaceCurrentTab)request;
            int index = this.tabs.getSelectedIndex();
            if(index >= 0) {
              for(Integer buf : this.comTabIdAndTab.keySet()) {
                Integer value = this.comTabIdAndTab.get(buf);
                if(value != null && value.equals(index)) {
                  closeTab(buf);
                  IGraphView igv = req.getSubGraphView();
                  if(igv != null) {
                    addTab(igv.getTitle(), igv);
                  }
                  break;
                }
              }
            }
            // call request owner method (OK REQUEST)
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.OK, null) {});
            }
            break;
          }         
        }
      }
View Full Code Here

    this.closeTabMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_DOWN_MASK));

    this.closeAllTabMenuItem = new JMenuItem("Close all tabs");
    //this.closeAllTabMenuItem.setIcon(new ImageIcon("./data/resources/textures/closeTab.png"));
    // init listeners
    this.owner = new IUIRequestOwner() {
      public void callRequestOwner(Object obj) {
      }
    };
    this.closeTabMenuItem.addActionListener(new ActionListener() {   
      public void actionPerformed(ActionEvent e) {
View Full Code Here

TOP

Related Classes of vg.core.request.IUIRequestOwner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.