org.fourthline.cling.model.meta.Device.getIcons()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.fourthline.cling.model.meta.Device.getIcons()方法的一些代码示例,展示了Device.getIcons()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.getIcons()方法的具体详情如下:
包路径:org.fourthline.cling.model.meta.Device
类名称:Device
方法名:getIcons

Device.getIcons介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

public boolean hasIcons() {
  return getIcons() != null && getIcons().length > 0;
}

代码示例来源:origin: 4thline/cling

public Icon[] findIcons() {
  List<Icon> icons = new ArrayList<>();
  if (hasIcons()) {
    icons.addAll(Arrays.asList(getIcons()));
  }
  D[] embeddedDevices = findEmbeddedDevices();
  for (D embeddedDevice : embeddedDevices) {
    if (embeddedDevice.hasIcons()) {
      icons.addAll(Arrays.asList(embeddedDevice.getIcons()));
    }
  }
  return icons.toArray(new Icon[icons.size()]);
}

代码示例来源:origin: 4thline/cling

protected Icon findUsableIcon(Device device) {
  // Needs to be certain format and size
  for (Object o : device.getIcons()) {
    Icon icon = (Icon) o;
    if (icon.getWidth() <= 64 && icon.getHeight() <= 64 && isUsableImageType(icon.getMimeType()))
      return icon;
  }
  return null;
}

代码示例来源:origin: kingthy/TVRemoteIME

public boolean hasIcons() {
  return getIcons() != null && getIcons().length > 0;
}

代码示例来源:origin: 4thline/cling

protected void generateIconList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement) {
  if (!deviceModel.hasIcons()) return;
  Element iconListElement = appendNewElement(descriptor, deviceElement, ELEMENT.iconList);
  for (Icon icon : deviceModel.getIcons()) {
    Element iconElement = appendNewElement(descriptor, iconListElement, ELEMENT.icon);
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.mimetype, icon.getMimeType());
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.width, icon.getWidth());
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.height, icon.getHeight());
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.depth, icon.getDepth());
    if (deviceModel instanceof RemoteDevice) {
      appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url,  icon.getUri());
    } else if (deviceModel instanceof LocalDevice) {
      appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url,  namespace.getIconPath(icon));
    }
  }
}

代码示例来源:origin: kingthy/TVRemoteIME

public Icon[] findIcons() {
  List<Icon> icons = new ArrayList();
  if (hasIcons()) {
    icons.addAll(Arrays.asList(getIcons()));
  }
  D[] embeddedDevices = findEmbeddedDevices();
  for (D embeddedDevice : embeddedDevices) {
    if (embeddedDevice.hasIcons()) {
      icons.addAll(Arrays.asList(embeddedDevice.getIcons()));
    }
  }
  return icons.toArray(new Icon[icons.size()]);
}

代码示例来源:origin: 4thline/cling

for (Icon icon : device.getIcons()) {
  deviceNode.add(new DefaultMutableTreeNode(icon));

代码示例来源:origin: org.fourthline.cling/cling-core

public boolean hasIcons() {
  return getIcons() != null && getIcons().length > 0;
}

代码示例来源:origin: kingthy/TVRemoteIME

protected void generateIconList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement) {
  if (!deviceModel.hasIcons()) return;
  Element iconListElement = appendNewElement(descriptor, deviceElement, ELEMENT.iconList);
  for (Icon icon : deviceModel.getIcons()) {
    Element iconElement = appendNewElement(descriptor, iconListElement, ELEMENT.icon);
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.mimetype, icon.getMimeType());
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.width, icon.getWidth());
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.height, icon.getHeight());
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.depth, icon.getDepth());
    if (deviceModel instanceof RemoteDevice) {
      appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url,  icon.getUri());
    } else if (deviceModel instanceof LocalDevice) {
      appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url,  namespace.getIconPath(icon));
    }
  }
}

代码示例来源:origin: org.fourthline.cling/cling-core

public Icon[] findIcons() {
  List<Icon> icons = new ArrayList<>();
  if (hasIcons()) {
    icons.addAll(Arrays.asList(getIcons()));
  }
  D[] embeddedDevices = findEmbeddedDevices();
  for (D embeddedDevice : embeddedDevices) {
    if (embeddedDevice.hasIcons()) {
      icons.addAll(Arrays.asList(embeddedDevice.getIcons()));
    }
  }
  return icons.toArray(new Icon[icons.size()]);
}

代码示例来源:origin: org.fourthline.cling/cling-core

protected void generateIconList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement) {
  if (!deviceModel.hasIcons()) return;
  Element iconListElement = appendNewElement(descriptor, deviceElement, ELEMENT.iconList);
  for (Icon icon : deviceModel.getIcons()) {
    Element iconElement = appendNewElement(descriptor, iconListElement, ELEMENT.icon);
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.mimetype, icon.getMimeType());
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.width, icon.getWidth());
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.height, icon.getHeight());
    appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.depth, icon.getDepth());
    if (deviceModel instanceof RemoteDevice) {
      appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url,  icon.getUri());
    } else if (deviceModel instanceof LocalDevice) {
      appendNewElementIfNotNull(descriptor, iconElement, ELEMENT.url,  namespace.getIconPath(icon));
    }
  }
}

相关文章