Package javax.swing

Examples of javax.swing.RootPaneContainer


      // To force a recalculation. This normally shouldn't be needed.
        addCtrlAccel(KeyEvent.VK_R, ACTION_RECALCULATE, new RecalculateAction());
    }

    private void addCtrlAccel(int vk, String actionConstant, Action action) {
    RootPaneContainer root = (RootPaneContainer)container;
    InputMap inputMap = root.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    KeyStroke key = KeyStroke.getKeyStroke(vk, InputEvent.CTRL_MASK);
    inputMap.put(key, actionConstant);
    if (action == null)
      action = menuManager.getActionFromId(actionConstant);
    root.getRootPane().getActionMap().put(actionConstant, action);
  }
View Full Code Here


        }

        protected void setLayersTransparent(Window w, boolean transparent) {
            Color bg = transparent ? new Color(0, 0, 0, 0) : null;
            if (w instanceof RootPaneContainer) {
                RootPaneContainer rpc = (RootPaneContainer)w;
                JRootPane root = rpc.getRootPane();
                JLayeredPane lp = root.getLayeredPane();
                Container c = root.getContentPane();
                JComponent content =
                    (c instanceof JComponent) ? (JComponent)c : null;
                if (transparent) {
View Full Code Here

       
        private OSXTransparentContent installTransparentContent(Window w) {
            OSXTransparentContent content;
            if (w instanceof RootPaneContainer) {
                // TODO: replace layered pane instead?
                final RootPaneContainer rpc = (RootPaneContainer)w;
                Container oldContent = rpc.getContentPane();
                if (oldContent instanceof OSXTransparentContent) {
                    content = (OSXTransparentContent)oldContent;
                }
                else {
                    content = new OSXTransparentContent(oldContent);
                    // TODO: listen for content pane changes
                    rpc.setContentPane(content);
                }
            }
            else {
                Component oldContent = w.getComponentCount() > 0 ? w.getComponent(0) : null;
                if (oldContent instanceof OSXTransparentContent) {
View Full Code Here

  private static List<RootPaneContainer> getRootPaneContainers(String groupId) {
  List<RootPaneContainer> list = new ArrayList<RootPaneContainer>();
  for (Controller controller : Application.getControllerManager().getAll()) {
    if (controller.getGroupId().equals(groupId)) {
    DefaultController<?> c = (DefaultController<?>) controller;
    RootPaneContainer rootPane = c.getRootPaneContainer();
    if (rootPane != null && list.contains(rootPane) == false) {
      list.add(rootPane);
    }
    }
  }
View Full Code Here

  }

  @Override
  public void addModal(Component component, ModalListener listener,
             Integer modalDepth) {
  RootPaneContainer rootPane = getRootPaneContainer();
  if (rootPane == null) {
    return;
  }

  if (rootPane instanceof JFrame) {
    Modal.addModal((JFrame) rootPane, component, listener, modalDepth);
  } else if (rootPane instanceof JDialog) {
    Modal.addModal((JDialog) rootPane, component, listener, modalDepth);
  } else if (rootPane instanceof JInternalFrame) {
    Modal
      .addModal((JInternalFrame) rootPane, component, listener, modalDepth);
  } else {
    return;
  }

  List<RootPaneContainer> rootPanes = getRootPaneContainers(getGroupId());
  // TODO amarrado a defaultcontroller
  if (getModalGroupName() != null) {
    String groupName = getModalGroupName().toLowerCase();
    for (Controller controller : Application.getControllerManager().getAll()) {
    if (controller.getModalGroupName() != null) {
      String groupNameTemp = controller.getModalGroupName().toLowerCase();
      if (groupName.equals(groupNameTemp)) {
      DefaultController<?> c = (DefaultController<?>) controller;
      RootPaneContainer rootPaneTemp = c.getRootPaneContainer();
      if (rootPaneTemp != null
        && rootPanes.contains(rootPaneTemp) == false) {
        rootPanes.add(rootPaneTemp);
      }
      }
View Full Code Here

   *
   * @return Component
   */
  @Override
  public Component getCurrentModal() {
  RootPaneContainer rootPane = getRootPaneContainer();
  if (rootPane != null) {
    if (rootPane instanceof JFrame) {
    return Modal.getCurrentModal((JFrame) rootPane);
    } else if (rootPane instanceof JDialog) {
    return Modal.getCurrentModal((JDialog) rootPane);
View Full Code Here

  /**
   * Close the current modal.
   */
  public void closeCurrentModal() {
  RootPaneContainer rootPane = getRootPaneContainer();
  if (rootPane != null) {
    if (rootPane instanceof JFrame) {
    Modal.closeCurrentModal((JFrame) rootPane);
    } else if (rootPane instanceof JDialog) {
    Modal.closeCurrentModal((JDialog) rootPane);
View Full Code Here

  Modal.closeModal(component);
  }

  @Override
  public void closeAllModals() {
  RootPaneContainer rootPane = getRootPaneContainer();
  if (rootPane != null) {
    if (rootPane instanceof JFrame) {
    JFrame frame = (JFrame) rootPane;
    Modal.closeAllModals(frame);
    } else if (rootPane instanceof JDialog) {
View Full Code Here

  }
  }

  @Override
  public boolean hasModal() {
  RootPaneContainer rootPane = getRootPaneContainer();
  if (rootPane == null) {
    return false;
  }

  if (rootPane instanceof JFrame) {
View Full Code Here

   * @param component
   *          the modal's component
   */
  public static void closeModal(Component component) {
  synchronized (modals) {
    RootPaneContainer frame = null;
    Modal modal = null;

    Iterator<Entry<RootPaneContainer, Modal>> it =
      modals.entrySet().iterator();
    while (it.hasNext()) {
View Full Code Here

TOP

Related Classes of javax.swing.RootPaneContainer

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.