Package org.cybergarage.upnp

Examples of org.cybergarage.upnp.Icon


  void updateIconList(TreeNode parentNode, Device device)
  {
    IconList iconList = device.getIconList();
    int nIcons = iconList.size();
    for (int n=0; n<nIcons; n++) {
      Icon icon = iconList.getIcon(n);
      String url = icon.getURL();
      TreeNode iconNode = new TreeNode(url);
      iconNode.setUserData(icon);
      parentNode.add(iconNode);
    }
  }
View Full Code Here


        return new TestSuite( IconTest.class );
    }

    public void testConstructorWithoutNode()
    {
      Icon icon = new Icon();
     
      String mimeType = "image/png";
      assertFalse(icon.hasMimeType());
      assertEquals("", icon.getMimeType());
      icon.setMimeType(mimeType);
      assertEquals(mimeType, icon.getMimeType());
      assertTrue(icon.hasMimeType());

      int width = 640;
      assertEquals(0, icon.getWidth());
      icon.setWidth(width);
      assertEquals(width, icon.getWidth());

      int height = 480;
      assertEquals(0, icon.getHeight());
      icon.setHeight(height);
      assertEquals(height, icon.getHeight());

      int depth = 24;
      assertEquals(0, icon.getDepth());
      icon.setDepth(depth);
      assertEquals(depth, icon.getDepth());

      String url = "/icon";
      assertFalse(icon.hasURL());
      assertEquals("", icon.getURL());
      icon.setURL(url);
      assertTrue(icon.hasURL());
      assertEquals(url, icon.getURL());
      assertTrue(icon.isURL(url));

      byte data[] = new byte[1];
      assertEquals(null, icon.getBytes());
      icon.setBytes(data);
      assertTrue(icon.hasBytes());
      assertTrue(icon.getBytes() != null);
    }
View Full Code Here

      assertTrue(icon.getBytes() != null);
    }

    public void testIconHasURL()
    {
      Icon icon = new Icon();
     
      assertFalse(icon.hasURL());
     
      icon.setURL(null);
      assertFalse(icon.hasURL());
     
      icon.setURL("");
      assertFalse(icon.hasURL());
     
      icon.setURL("/icon");
      assertTrue(icon.hasURL());
    }
View Full Code Here

        ServicePane servicePane = new ServicePane(ctrlPoint, service);
        setRightComponent(servicePane);
        return;
      }
      if (data instanceof Icon) {
        Icon icon = (Icon)data;
        IconTable iconTable = new IconTable(icon);
        setRightComponent(new TableComp(iconTable));
        return;
      }
      if (data instanceof Action) {
View Full Code Here

TOP

Related Classes of org.cybergarage.upnp.Icon

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.