Пример #1
0
 public String toKML(boolean suppressEnclosingTags) {
   String kml = "";
   if (!suppressEnclosingTags) {
     kml += "<ListStyle";
     if (this.id != null) {
       kml += " id=\"" + this.getId() + "\"";
     }
     if (this.targetId != null) {
       kml += " targetId=\"" + this.getTargetId() + "\"";
     }
     kml += ">\n";
   }
   kml += super.toKML(true);
   if (this.listItemType != null) {
     kml +=
         "<listItemType>"
             + SpecialCaseFormatter.toKMLString(this.listItemType)
             + "</listItemType>\n";
   }
   //      if(this.bgColor!=null)
   //      {
   //            kml+="<bgColor>"+SpecialCaseFormatter.toKMLString(this.bgColor)+"</bgColor>\n";
   //      }
   if (this.itemIcon != null) {
     kml += this.itemIcon.toKML();
   }
   if (!suppressEnclosingTags) {
     kml += "</ListStyle>\n";
   }
   return kml;
 }
Пример #2
0
 public String toUpdateKML(boolean suppressEnclosingTags) {
   if (!isDirty()) {
     return "";
   }
   String change = "";
   boolean isPrimDirty = isPrimitiveDirty(); // need to track it after object is setNotDirty
   if (isPrimDirty && !suppressEnclosingTags) {
     change += "<ListStyle";
     if (this.id != null) {
       change += " id=\"" + this.getId() + "\"";
     }
     if (this.targetId != null) {
       change += " targetId=\"" + this.getTargetId() + "\"";
     }
     change += ">\n";
   }
   change += super.toUpdateKML(true);
   if (this.listItemType != null && this.isListItemTypeDirty) {
     change +=
         "<listItemType>"
             + SpecialCaseFormatter.toKMLString(this.listItemType)
             + "</listItemType>\n";
     this.isListItemTypeDirty = false;
   }
   //        if(this.bgColor!=null && this.isBgColorDirty)
   //        {
   //            change+="<bgColor>"+SpecialCaseFormatter.toKMLString(this.bgColor)+"</bgColor>\n";
   //            this.isBgColorDirty = false;
   //        }
   if (this.itemIcon != null && this.itemIcon.isDirty()) {
     change += this.itemIcon.toUpdateKML();
   }
   if (isPrimDirty && !suppressEnclosingTags) {
     change += "</ListStyle>\n";
   }
   setNotDirty();
   return change;
 }