Java 类javax.swing.colorchooser.DefaultColorSelectionModel 实例源码

项目:cn1    文件:JColorChooserTest.java   
public void testJColorChooser() throws Exception {
    assertSame(DefaultColorSelectionModel.class, ch.getSelectionModel().getClass());
    assertNull(ch.accessibleContext);
    assertEquals(Color.WHITE, ch.getColor());
    ch = new JColorChooser(Color.BLACK);
    assertEquals(Color.BLACK, ch.getColor());
    ColorSelectionModel model = new DefaultColorSelectionModel();
    ch = new JColorChooser(model);
    assertFalse(propertyChangeController.isChanged());
    assertSame(model, ch.getSelectionModel());
    assertSame(BorderLayout.class, ch.getLayout().getClass());
}
项目:cn1    文件:JColorChooserTest.java   
public void testSetGetSelectionModel() throws Exception {
    assertNotNull(ch.getSelectionModel());
    ColorSelectionModel oldModel = ch.getSelectionModel();
    ColorSelectionModel model = new DefaultColorSelectionModel();
    ch.setSelectionModel(model);
    assertTrue(propertyChangeController.isChanged(JColorChooser.SELECTION_MODEL_PROPERTY));
    assertSame(model, ((PropertyChangeEvent) propertyChangeController.getLastEvent())
            .getNewValue());
    assertSame(oldModel, ((PropertyChangeEvent) propertyChangeController.getLastEvent())
            .getOldValue());
    ch.setSelectionModel(null);
    assertNull(ch.getSelectionModel());
}
项目:cn1    文件:BasicColorChooserUITest.java   
public void testInstallUninstallListeners() throws Exception {
    ui.uninstallListeners();
    int propChangeListCount = ch.getPropertyChangeListeners().length;
    int changeListcount = ((DefaultColorSelectionModel) ch.getSelectionModel())
            .getChangeListeners().length;
    ui.installListeners();
    assertEquals(propChangeListCount + 1, ch.getPropertyChangeListeners().length);
    assertEquals(changeListcount + 1, ((DefaultColorSelectionModel) ch.getSelectionModel())
            .getChangeListeners().length);
    ui.uninstallListeners();
    assertEquals(propChangeListCount, ch.getPropertyChangeListeners().length);
    assertEquals(changeListcount, ((DefaultColorSelectionModel) ch.getSelectionModel())
            .getChangeListeners().length);
}
项目:freeVM    文件:JColorChooserTest.java   
public void testJColorChooser() throws Exception {
    assertSame(DefaultColorSelectionModel.class, ch.getSelectionModel().getClass());
    assertNull(ch.accessibleContext);
    assertEquals(Color.WHITE, ch.getColor());
    ch = new JColorChooser(Color.BLACK);
    assertEquals(Color.BLACK, ch.getColor());
    ColorSelectionModel model = new DefaultColorSelectionModel();
    ch = new JColorChooser(model);
    assertFalse(propertyChangeController.isChanged());
    assertSame(model, ch.getSelectionModel());
    assertSame(BorderLayout.class, ch.getLayout().getClass());
}
项目:freeVM    文件:JColorChooserTest.java   
public void testSetGetSelectionModel() throws Exception {
    assertNotNull(ch.getSelectionModel());
    ColorSelectionModel oldModel = ch.getSelectionModel();
    ColorSelectionModel model = new DefaultColorSelectionModel();
    ch.setSelectionModel(model);
    assertTrue(propertyChangeController.isChanged(JColorChooser.SELECTION_MODEL_PROPERTY));
    assertSame(model, ((PropertyChangeEvent) propertyChangeController.getLastEvent())
            .getNewValue());
    assertSame(oldModel, ((PropertyChangeEvent) propertyChangeController.getLastEvent())
            .getOldValue());
    ch.setSelectionModel(null);
    assertNull(ch.getSelectionModel());
}
项目:freeVM    文件:BasicColorChooserUITest.java   
public void testInstallUninstallListeners() throws Exception {
    ui.uninstallListeners();
    int propChangeListCount = ch.getPropertyChangeListeners().length;
    int changeListcount = ((DefaultColorSelectionModel) ch.getSelectionModel())
            .getChangeListeners().length;
    ui.installListeners();
    assertEquals(propChangeListCount + 1, ch.getPropertyChangeListeners().length);
    assertEquals(changeListcount + 1, ((DefaultColorSelectionModel) ch.getSelectionModel())
            .getChangeListeners().length);
    ui.uninstallListeners();
    assertEquals(propChangeListCount, ch.getPropertyChangeListeners().length);
    assertEquals(changeListcount, ((DefaultColorSelectionModel) ch.getSelectionModel())
            .getChangeListeners().length);
}
项目:freeVM    文件:JColorChooserTest.java   
public void testJColorChooser() throws Exception {
    assertSame(DefaultColorSelectionModel.class, ch.getSelectionModel().getClass());
    assertNull(ch.accessibleContext);
    assertEquals(Color.WHITE, ch.getColor());
    ch = new JColorChooser(Color.BLACK);
    assertEquals(Color.BLACK, ch.getColor());
    ColorSelectionModel model = new DefaultColorSelectionModel();
    ch = new JColorChooser(model);
    assertFalse(propertyChangeController.isChanged());
    assertSame(model, ch.getSelectionModel());
    assertSame(BorderLayout.class, ch.getLayout().getClass());
}
项目:freeVM    文件:JColorChooserTest.java   
public void testSetGetSelectionModel() throws Exception {
    assertNotNull(ch.getSelectionModel());
    ColorSelectionModel oldModel = ch.getSelectionModel();
    ColorSelectionModel model = new DefaultColorSelectionModel();
    ch.setSelectionModel(model);
    assertTrue(propertyChangeController.isChanged(JColorChooser.SELECTION_MODEL_PROPERTY));
    assertSame(model, ((PropertyChangeEvent) propertyChangeController.getLastEvent())
            .getNewValue());
    assertSame(oldModel, ((PropertyChangeEvent) propertyChangeController.getLastEvent())
            .getOldValue());
    ch.setSelectionModel(null);
    assertNull(ch.getSelectionModel());
}
项目:freeVM    文件:BasicColorChooserUITest.java   
public void testInstallUninstallListeners() throws Exception {
    ui.uninstallListeners();
    int propChangeListCount = ch.getPropertyChangeListeners().length;
    int changeListcount = ((DefaultColorSelectionModel) ch.getSelectionModel())
            .getChangeListeners().length;
    ui.installListeners();
    assertEquals(propChangeListCount + 1, ch.getPropertyChangeListeners().length);
    assertEquals(changeListcount + 1, ((DefaultColorSelectionModel) ch.getSelectionModel())
            .getChangeListeners().length);
    ui.uninstallListeners();
    assertEquals(propChangeListCount, ch.getPropertyChangeListeners().length);
    assertEquals(changeListcount, ((DefaultColorSelectionModel) ch.getSelectionModel())
            .getChangeListeners().length);
}
项目:javify    文件:JColorChooser.java   
/**
 * This method creates a new JColorChooser with the default initial color.
 */
public JColorChooser()
{
  this(new DefaultColorSelectionModel());
}
项目:binnavi    文件:CColorChooser.java   
public CColorChooser() {
  this(new DefaultColorSelectionModel(Color.WHITE), null);
}
项目:binnavi    文件:CColorChooser.java   
public CColorChooser(final Color initialColor) {
  this(new DefaultColorSelectionModel(initialColor), null);
}
项目:binnavi    文件:CColorChooser.java   
public CColorChooser(final Color initialColor, final Color[] recentColors) {
  this(new DefaultColorSelectionModel(initialColor), recentColors);
}
项目:jvm-stm    文件:JColorChooser.java   
/**
 * This method creates a new JColorChooser with the default initial color.
 */
public JColorChooser()
{
  this(new DefaultColorSelectionModel());
}
项目:cn1    文件:JColorChooser.java   
public JColorChooser() {
    this(new DefaultColorSelectionModel(Color.WHITE));
}
项目:cn1    文件:JColorChooser.java   
public JColorChooser(Color initialColor) {
    this(new DefaultColorSelectionModel(initialColor));
}
项目:JamVM-PH    文件:JColorChooser.java   
/**
 * This method creates a new JColorChooser with the default initial color.
 */
public JColorChooser()
{
  this(new DefaultColorSelectionModel());
}
项目:Teachingbox    文件:SettingsDialog.java   
public void stateChanged(ChangeEvent arg0) {
    DefaultColorSelectionModel cc = (DefaultColorSelectionModel)arg0.getSource();
    this.color = cc.getSelectedColor();
}
项目:classpath    文件:JColorChooser.java   
/**
 * This method creates a new JColorChooser with the default initial color.
 */
public JColorChooser()
{
  this(new DefaultColorSelectionModel());
}
项目:freeVM    文件:JColorChooser.java   
public JColorChooser() {
    this(new DefaultColorSelectionModel(Color.WHITE));
}
项目:freeVM    文件:JColorChooser.java   
public JColorChooser(Color initialColor) {
    this(new DefaultColorSelectionModel(initialColor));
}
项目:freeVM    文件:JColorChooser.java   
public JColorChooser() {
    this(new DefaultColorSelectionModel(Color.WHITE));
}
项目:freeVM    文件:JColorChooser.java   
public JColorChooser(Color initialColor) {
    this(new DefaultColorSelectionModel(initialColor));
}
项目:javify    文件:JColorChooser.java   
/**
 * This method creates a new JColorChooser with the given initial color.
 *
 * @param initial The initial color.
 */
public JColorChooser(Color initial)
{
  this(new DefaultColorSelectionModel(initial));
}
项目:jvm-stm    文件:JColorChooser.java   
/**
 * This method creates a new JColorChooser with the given initial color.
 *
 * @param initial The initial color.
 */
public JColorChooser(Color initial)
{
  this(new DefaultColorSelectionModel(initial));
}
项目:JamVM-PH    文件:JColorChooser.java   
/**
 * This method creates a new JColorChooser with the given initial color.
 *
 * @param initial The initial color.
 */
public JColorChooser(Color initial)
{
  this(new DefaultColorSelectionModel(initial));
}
项目:classpath    文件:JColorChooser.java   
/**
 * This method creates a new JColorChooser with the given initial color.
 *
 * @param initial The initial color.
 */
public JColorChooser(Color initial)
{
  this(new DefaultColorSelectionModel(initial));
}