本文整理汇总了Java中org.jdesktop.swingx.JXTitledPanel类的典型用法代码示例。如果您正苦于以下问题:Java JXTitledPanel类的具体用法?Java JXTitledPanel怎么用?Java JXTitledPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JXTitledPanel类属于org.jdesktop.swingx包,在下文中一共展示了JXTitledPanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addMetalDefaults
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void addMetalDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
super.addMetalDefaults(addon, defaults);
if (isPlastic()) {
defaults.add("JXTitledPanel.titleForeground", new ColorUIResource(Color.WHITE));
defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>(
new MattePainter(new GradientPaint(0, 0, new Color(49, 121, 242),
0, 1, new Color(198, 211, 247)), true)));
} else {
defaults.add("JXTitledPanel.titleForeground", new ColorUIResource(Color.WHITE));
defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>(
new MattePainter(new GradientPaint(0, 0,
MetalLookAndFeel.getCurrentTheme().getPrimaryControl(), 0, 1,
MetalLookAndFeel.getCurrentTheme().getPrimaryControlDarkShadow()),true)));
}
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:TitledPanelAddon.java
示例2: addWindowsDefaults
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
@Override
protected void addWindowsDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
super.addWindowsDefaults(addon, defaults);
// JW: hot fix for #291-swingx
// was tracked down by Neil Weber - the requested colors are not available in
// all LFs, so changed to fall-back to something real
// don't understand why this has blown when trying to toggle to Metal...
// definitely needs deeper digging
// kgs: moved to using getSafeXXX from UIManagerExt
defaults.add("JXTitledPanel.titleForeground", UIManagerExt.getSafeColor(
"InternalFrame.activeTitleForeground", new ColorUIResource(Color.WHITE)));
defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>(
new MattePainter(new GradientPaint(0, 0, UIManagerExt.getSafeColor(
"InternalFrame.inactiveTitleGradient", new ColorUIResource(49, 121, 242)),
0, 1, UIManagerExt.getSafeColor( "InternalFrame.activeTitleBackground",
new ColorUIResource(198, 211, 247))), true)));
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:20,代码来源:TitledPanelAddon.java
示例3: installComponents
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
protected void installComponents(JXTitledPanel titledPanel) {
topPanel.add(caption, new GridBagConstraints(1, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST,
GridBagConstraints.HORIZONTAL, getCaptionInsets(), 0, 0));
if (titledPanel.getClientProperty(JXTitledPanel.RIGHT_DECORATION) instanceof JComponent) {
setRightDecoration((JComponent) titledPanel.getClientProperty(JXTitledPanel.RIGHT_DECORATION));
}
if (titledPanel.getClientProperty(JXTitledPanel.LEFT_DECORATION) instanceof JComponent) {
setLeftDecoration((JComponent) titledPanel.getClientProperty(JXTitledPanel.LEFT_DECORATION));
}
// swingx#500
if (!(titledPanel.getLayout() instanceof BorderLayout)){
titledPanel.setLayout(new BorderLayout());
}
titledPanel.add(topPanel, BorderLayout.NORTH);
// fix #1063-swingx: must respect custom border
if (SwingXUtilities.isUIInstallable(titledPanel.getBorder())) {
// use uiresource border
// old was: BorderFactory.createRaisedBevelBorder());
titledPanel.setBorder(BorderUIResource.getRaisedBevelBorderUIResource());
}
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:BasicTitledPanelUI.java
示例4: installListeners
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
protected void installListeners(final JXTitledPanel titledPanel) {
titleChangeListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("title")) {
caption.setText((String)evt.getNewValue());
} else if (evt.getPropertyName().equals("titleForeground")) {
caption.setForeground((Color)evt.getNewValue());
} else if (evt.getPropertyName().equals("titleFont")) {
caption.setFont((Font)evt.getNewValue());
} else if ("titlePainter".equals(evt.getPropertyName())) {
topPanel.setBackgroundPainter(titledPanel.getTitlePainter());
topPanel.repaint();
}
}
};
titledPanel.addPropertyChangeListener(titleChangeListener);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:BasicTitledPanelUI.java
示例5: installListeners
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
protected void installListeners(final JXTitledPanel titledPanel) {
titleChangeListener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("title")) {
caption.setText((String)evt.getNewValue());
} else if (evt.getPropertyName().equals("titleForeground")) {
caption.setForeground((Color)evt.getNewValue());
} else if (evt.getPropertyName().equals("titleFont")) {
caption.setFont((Font)evt.getNewValue());
} else if ("titlePainter".equals(evt.getPropertyName())) {
topPanel.setBackgroundPainter(titledPanel.getTitlePainter());
topPanel.repaint();
}
}
};
titledPanel.addPropertyChangeListener(titleChangeListener);
}
开发者ID:sing-group,项目名称:aibench-project,代码行数:18,代码来源:BasicTitledPanelUI.java
示例6: addBasicDefaults
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
@Override
protected void addBasicDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
super.addBasicDefaults(addon, defaults);
defaults.add(JXTitledPanel.uiClassID, "org.jdesktop.swingx.plaf.basic.BasicTitledPanelUI");
defaults.add("JXTitledPanel.titleFont", UIManagerExt.getSafeFont("Button.font",
new FontUIResource("Dialog", Font.PLAIN, 12)));
defaults.add("JXTitledPanel.titleForeground", new ColorUIResource(Color.WHITE));
defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>(
new MattePainter(
new GradientPaint(0, 0, Color.LIGHT_GRAY, 0, 1, Color.GRAY), true)));
defaults.add("JXTitledPanel.captionInsets", new InsetsUIResource(4, 12, 4, 12));
defaults.add("JXTitledPanel.rightDecorationInsets", new InsetsUIResource(1,1,1,1));
defaults.add("JXTitledPanel.leftDecorationInsets", new InsetsUIResource(1,1,1,1));
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:16,代码来源:TitledPanelAddon.java
示例7: createAndConfigureTopPanel
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
protected JXPanel createAndConfigureTopPanel(JXTitledPanel titledPanel) {
JXPanel topPanel = new JXPanel();
topPanel.setBackgroundPainter(titledPanel.getTitlePainter());
topPanel.setBorder(BorderFactory.createEmptyBorder());
topPanel.setLayout(new GridBagLayout());
topPanel.setOpaque(false);
return topPanel;
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:9,代码来源:BasicTitledPanelUI.java
示例8: createAndConfigureCaption
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
protected JLabel createAndConfigureCaption(final JXTitledPanel titledPanel) {
JLabel caption = new JLabel(titledPanel.getTitle()){
//#501
@Override
public void updateUI(){
super.updateUI();
setForeground(titledPanel.getTitleForeground());
setFont(titledPanel.getTitleFont());
}
};
caption.setFont(titledPanel.getTitleFont());
caption.setForeground(titledPanel.getTitleForeground());
return caption;
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:15,代码来源:BasicTitledPanelUI.java
示例9: createTitledPanel
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
public static JXTitledPanel createTitledPanel(final String title, final JComponent content) {
final JXTitledPanel titlePanel = new JXTitledPanel(title, content);
titlePanel.setFocusable(false);
titlePanel.setTitlePainter((graphics2D, panel, width, height) -> {
graphics2D.setColor(WidgetUtils.BG_COLOR_LESS_DARK);
graphics2D.fillRect(0, 0, width, height);
});
return titlePanel;
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:11,代码来源:WidgetFactory.java
示例10: ProgressInformationPanel
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
public ProgressInformationPanel(final boolean running) {
super(WidgetUtils.COLOR_DEFAULT_BACKGROUND);
setLayout(new BorderLayout());
_tableProgressInformationPanels = new ConcurrentHashMap<>();
_progressTimingCounters = new ConcurrentHashMap<>();
_stopWatch = Stopwatch.createUnstarted();
_executionLogTextArea = new JTextArea();
_executionLogTextArea.setText("--- DataCleaner progress information user-log ---");
_executionLogTextArea.setEditable(false);
_executionLogTextArea.setBackground(WidgetUtils.COLOR_DEFAULT_BACKGROUND);
_progressBarPanel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND);
_progressBarPanel.setLayout(new VerticalLayout(4));
final JXTaskPane progressTaskPane = WidgetFactory.createTaskPane("Progress", IconUtils.ACTION_EXECUTE);
progressTaskPane.add(_progressBarPanel);
final JXTitledPanel executionLogPanel =
WidgetFactory.createTitledPanel("Execution log", WidgetUtils.scrolleable(_executionLogTextArea));
executionLogPanel.setBorder(new MatteBorder(1, 1, 1, 1, WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND));
final DCTaskPaneContainer taskPaneContainer = WidgetFactory.createTaskPaneContainer();
taskPaneContainer.setLayout(new BorderLayout(MARGIN, MARGIN));
if (running) {
taskPaneContainer.add(progressTaskPane, BorderLayout.NORTH);
}
setBorder(new MatteBorder(0, 0, MARGIN, 0, WidgetUtils.COLOR_DEFAULT_BACKGROUND));
taskPaneContainer.add(executionLogPanel, BorderLayout.CENTER);
add(taskPaneContainer, BorderLayout.CENTER);
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:32,代码来源:ProgressInformationPanel.java
示例11: installDefaults
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
protected void installDefaults(JXTitledPanel titledPanel) {
installProperty(titledPanel, "titlePainter", UIManager.get("JXTitledPanel.titlePainter"));
installProperty(titledPanel, "titleForeground", UIManager.getColor("JXTitledPanel.titleForeground"));
installProperty(titledPanel, "titleFont", UIManager.getFont("JXTitledPanel.titleFont"));
LookAndFeel.installProperty(titledPanel, "opaque", false);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:7,代码来源:BasicTitledPanelUI.java
示例12: uninstallDefaults
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
protected void uninstallDefaults(JXTitledPanel titledPanel) {
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:3,代码来源:BasicTitledPanelUI.java
示例13: uninstallComponents
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
protected void uninstallComponents(JXTitledPanel titledPanel) {
titledPanel.remove(topPanel);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:4,代码来源:BasicTitledPanelUI.java
示例14: uninstallListeners
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
protected void uninstallListeners(JXTitledPanel titledPanel) {
titledPanel.removePropertyChangeListener(titleChangeListener);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:4,代码来源:BasicTitledPanelUI.java
示例15: initComponents
import org.jdesktop.swingx.JXTitledPanel; //导入依赖的package包/类
private void initComponents() {
setLayout(new BorderLayout());
titledPanel = new JXTitledPanel() {
/**
* @inherited <p>
*
* Overridden to adjust to size requirements of invisible cards.
*/
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
Dimension child = getContentContainer().getPreferredSize();
int width = child.width;
for (JComponent card : cards) {
if (card != getContentContainer()) {
Dimension cardDim = card.getPreferredSize();
width = Math.max(width, cardDim.width);
}
}
if (width > child.width) {
dim.width += width - child.width;
}
return dim;
}
};
titledPanel.setName("titledPanel");
prevButton = new JButton();
prevButton.setName("previousButton");
nextButton = new JButton();
nextButton.setName("nextButton");
JComponent firstCard = createFirstCard();
firstCard.setName("firstCard");
titledPanel.setContentContainer(firstCard);
JComponent secondCard = createSecondCard();
secondCard.setName("secondCard");
JComponent thirdCard = createThirdCard();
thirdCard.setName("thirdCard");
cards = new ArrayList<JComponent>();
cards.add(firstCard);
cards.add(secondCard);
cards.add(thirdCard);
add(titledPanel);
// panel4 = new JXTitledPanel("Image");
// //TODO add image
// add(panel4);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:58,代码来源:TitledPanelDemo.java
注:本文中的org.jdesktop.swingx.JXTitledPanel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论