当前位置: 首页>>代码示例>>Java>>正文


Java ColorChooserComponentFactory类代码示例

本文整理汇总了Java中javax.swing.colorchooser.ColorChooserComponentFactory的典型用法代码示例。如果您正苦于以下问题:Java ColorChooserComponentFactory类的具体用法?Java ColorChooserComponentFactory怎么用?Java ColorChooserComponentFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ColorChooserComponentFactory类属于javax.swing.colorchooser包,在下文中一共展示了ColorChooserComponentFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSetGetPreviewPanel

import javax.swing.colorchooser.ColorChooserComponentFactory; //导入依赖的package包/类
public void testSetGetPreviewPanel() throws Exception {
    ch.addPropertyChangeListener(propertyChangeController);
    assertNotNull(ch.getPreviewPanel());
    JButton button = new JButton();
    ch.setPreviewPanel(button);
    assertTrue(propertyChangeController.isChanged(JColorChooser.PREVIEW_PANEL_PROPERTY));
    assertSame(button, ch.getPreviewPanel());
    assertSame(button, ((PropertyChangeEvent) propertyChangeController.getLastEvent())
            .getNewValue());
    propertyChangeController.reset();
    ch.setPreviewPanel(null);
    assertTrue(propertyChangeController.isChanged(JColorChooser.PREVIEW_PANEL_PROPERTY));
    assertNotNull(ch.getPreviewPanel());
    assertSame(ColorChooserComponentFactory.getPreviewPanel().getClass(), ch
            .getPreviewPanel().getClass());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:JColorChooserTest.java

示例2: setPreviewPanel

import javax.swing.colorchooser.ColorChooserComponentFactory; //导入依赖的package包/类
public void setPreviewPanel(JComponent preview) {
    JComponent oldValue = previewPanel;
    if (preview == null) {
        previewPanel = ColorChooserComponentFactory.getPreviewPanel();
    } else {
        previewPanel = preview;
    }
    firePropertyChange(PREVIEW_PANEL_PROPERTY, oldValue, previewPanel);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:JColorChooser.java

示例3: installPreviewPanel

import javax.swing.colorchooser.ColorChooserComponentFactory; //导入依赖的package包/类
protected void installPreviewPanel() {
    if (chooser.getPreviewPanel() == null) {
        chooser.setPreviewPanel(ColorChooserComponentFactory.getPreviewPanel());
        chooser.getPreviewPanel().setForeground(model.getSelectedColor());
        
        return;
    }
    previewPanel.removeAll();
    previewPanel.add(chooser.getPreviewPanel());
    previewPanel.setBorder(BorderFactory.createTitledBorder(UIManager.getString("ColorChooser.previewText")));

    if (previewPanel.getParent() == null) {
        chooser.add(previewPanel, BorderLayout.SOUTH);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:BasicColorChooserUI.java

示例4: installPreviewPanel

import javax.swing.colorchooser.ColorChooserComponentFactory; //导入依赖的package包/类
/**
 * This method installs the preview panel for the JColorChooser.
 */
protected void installPreviewPanel()
{
  updatePreviewPanel(ColorChooserComponentFactory.getPreviewPanel());
}
 
开发者ID:vilie,项目名称:javify,代码行数:8,代码来源:BasicColorChooserUI.java

示例5: createDefaultChoosers

import javax.swing.colorchooser.ColorChooserComponentFactory; //导入依赖的package包/类
protected AbstractColorChooserPanel[] createDefaultChoosers() {
    return ColorChooserComponentFactory.getDefaultChooserPanels();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:BasicColorChooserUI.java

示例6: createDefaultChoosers

import javax.swing.colorchooser.ColorChooserComponentFactory; //导入依赖的package包/类
/**
 * This method creates the default chooser panels for the JColorChooser.
 *
 * @return The default chooser panels.
 */
protected AbstractColorChooserPanel[] createDefaultChoosers()
{
  return ColorChooserComponentFactory.getDefaultChooserPanels();
}
 
开发者ID:vilie,项目名称:javify,代码行数:10,代码来源:BasicColorChooserUI.java


注:本文中的javax.swing.colorchooser.ColorChooserComponentFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。