gpt4 book ai didi

com.sitewhere.rest.model.device.Zone.setOpacity()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 06:49:31 26 4
gpt4 key购买 nike

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

Zone.setOpacity介绍

暂无

代码示例

代码示例来源:origin: com.sitewhere/sitewhere-core

/**
 * Common code for copying information from an update request to an existing
 * zone.
 * 
 * @param request
 * @param target
 * @throws SiteWhereException
 */
public static void zoneUpdateLogic(IZoneCreateRequest request, Zone target) throws SiteWhereException {
target.setName(request.getName());
target.setBorderColor(request.getBorderColor());
target.setFillColor(request.getFillColor());
target.setOpacity(request.getOpacity());
target.getCoordinates().clear();
for (ILocation coordinate : request.getCoordinates()) {
  target.getCoordinates().add(coordinate);
}
if (request.getMetadata() != null) {
  target.getMetadata().clear();
  MetadataProvider.copy(request.getMetadata(), target);
}
SiteWherePersistence.setUpdatedEntityMetadata(target);
}

代码示例来源:origin: com.sitewhere/sitewhere-mongodb

target.setBorderColor(borderColor);
target.setFillColor(fillColor);
target.setOpacity(opacity);

代码示例来源:origin: com.sitewhere/sitewhere-core-api

/**
   * Create a copy of an SPI object. Used by web services for marshaling.
   * 
   * @param input
   * @return
   */
  public static Zone copy(IZone input) throws SiteWhereException {
  Zone result = new Zone();
  result.setToken(input.getToken());
  result.setSiteToken(input.getSiteToken());
  result.setName(input.getName());
  result.setCreatedDate(input.getCreatedDate());
  result.setBorderColor(input.getBorderColor());
  result.setFillColor(input.getFillColor());
  result.setOpacity(input.getOpacity());

  List<Location> coords = new ArrayList<Location>();
  for (ILocation location : input.getCoordinates()) {
    coords.add(Location.copy(location));
  }
  result.setCoordinates(coords);

  MetadataProviderEntity.copy(input, result);
  return result;
  }
}

代码示例来源:origin: com.sitewhere/sitewhere-core

/**
 * Common logic for creating a zone based on an incoming request.
 * 
 * @param source
 * @param siteToken
 * @param uuid
 * @return
 * @throws SiteWhereException
 */
public static Zone zoneCreateLogic(IZoneCreateRequest source, String siteToken, String uuid)
  throws SiteWhereException {
Zone zone = new Zone();
zone.setToken(uuid);
zone.setSiteToken(siteToken);
zone.setName(source.getName());
zone.setBorderColor(source.getBorderColor());
zone.setFillColor(source.getFillColor());
zone.setOpacity(source.getOpacity());
SiteWherePersistence.initializeEntityMetadata(zone);
MetadataProvider.copy(source.getMetadata(), zone);
for (ILocation coordinate : source.getCoordinates()) {
  zone.getCoordinates().add(coordinate);
}
return zone;
}

代码示例来源:origin: com.sitewhere/sitewhere-hbase

@Override
public Zone decodeZone(byte[] payload) throws SiteWhereException {
ByteArrayInputStream stream = new ByteArrayInputStream(payload);
try {
  ProtobufMarshaler.Zone pb = ProtobufMarshaler.Zone.parseFrom(stream);
  Zone zone = new Zone();
  zone.setToken(pb.getToken());
  zone.setSiteToken(pb.getSiteToken());
  zone.setName(pb.getName());
  for (ProtobufMarshaler.Location pbloc : pb.getCoordinatesList()) {
  Location location = new Location();
  location.setLatitude(pbloc.getLatitude());
  location.setLongitude(pbloc.getLongitude());
  if (pbloc.hasElevation()) {
    location.setElevation(pbloc.getElevation());
  }
  zone.getCoordinates().add(location);
  }
  zone.setBorderColor(pb.getBorderColor());
  zone.setFillColor(pb.getFillColor());
  zone.setOpacity(pb.getOpacity());
  loadEntityData(pb.getEntityData(), zone);
  return zone;
} catch (IOException e) {
  throw new SiteWhereException("Unable to unmarshal site.", e);
}
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com