コード例 #1
0
  @Override
  protected void doRender(DrawContext dc) {
    if (this.frameTimestamp != dc.getFrameTimeStamp()) {
      this.assembleControlPoints(dc);
      this.frameTimestamp = dc.getFrameTimeStamp();
    }

    this.markerRenderer.render(dc, this.controlPoints);

    if (this.annotation != null && isShowAnnotation()) {
      this.annotation.render(dc);
    }
  }
コード例 #2
0
 /**
  * Compute label geometry, if it has not already been computed this frame, or if the label
  * position has changed since the extent was last computed.
  *
  * @param dc Current geometry.
  */
 protected void computeGeometryIfNeeded(DrawContext dc) {
   // Re-use rendering state values already calculated this frame. If the screenExtent is null,
   // recompute even if
   // the timestamp is the same. This prevents using a stale position if the application calls
   // setPosition and
   // getBounds multiple times before the label is rendered.
   long timeStamp = dc.getFrameTimeStamp();
   if (timeStamp != this.frameTimeStamp || this.screenExtent == null) {
     this.computeGeometry(dc);
     this.frameTimeStamp = timeStamp;
   }
 }