Package javax.swing.plaf.metal

Examples of javax.swing.plaf.metal.MetalComboBoxIcon


   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    MetalComboBoxIcon icon = new MetalComboBoxIcon();
    harness.check(icon.getIconWidth(), 10);   
  }
View Full Code Here


   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    MetalComboBoxIcon icon = new MetalComboBoxIcon();
    harness.check(icon.getIconHeight(), 5);   
  }
View Full Code Here

    JComboBox cb = new JComboBox();
    cb.setFont(new Font("Dialog", Font.PLAIN, 24));
    MyMetalComboBoxUI ui = new MyMetalComboBoxUI();
    cb.setUI(ui);
    MetalComboBoxButton button = (MetalComboBoxButton) ui.getArrowButton();
    MetalComboBoxIcon icon = (MetalComboBoxIcon) button.getComboIcon();
    Insets insets = button.getInsets();
    int additionalWidth = insets.left + insets.right + 2;
    int additionalHeight = insets.top + insets.bottom + 2;
    int iconWidth = icon.getIconWidth() + 6// a margin = 6 by trial and
                                              // error
    FontMetrics fm = cb.getFontMetrics(cb.getFont());

    // the following width calculation is a guess.  We know the value
    // depends on the font size, and that it is relatively small, so after
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
    Icon icon = new MetalComboBoxIcon();
    MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon,
            new CellRendererPane(), new JList());
    harness.check(b.getComboIcon() == icon);   
  }
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
    Icon icon = new MetalComboBoxIcon();
    MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon,
            new CellRendererPane(), new JList());
    harness.check(b.getComboBox() == jcb);   
  }
View Full Code Here

  private void testConstructor1(TestHarness harness)
  {
    harness.checkPoint("MetalComboBoxButton(JComboBox, Icon, CellRendererPane, JList)");       
    JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
    Icon icon = new MetalComboBoxIcon();
    MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon,
            new CellRendererPane(), new JList());
    harness.check(b.getComboBox() == jcb);
    harness.check(b.getComboIcon() == icon);
    harness.check(!b.isIconOnly());
View Full Code Here

 
  private void testConstructor2(TestHarness harness)
  {
    harness.checkPoint("MetalComboBoxButton(JComboBox, Icon, boolean, CellRendererPane, JList)");       
    JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
    Icon icon = new MetalComboBoxIcon();
    MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon, true,
            new CellRendererPane(), new JList());
    harness.check(b.getComboBox() == jcb);
    harness.check(b.getComboIcon() == icon);
    harness.check(b.isIconOnly());
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
    Icon icon = new MetalComboBoxIcon();
    MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon,
            new CellRendererPane(), new JList());
    harness.check(!b.isIconOnly());
    b.setIconOnly(true);
    harness.check(b.isIconOnly());
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
    Icon icon1 = new MetalComboBoxIcon();
    MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon1,
            new CellRendererPane(), new JList());
    harness.check(b.isEnabled());
   
    b.setEnabled(false);
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    JComboBox jcb = new JComboBox(new Object[] {"A", "B", "C"});
    Icon icon1 = new MetalComboBoxIcon();
    Icon icon2 = MetalIconFactory.getHorizontalSliderThumbIcon();
    MetalComboBoxButton b = new MetalComboBoxButton(jcb, icon1,
            new CellRendererPane(), new JList());
    harness.check(b.getComboIcon() == icon1);
   
View Full Code Here

TOP

Related Classes of javax.swing.plaf.metal.MetalComboBoxIcon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.