コード例 #1
0
  /**
   * Initiates a retrieval of the model referenced by this placemark. Once the resource is retrieved
   * and loaded, this calls <code>{@link #setColladaRoot(ColladaRoot)}</code> to specify this link's
   * new network resource, and sends an <code>
   * {@link gov.nasa.worldwind.avlist.AVKey#RETRIEVAL_STATE_SUCCESSFUL}</code> property change event
   * to this link's property change listeners.
   *
   * <p>This does nothing if this <code>KMLNetworkLink</code> has no <code>KMLLink</code>.
   *
   * @param address the address of the resource to retrieve
   */
  protected void retrieveModel(String address) throws IOException, XMLStreamException {
    Object o = this.parent.getRoot().resolveReference(address);
    if (o == null) return;

    ColladaRoot root = ColladaRoot.createAndParse(o);
    if (root == null) return;

    this.setColladaRoot(root);
    this.resourceRetrievalTime.set(System.currentTimeMillis());
    this.parent.getRoot().requestRedraw();
  }
コード例 #2
0
  /**
   * {@inheritDoc} Overridden to set the link expiration time based on HTTP headers after the image
   * has been retrieved.
   */
  protected BasicWWTexture initializeTexture() {
    BasicWWTexture ret = super.initializeTexture();
    if (this.texture != null) {
      this.iconRetrievalTime = System.currentTimeMillis();

      String path = this.resolveHref();

      // Query the KMLRoot for the expiration time.
      long expiration = this.parent.getRoot().getExpiration(path);

      // Set the Icon's expiration. This has no effect if the refreshMode is not onExpire.
      this.parent.getIcon().setExpirationTime(expiration);
    }
    return ret;
  }