Example usage for java.awt.geom NoninvertibleTransformException toString

List of usage examples for java.awt.geom NoninvertibleTransformException toString

Introduction

In this page you can find the example usage for java.awt.geom NoninvertibleTransformException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:org.kepler.gui.KeplerGraphFrame.java

/**
 * Return the size of the visible part of the canvas, in canvas coordinates.
 * //  ww  w  .  j av a  2  s .co  m
 * @return Rectangle2D
 */
public Rectangle2D getVisibleSize() {
    AffineTransform current = _jgraph.getGraphPane().getCanvas().getCanvasPane().getTransformContext()
            .getTransform();
    AffineTransform inverse;
    try {
        inverse = current.createInverse();
    } catch (NoninvertibleTransformException e) {
        throw new RuntimeException(e.toString());
    }
    Dimension size = _jgraph.getGraphPane().getCanvas().getSize();
    Rectangle2D visibleRect = new Rectangle2D.Double(0, 0, size.getWidth(), size.getHeight());
    return ShapeUtilities.transformBounds(visibleRect, inverse);
}