Example #1
0
    /**
     * Instructs the layout manager to perform the layout for the specified container.
     *
     * @param the Container for which this layout manager is being used
     */
    public void layoutContainer(Container parent) {
      JRootPane root = (JRootPane) parent;
      Rectangle b = root.getBounds();
      Insets i = root.getInsets();
      int nextY = 0;
      int w = b.width - i.right - i.left;
      int h = b.height - i.top - i.bottom;

      if (root.getLayeredPane() != null) {
        root.getLayeredPane().setBounds(i.left, i.top, w, h);
      }
      if (root.getGlassPane() != null) {
        root.getGlassPane().setBounds(i.left, i.top, w, h);
      }
      // Note: This is laying out the children in the layeredPane,
      // technically, these are not our children.
      if (root.getWindowDecorationStyle() != JRootPane.NONE
          && (root.getUI() instanceof RootPaneUI)) {
        JComponent titlePane = ((RootPaneUI) root.getUI()).getTitlePane();
        if (titlePane != null) {
          Dimension tpd = titlePane.getPreferredSize();
          if (tpd != null) {
            int tpHeight = tpd.height;
            titlePane.setBounds(0, 0, w, tpHeight);
            nextY += tpHeight;
          }
        }
      }

      if (root.getContentPane() != null) {

        root.getContentPane().setBounds(0, nextY, w, h < nextY ? 0 : h - nextY);
      }
    }
Example #2
0
  /**
   * Descripción de Método
   *
   * @param gc
   * @return
   */
  public boolean includeTab(GridController gc) {
    MTab imcludedMTab = gc.getMTab();

    if (m_mTab.getIncluded_Tab_ID() != imcludedMTab.getAD_Tab_ID()) {
      return false;
    }

    //

    vIncludedGC = gc;
    vIncludedGC.switchMultiRow();
    vIncludedGC.setRowSelectionAllowed(false);
    //

    Dimension size = getPreferredSize();

    srPane.setResizeWeight(.75); // top part gets 75%
    srPane.add(vIncludedGC, JSplitPane.BOTTOM);
    srPane.setBottomComponent(vIncludedGC);
    srPane.setDividerSize(5);

    //

    int height = 150;

    vIncludedGC.setPreferredSize(new Dimension(600, height));
    setPreferredSize(new Dimension(size.width, size.height + height));
    srPane.setDividerLocation(size.height);

    //

    imcludedMTab.setIncluded(true);
    imcludedMTab.query(false, 0);

    //

    JRootPane rt = SwingUtilities.getRootPane(this);

    if (rt == null) {
      System.out.println("Root pane null");
    } else {
      // System.out.println( "Root=" + rt );
      rt.addMouseListener(vIncludedGC);

      Component gp = rt.getGlassPane();

      if (gp == null) {
        System.out.println("No Glass Pane");
      } else {
        // System.out.println( "Glass=" + gp );
        gp.addMouseListener(vIncludedGC);
      }
    }

    vIncludedGC.addMouseListener(vIncludedGC);
    vIncludedGC.enableEvents(AWTEvent.HIERARCHY_EVENT_MASK + AWTEvent.MOUSE_EVENT_MASK);

    return true;
  } // IncludeTab
Example #3
0
 protected void show0() {
   JRootPane rp = null;
   if (getOwner() instanceof JFrame) {
     rp = ((JFrame) getOwner()).getRootPane();
   } else if (getOwner() instanceof JDialog) {
     rp = ((JDialog) getOwner()).getRootPane();
   }
   if (rp != null && !isDocumentModalitySupported() && !isExperimentalSheet()) {
     ownersGlassPane = rp.getGlassPane();
     JPanel blockingPanel = new JPanel();
     blockingPanel.setOpaque(false);
     rp.setGlassPane(blockingPanel);
     blockingPanel.setVisible(true);
   }
   super.show();
 }
Example #4
0
 protected void hide0() {
   JRootPane rp = null;
   if (getOwner() instanceof JFrame) {
     rp = ((JFrame) getOwner()).getRootPane();
   } else if (getOwner() instanceof JDialog) {
     rp = ((JDialog) getOwner()).getRootPane();
   }
   if (rp != null && !isDocumentModalitySupported() && !isExperimentalSheet()) {
     Component blockingComponent = rp.getGlassPane();
     blockingComponent.setVisible(false);
     if (ownersGlassPane != null) {
       rp.setGlassPane(ownersGlassPane);
       ownersGlassPane = null;
     }
   }
   super.hide();
 }