javax.swing.JScrollPane.getViewportBorderBounds()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中javax.swing.JScrollPane.getViewportBorderBounds()方法的一些代码示例,展示了JScrollPane.getViewportBorderBounds()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.getViewportBorderBounds()方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:getViewportBorderBounds

JScrollPane.getViewportBorderBounds介绍

暂无

代码示例

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

/** 
 * Returns the bounds of the border around the specified scroll pane's 
 * viewport.
 *
 * @return the size and position of the viewport border
 * @deprecated As of JDK version Swing1.1
 *    replaced by <code>JScrollPane.getViewportBorderBounds()</code>.
 */
 public Rectangle getViewportBorderBounds(JScrollPane scrollpane) {
return scrollpane.getViewportBorderBounds();
 }

代码示例来源:origin: com.eas.platypus/platypus-js-forms

/**
 * Returns the bounds of the border around the specified scroll pane's
 * viewport.
 *
 * @return the size and position of the viewport border
 * @deprecated As of JDK version Swing1.1
 *    replaced by <code>JScrollPane.getViewportBorderBounds()</code>.
 */
@Deprecated
public Rectangle getViewportBorderBounds(JScrollPane scrollpane) {
  return scrollpane.getViewportBorderBounds();
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public double getLayoutWidth() {
  if (enclosingScrollPane != null) {
    return enclosingScrollPane.getViewportBorderBounds().width;
  } else {
    return getSize().width;
  }
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

public double getLayoutWidth() {
  if (enclosingScrollPane != null) {
    return enclosingScrollPane.getViewportBorderBounds().width;
  } else {
    return getSize().width;
  }
}

代码示例来源:origin: org.docx4j/xhtmlrenderer

public Rectangle getFixedRectangle() {
  if (enclosingScrollPane != null) {
    return enclosingScrollPane.getViewportBorderBounds();
  } else {
    Dimension dim = getSize();
    return new Rectangle(0, 0, dim.width, dim.height);
  }
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public Rectangle getFixedRectangle() {
  if (enclosingScrollPane != null) {
    return enclosingScrollPane.getViewportBorderBounds();
  } else {
    Dimension dim = getSize();
    return new Rectangle(0, 0, dim.width, dim.height);
  }
}

代码示例来源:origin: org.docx4j/xhtmlrenderer

public double getLayoutWidth() {
  if (enclosingScrollPane != null) {
    return enclosingScrollPane.getViewportBorderBounds().width;
  } else {
    return getSize().width;
  }
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

public Rectangle getFixedRectangle() {
  if (enclosingScrollPane != null) {
    return enclosingScrollPane.getViewportBorderBounds();
  } else {
    Dimension dim = getSize();
    return new Rectangle(0, 0, dim.width, dim.height);
  }
}

代码示例来源:origin: org.docx4j/xhtmlrenderer

/**
 * Gets the fixedRectangle attribute of the BasicPanel object
 *
 * @return The fixedRectangle value
 */
public Rectangle getFixedRectangle() {
  if (enclosingScrollPane != null) {
    return enclosingScrollPane.getViewportBorderBounds();
  } else {
    Dimension dim = getSize();
    return new Rectangle(0, 0, dim.width, dim.height);
  }
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

/**
 * Gets the fixedRectangle attribute of the BasicPanel object
 *
 * @return The fixedRectangle value
 */
public Rectangle getFixedRectangle() {
  if (enclosingScrollPane != null) {
    return enclosingScrollPane.getViewportBorderBounds();
  } else {
    Dimension dim = getSize();
    return new Rectangle(0, 0, dim.width, dim.height);
  }
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

/**
 * Gets the fixedRectangle attribute of the BasicPanel object
 *
 * @return The fixedRectangle value
 */
public Rectangle getFixedRectangle() {
  if (enclosingScrollPane != null) {
    return enclosingScrollPane.getViewportBorderBounds();
  } else {
    Dimension dim = getSize();
    return new Rectangle(0, 0, dim.width, dim.height);
  }
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

public Rectangle getScreenExtents() {
  Rectangle extents;
  if (enclosingScrollPane != null) {
    Rectangle bnds = enclosingScrollPane.getViewportBorderBounds();
    extents = new Rectangle(0, 0, bnds.width, bnds.height);
    //Uu.p("bnds = " + bnds);
  } else {
    extents = new Rectangle(getWidth(), getHeight());//200, 200 ) );
  }
  return extents;
}

代码示例来源:origin: org.docx4j/xhtmlrenderer

public Rectangle getScreenExtents() {
  Rectangle extents;
  if (enclosingScrollPane != null) {
    Rectangle bnds = enclosingScrollPane.getViewportBorderBounds();
    extents = new Rectangle(0, 0, bnds.width, bnds.height);
    //Uu.p("bnds = " + bnds);
  } else {
    extents = new Rectangle(getWidth(), getHeight());//200, 200 ) );
    Insets insets = getInsets();
    extents.width -= insets.left + insets.right;
    extents.height -= insets.top + insets.bottom;
  }
  return extents;
}

代码示例来源:origin: khuxtable/seaglass

protected void paint(SynthContext context, Graphics g) {
  Border vpBorder = scrollpane.getViewportBorder();
  if (vpBorder != null) {
    Rectangle r = scrollpane.getViewportBorderBounds();
    vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height);
  }
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public Rectangle getScreenExtents() {
  Rectangle extents;
  if (enclosingScrollPane != null) {
    Rectangle bnds = enclosingScrollPane.getViewportBorderBounds();
    extents = new Rectangle(0, 0, bnds.width, bnds.height);
    //Uu.p("bnds = " + bnds);
  } else {
    extents = new Rectangle(getWidth(), getHeight());//200, 200 ) );
    Insets insets = getInsets();
    extents.width -= insets.left + insets.right;
    extents.height -= insets.top + insets.bottom;
  }
  return extents;
}

代码示例来源:origin: stackoverflow.com

@Override
public void componentResized(ComponentEvent e) {              
 Rectangle rect = scrollPane.getViewportBorderBounds();

代码示例来源:origin: stackoverflow.com

Dimension v = scrollPane.getViewportBorderBounds().getSize();
if (v.height > p.height)

代码示例来源:origin: org.netbeans.api/org-openide-explorer

Rectangle r = pane.getViewportBorderBounds();
r.translate(-r.x, -r.y);
r.width -= ins1.left + ins1.right;

代码示例来源:origin: jpcsp/jpcsp

/**
 * Gets the sub-rectangle of a JScrollPane's area that
 * is actually showing the view
 */
private Rectangle getShowingRect (JScrollPane pane) {
  Insets ins1 = pane.getViewport().getInsets();
  Border inner = pane.getViewportBorder();
  Insets ins2;
  if (inner != null) {
    ins2 = inner.getBorderInsets(pane);
  } else {
    ins2 = new Insets (0,0,0,0);
  }
  Insets ins3 = new Insets(0,0,0,0);
  if (pane.getBorder() != null) {
    ins3 = pane.getBorder().getBorderInsets(pane);
  }
  Rectangle r = pane.getViewportBorderBounds();
  r.translate(-r.x, -r.y);
  r.width -= ins1.left + ins1.right;
  r.width -= ins2.left + ins2.right;
  r.height -= ins1.top + ins1.bottom;
  r.height -= ins2.top + ins2.bottom;
  r.x -= ins2.left;
  r.x -= ins3.left;
  Point p = pane.getViewport().getViewPosition();
  r.translate (p.x, p.y);
  r = SwingUtilities.convertRectangle(pane.getViewport(), r, pane);
  return r;
}

代码示例来源:origin: com.synaptix/SynaptixWidget

@Override
  public Rectangle getViewportBorderBounds() {
    Rectangle borderR = super.getViewportBorderBounds();

    boolean leftToRight = this.getComponentOrientation().isLeftToRight();

    JViewport colFoot = getColumnFooter();
    if ((colFoot != null) && (colFoot.isVisible())) {
      int colFootHeight = colFoot.getHeight();
      borderR.y += colFootHeight;
      borderR.height -= colFootHeight;
    }

    JViewport rowFoot = getRowFooter();
    if ((rowFoot != null) && (rowFoot.isVisible())) {
      int rowFootWidth = rowFoot.getWidth();
      if (leftToRight) {
        borderR.x += rowFootWidth;
      }
      borderR.width -= rowFootWidth;
    }

    return borderR;
  }
}

相关文章

JScrollPane类方法