com.jidesoft.swing.ContentContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jide-oss Show documentation
Show all versions of jide-oss Show documentation
JIDE Common Layer (Professional Swing Components)
/*
* @(#)ContentContainer.java 5/5/2005
*
* Copyright 2002 - 2005 JIDE Software Inc. All rights reserved.
*/
package com.jidesoft.swing;
import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.plaf.UIDefaultsLookup;
import com.jidesoft.plaf.basic.ThemePainter;
import javax.swing.*;
import java.awt.*;
/**
* In JIDE Action Framework, ContentContainer
is the area that contains all command bars. It is also the
* largest area in the content pane of top level windows.
*
* ContentContainer
uses BasicPainter to paint the background. For example, under Office 2003 L&F, it will
* use gradient to paint the background.
*/
public class ContentContainer extends JPanel {
private ThemePainter _painter;
/**
* Creates a new JPanel
with a double buffer and a flow layout.
*/
public ContentContainer() {
setBorder(BorderFactory.createEmptyBorder());
setOpaque(true);
updateUI();
setFocusCycleRoot(false);
setFocusable(false);
}
@Override
public void updateUI() {
super.updateUI();
if (UIDefaultsLookup.get("Theme.painter") == null) {
LookAndFeelFactory.installJideExtension();
}
LookAndFeel.installColors(this, "ContentContainer.background", "ContentContainer.foreground");
_painter = (ThemePainter) UIDefaultsLookup.get("Theme.painter");
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (_painter != null && isOpaque()) {
_painter.paintContentBackground(this, g, new Rectangle(0, 0, getWidth(), getHeight()), SwingConstants.HORIZONTAL, ThemePainter.STATE_DEFAULT);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy