예제 #1
0
 private void setDecodingNow(boolean decodingNow) {
   if (this.decodingNow != decodingNow) {
     this.decodingNow = decodingNow;
     if (decodingNow) {
       documentView.getProgressModel().increase();
     } else {
       documentView.getProgressModel().decrease();
     }
   }
 }
예제 #2
0
  /**
   * This method is called if this interceptor "wins the request". We intercepted creation of new
   * frames and loading of empty documents. Do it now.
   *
   * @param aURL describes the document
   * @param lArguments optional arguments for loading
   */
  private void impl_dispatch(
      /*IN*/ com.sun.star.util.URL aURL, /*IN*/ com.sun.star.beans.PropertyValue[] lArguments) {
    synchronized (this) {
      if (m_bDead) return;
    }

    if ((aURL.Complete.startsWith("slot:5300")) || (aURL.Complete.startsWith(".uno:Quit"))) {
      System.exit(0);
    } else if (aURL.Complete.startsWith("private:factory")) {
      // Create view frame for showing loaded documents on demand.
      // The visible state is necessary for JNI functionality to get the HWND and plug office
      // inside a java window hierarchy!
      DocumentView aNewView = new DocumentView();
      aNewView.setVisible(true);
      aNewView.createFrame();
      aNewView.load(aURL.Complete, lArguments);
    }
  }
예제 #3
0
 private void setBitmap(Bitmap bitmap) {
   if (bitmap != null && bitmap.getWidth() == -1 && bitmap.getHeight() == -1) {
     return;
   }
   if (this.bitmap != bitmap) {
     if (bitmap != null) {
       if (this.bitmap != null) {
         this.bitmap.recycle();
       }
       bitmapWeakReference = new SoftReference<Bitmap>(bitmap);
       documentView.postInvalidate();
     }
     this.bitmap = bitmap;
   }
 }
예제 #4
0
 private boolean thresholdHit() {
   float zoom = documentView.zoomModel.getZoom();
   int mainWidth = documentView.getWidth();
   float height = page.getPageHeight(mainWidth, zoom);
   return (mainWidth * zoom * height) / (treeNodeDepthLevel * treeNodeDepthLevel) > SLICE_SIZE;
 }
예제 #5
0
 private boolean isVisible() {
   return RectF.intersects(documentView.getViewRect(), getTargetRectF());
 }
예제 #6
0
 @Override
 public void run() {
   _view.refresh();
 }