Package java.awt

Examples of java.awt.Container$GfxPrintAllVisitor


  /**
   * Detaches a <code>view</code> at the given location and size.
   */
  private void detachView(final View view, int x, int y, int width, int height) {
    JComponent component = (JComponent)view;
    Container parent = component.getParent();
    if (parent instanceof JViewport) {
      component = (JComponent)parent.getParent();
      parent = component.getParent();
    }
   
    // Replace component by a dummy label to find easily where to attach back the component
    JLabel dummyLabel = new JLabel();
    dummyLabel.setMaximumSize(new Dimension());
    dummyLabel.setName(view.getClass().getName());
    dummyLabel.setBorder(component.getBorder());
   
    if (parent instanceof JSplitPane) {
      JSplitPane splitPane = (JSplitPane)parent;
      splitPane.setDividerSize(0);
      if (splitPane.getLeftComponent() == component) {
        splitPane.setLeftComponent(dummyLabel);
        splitPane.setDividerLocation(0f);
      } else {
        splitPane.setRightComponent(dummyLabel);
        splitPane.setDividerLocation(1f);
      }
    } else {
      int componentIndex = parent.getComponentZOrder(component);
      parent.remove(componentIndex);
      parent.add(dummyLabel, componentIndex);
    }
   
    // Display view in a separate non modal dialog
    Window window = SwingUtilities.getWindowAncestor(this);
    if (!(window instanceof JFrame)) {
View Full Code Here


    JComponent dummyComponent = (JComponent)findChild(this, view.getClass().getName());
    if (dummyComponent != null) {
      JComponent component = (JComponent)view;
      Window window = SwingUtilities.getWindowAncestor(component);
      component.setBorder(dummyComponent.getBorder());     
      Container parent = dummyComponent.getParent();
      if (parent instanceof JSplitPane) {
        JSplitPane splitPane = (JSplitPane)parent;
        float dividerLocation = (Float)this.home.getVisualProperty(
            view.getClass().getName() + DETACHED_VIEW_DIVIDER_LOCATION_VISUAL_PROPERTY);
        splitPane.setDividerSize(UIManager.getInt("SplitPane.dividerSize"));
        splitPane.setDividerLocation(dividerLocation);
        if (splitPane.getLeftComponent() == dummyComponent) {
          splitPane.setLeftComponent(component);
        } else {
          splitPane.setRightComponent(component);
        }
      } else {
        int componentIndex = parent.getComponentZOrder(dummyComponent);
        parent.remove(componentIndex);
        parent.add(component, componentIndex);
      }
      window.dispose();
    }
  }
View Full Code Here

    getContentPane().setLayout(new BorderLayout());

    eventEntryDetail = new JEventEntryDetail(parent, entry);

    Container contentPane = getContentPane();
   
    contentPane.add(eventEntryDetail, BorderLayout.CENTER);
   
    pack();
    invalidate();
    setSize(new Dimension(w, h));
View Full Code Here

      super.addNotify();
      if (firstTime) {
        firstTime = false;

        // retrieve function identifier...
        Container c = this.getParent();
        while (c != null && ! (c instanceof Form)) {
          c = c.getParent();
        }
        if (c != null) {
          functionCode = ( (Form) c).getFunctionId();
        }
        final Form form = (Form)c;
View Full Code Here

        }
    }

    protected void initComponents() {

        Container main = getContentPane();

        textArea = new JTextArea();

        JPanel  buttons = new JPanel(new FlowLayout());
        JButton close   = new JButton("Close Gracefully");

        close.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                doClose();
            }
        });

        JButton create = new JButton("Add Row");

        create.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                doInsert();
            }
        });

        JButton list = new JButton("List Data");

        list.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                doListing();
            }
        });

        JButton kill = new JButton("Kill");

        kill.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });
        buttons.add(create);
        buttons.add(list);
        buttons.add(kill);
        buttons.add(close);
        main.add(new JScrollPane(textArea), BorderLayout.CENTER);
        main.add(buttons, BorderLayout.SOUTH);
    }
View Full Code Here

    }
    else
      panel.getPricesGrid().reloadData();

    try {
      Container parent = panel.getParent();
      while(parent!=null && !(parent instanceof InternalFrame))
        parent = parent.getParent();
      if (parent!=null) {
        ((InternalFrame)parent).setSelected(true);
        ((InternalFrame)parent).toFront();
      }
    }
View Full Code Here

      }
    });
   
    int pad = SBoxLayout.COMMON_PADDING;
    setLayout(new SBoxLayout(SBoxLayout.VERTICAL, pad));
    Container content = getContentPane();
    if (content instanceof JComponent) {
      ((JComponent) content).setBorder(BorderFactory.createEmptyBorder(pad, pad, pad, pad));
    }
   
    // Create the character area
View Full Code Here

       * Set the color to transparent so that the background panel shows
       * through.
       */
      optionPane.setOpaque(false);
      // Same for the parent container
      Container parent = optionPane.getParent();
      if (parent instanceof JComponent) {
        ((JComponent) parent).setOpaque(false);
        /*
         * This is a workaround for setOpaque not working correctly in
         * java 1.5 if the background color is not set. The color does
View Full Code Here

    pane.addComponentListener(new SplitPaneResizeListener(screen, splitPane));

    containerPanel = createContainerPanel();

    // Avoid panel drawing overhead
    final Container windowContent = SBoxLayout.createContainer(SBoxLayout.HORIZONTAL);
    mainFrame.getMainFrame().setContentPane(windowContent);

    // Finally add the left pane, and the games screen + chat combo
    // Make the panel take any horizontal resize
    windowContent.add(leftColumn, SBoxLayout.constraint(SLayout.EXPAND_X, SLayout.EXPAND_Y));
    leftColumn.setMinimumSize(new Dimension());

    /*
     * Put the splitpane and the container panel to a subcontainer to make
     * squeezing the window affect the left pane first rather than the right
     */
    JComponent rightSide = SBoxLayout.createContainer(SBoxLayout.HORIZONTAL);
    rightSide.add(splitPane, SBoxLayout.constraint(SLayout.EXPAND_Y));
    rightSide.add(containerPanel, SBoxLayout.constraint(SLayout.EXPAND_Y));
    rightSide.setMinimumSize(rightSide.getPreferredSize());
    windowContent.add(rightSide, SBoxLayout.constraint(SLayout.EXPAND_Y));

    /*
     * Handle focus assertion and window closing
     */
    mainFrame.getMainFrame().addWindowListener(new WindowAdapter() {
View Full Code Here

    Popup popup = super.getPopup(menu, x, y);
    /*
     * The menu should now have a parent, which is probably a JPanel, In
     * which case its borders need to be deleted.
     */
    Container parent = menu.getParent();
    if (parent instanceof JComponent) {
      ((JComponent) parent).setBorder(null);
    }
   
    return popup;
View Full Code Here

TOP

Related Classes of java.awt.Container$GfxPrintAllVisitor

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.