Пример #1
0
  /* (non-Javadoc)
   * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
   */
  protected void paintComponent(Graphics arg0) {
    // long time1 = System.currentTimeMillis();
    try {
      super.paintComponent(arg0);
      if (this.isOpaque()) {
        Rectangle clipBounds = arg0.getClipBounds();
        arg0.setColor(this.getBackground());
        arg0.fillRect(clipBounds.x, clipBounds.y, clipBounds.width, clipBounds.height);
      }
      this.rblock.paint(arg0);

      // Paint FrameContext selection

      RenderablePoint start = this.startSelection;
      RenderablePoint end = this.endSelection;
      if (start != null && end != null && !start.equals(end)) {
        this.rblock.paintSelection(arg0, false, start, end);
      }
    } finally {
      // long time2 = System.currentTimeMillis();
      // System.out.println("NonScrollableHtmlPanel.paintComponent(): numRenderables=" +
      // numRenderables + ",time=" + (time2 - time1) + " ms.");
    }
  }
Пример #2
0
 public boolean isSelectionAvailable() {
   RenderablePoint start = this.startSelection;
   RenderablePoint end = this.endSelection;
   return start != null && end != null && !start.equals(end);
 }