Example usage for org.apache.poi.xdgf.usermodel XDGFShape hasText

List of usage examples for org.apache.poi.xdgf.usermodel XDGFShape hasText

Introduction

In this page you can find the example usage for org.apache.poi.xdgf.usermodel XDGFShape hasText.

Prototype

public boolean hasText() 

Source Link

Usage

From source file:com.bbn.poi.xdgf.parsers.ShapeData.java

License:Apache License

public ShapeData(XDGFShape shape, AffineTransform globalTransform) {

    Path2D shapeBounds;//from   ww w.  ja  va  2s . c  o m
    Path2D path = shape.getPath();

    // some 1d shapes don't have a path associated with them, 
    // if they have subshapes... 
    if (shape.isShape1D() && path != null) {
        path1D = path;
        path1D.transform(globalTransform);
        path1D = GeomUtils.roundPath(path1D);
        hasGeometry = true;

        calculate1dEndpoints();
        shapeBounds = path1D; // use path as bounds
    } else {
        // calculate bounding boxes + other geometry information we'll need later
        shapeBounds = shape.getBoundsAsPath();

        shapeBounds.transform(globalTransform);
        shapeBounds = GeomUtils.roundPath(shapeBounds);

        path2D = shapeBounds;
        hasGeometry = (path != null);
    }

    this.bounds = shapeBounds.getBounds2D();

    this.shape = shape;
    this.shapeId = shape.getID();
    this.rtreeBounds = SpatialTools.convertRect(this.bounds);
    this.area = this.rtreeBounds.area();

    this.isInteresting = isInteresting(shape);

    this.lineColor = shape.getLineColor();
    this.linePattern = shape.getLinePattern();

    hasText = shape.hasText() && !shape.getTextAsString().isEmpty();
    isTextbox = hasText && !shape.hasMaster() && !shape.hasMasterShape();

    if (hasText)
        textCenter = globalTransform.transform(shape.getText().getTextCenter(), null);
}

From source file:com.bbn.poi.xdgf.parsers.ShapeData.java

License:Apache License

public static boolean isInteresting(XDGFShape shape) {
    return !shape.getSymbolName().isEmpty() || shape.isShape1D() || shape.hasMaster() || shape.hasText();
}