本文整理汇总了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());
}
示例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);
}
示例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);
}
}
示例4: installPreviewPanel
import javax.swing.colorchooser.ColorChooserComponentFactory; //导入依赖的package包/类
/**
* This method installs the preview panel for the JColorChooser.
*/
protected void installPreviewPanel()
{
updatePreviewPanel(ColorChooserComponentFactory.getPreviewPanel());
}
示例5: createDefaultChoosers
import javax.swing.colorchooser.ColorChooserComponentFactory; //导入依赖的package包/类
protected AbstractColorChooserPanel[] createDefaultChoosers() {
return ColorChooserComponentFactory.getDefaultChooserPanels();
}
示例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();
}