Java Code Examples for javax.swing.JLayeredPane#remove()

The following examples show how to use javax.swing.JLayeredPane#remove() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SlideOperationImpl.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void performOperation(JLayeredPane pane, Integer layer) {
    // XXX - TBD
    switch (type) {
        case SLIDE_IN:
            component.setBounds(finishBounds);
            pane.add(component, layer);
            if( isHeavyWeightShowing() ) {
                repaintLayeredPane();
            }
            break;
        case SLIDE_OUT:
            pane.remove(component);
            break;
        case SLIDE_RESIZE:
            component.setBounds(finishBounds);
            ((JComponent)component).revalidate();
            if( isHeavyWeightShowing() ) {
                repaintLayeredPane();
            }
            break;
    }
}
 
Example 2
Source File: LuckMetalRootPaneUI.java    From littleluck with Apache License 2.0 6 votes vote down vote up
protected void installTitlePane(JRootPane root, LuckTitlePanel titlePane, Window window)
{
    JLayeredPane layeredPane = root.getLayeredPane();

    JComponent oldTitlePane = getTitlePane();

    if (oldTitlePane != null)
    {
        oldTitlePane.setVisible(false);

        layeredPane.remove(oldTitlePane);
    }

    if (titlePane != null)
    {
    	titlePane.setOpaque(true);
    	
        layeredPane.add(titlePane, JLayeredPane.FRAME_CONTENT_LAYER);

        titlePane.setVisible(true);
    }

    this.titlePane = titlePane;
}
 
Example 3
Source File: BERootPaneUI.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
/**
 * Sets the window title pane -- the JComponent used to provide a plaf a
 * way to override the native operating system's window title pane with
 * one whose look and feel are controlled by the plaf.  The plaf creates
 * and sets this value; the default is null, implying a native operating
 * system window title pane.
 *
 * @param root the root
 * @param titlePane the title pane
 */
private void setTitlePane(JRootPane root, JComponent titlePane) 
{
	JLayeredPane layeredPane = root.getLayeredPane();
	JComponent oldTitlePane = getTitlePane();

	if (oldTitlePane != null)
	{
		oldTitlePane.setVisible(false);
		layeredPane.remove(oldTitlePane);
	}
	if (titlePane != null) 
	{
		layeredPane.add(titlePane, JLayeredPane.FRAME_CONTENT_LAYER);
		titlePane.setVisible(true);
	}
	this.titlePane = titlePane;
}
 
Example 4
Source File: SeaGlassRootPaneUI.java    From seaglass with Apache License 2.0 6 votes vote down vote up
/**
 * Sets the window title pane -- the JComponent used to provide a plaf a way
 * to override the native operating system's window title pane with one
 * whose look and feel are controlled by the plaf. The plaf creates and sets
 * this value; the default is null, implying a native operating system
 * window title pane.
 *
 * @param root      content the <code>JComponent</code> to use for the
 *                  window title pane.
 * @param titlePane the SeaGlassTitlePane.
 */
private void setTitlePane(JRootPane root, JComponent titlePane) {
    JLayeredPane layeredPane  = root.getLayeredPane();
    JComponent   oldTitlePane = getTitlePane();

    if (oldTitlePane != null) {
        oldTitlePane.setVisible(false);
        layeredPane.remove(oldTitlePane);
    }

    if (titlePane != null) {
        layeredPane.add(titlePane, JLayeredPane.FRAME_CONTENT_LAYER);
        titlePane.setVisible(true);
    }

    this.titlePane = titlePane;
}
 
Example 5
Source File: LightBoxPanel.java    From RipplePower with Apache License 2.0 6 votes vote down vote up
public void close() {

		Preconditions.checkState(SwingUtilities.isEventDispatchThread(), "Must be on the EDT");
		JLayeredPane layeredPane = Panels.getApplication().getLayeredPane();

		Component[] components = layeredPane.getComponents();

		if (components.length == 4 || components.length == 6) {
			layeredPane.remove(0);
		}

		if (components.length > 2 && components.length < 7) {
			layeredPane.remove(1);
			layeredPane.remove(0);
		}
		Panels.getApplication().validate();
		Panels.getApplication().repaint();

	}
 
Example 6
Source File: FlatRootPaneUI.java    From FlatLaf with Apache License 2.0 5 votes vote down vote up
protected void setTitlePane( FlatTitlePane newTitlePane ) {
	JLayeredPane layeredPane = rootPane.getLayeredPane();

	if( titlePane != null )
		layeredPane.remove( titlePane );

	if( newTitlePane != null )
		layeredPane.add( newTitlePane, TITLE_PANE_LAYER );

	titlePane = newTitlePane;
}
 
Example 7
Source File: ConsoleEditor.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void removeProgressIndicator() {
    if (lastLayeredPane == null || progressIndicator == null) {
        return;
    }
    progressIndicator.setVisible(false);
    JLayeredPane lp = lastLayeredPane;
    lp.remove(progressIndicator);
    lp.repaint();
    progressIndicator = null;
    
}
 
Example 8
Source File: StickyWindowSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Remove a sticky window from the editor.
 * @param window the JComponent to remove
 */
public void removeWindow(JComponent window) {
    Container container = jtc.getParent();
    if(container instanceof JLayeredPane) {
        JLayeredPane pane = (JLayeredPane) container;
        pane.remove(window);
        pane.repaint(window.getBounds());
    }
}