Java Code Examples for javax.swing.JScrollPane#getViewportBorderBounds()

The following examples show how to use javax.swing.JScrollPane#getViewportBorderBounds() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IDEFPanel.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
private double getWidthZoom(JScrollPane jScrollPane1,
                            MovingArea movingArea) {
    final Rectangle r = jScrollPane1.getViewportBorderBounds();
    return (double) r.width / (double) movingArea.MOVING_AREA_WIDTH;
}
 
Example 2
Source File: IDEFPanel.java    From ramus with GNU General Public License v3.0 4 votes vote down vote up
private double getHeightZoom(JScrollPane jScrollPane1,
                             MovingArea movingArea) {
    final Rectangle r = jScrollPane1.getViewportBorderBounds();
    return (double) r.height / (double) movingArea.MOVING_AREA_HEIGHT;
}