Example usage for org.apache.poi.ddf EscherProperties LINESTYLE__LINEENDARROWHEAD

List of usage examples for org.apache.poi.ddf EscherProperties LINESTYLE__LINEENDARROWHEAD

Introduction

In this page you can find the example usage for org.apache.poi.ddf EscherProperties LINESTYLE__LINEENDARROWHEAD.

Prototype

short LINESTYLE__LINEENDARROWHEAD

To view the source code for org.apache.poi.ddf EscherProperties LINESTYLE__LINEENDARROWHEAD.

Click Source Link

Usage

From source file:org.openflexo.technologyadapter.diagram.fml.action.AbstractCreateDiagramFromPPTSlide.java

License:Open Source License

private void setConnectorType(ConnectorGraphicalRepresentation returned, SimpleShape connectorShape) {

    switch (connectorShape.getShapeType()) {
    case ShapeTypes.CurvedConnector2:
        returned.setConnectorType(ConnectorType.CURVE);
        break;//from   w w  w  .j  a v a 2 s  . c o m
    case ShapeTypes.CurvedConnector3:
        returned.setConnectorType(ConnectorType.CURVE);
        break;
    case ShapeTypes.CurvedConnector4:
        returned.setConnectorType(ConnectorType.CURVE);
        break;
    case ShapeTypes.CurvedConnector5:
        returned.setConnectorType(ConnectorType.CURVE);
        break;
    case ShapeTypes.Line:
        returned.setConnectorType(ConnectorType.LINE);
        break;
    case ShapeTypes.StraightConnector1:
        returned.setConnectorType(ConnectorType.LINE);
        break;
    case ShapeTypes.BentConnector2:
        returned.setConnectorType(ConnectorType.RECT_POLYLIN);
        break;
    case ShapeTypes.BentConnector3:
        returned.setConnectorType(ConnectorType.RECT_POLYLIN);
        break;
    case ShapeTypes.BentConnector4:
        returned.setConnectorType(ConnectorType.RECT_POLYLIN);
        break;
    case ShapeTypes.BentConnector5:
        returned.setConnectorType(ConnectorType.RECT_POLYLIN);
        break;
    }

    // For now it we don't know how to determinate to whom end of the connector is affected the symbol
    // Because in the case of connectors, we don't knwo the end/start shape, which is computed by intersection.
    // So we can only handle correctly two cases, when there is no arrows ends at all and when there is two arrows ends
    if (connectorShape.getEscherProperty(EscherProperties.LINESTYLE__LINESTARTARROWHEAD) != 0
            && connectorShape.getEscherProperty(EscherProperties.LINESTYLE__LINEENDARROWHEAD) != 0) {
        if (connectorShape.getEscherProperty(EscherProperties.LINESTYLE__LINESTARTARROWHEAD) != 0) {
            returned.getConnectorSpecification().setStartSymbol(StartSymbolType.ARROW);
        }
        if (connectorShape.getEscherProperty(EscherProperties.LINESTYLE__LINESTARTARROWWIDTH) != 0) {
            returned.getConnectorSpecification().setStartSymbolSize(
                    connectorShape.getEscherProperty(EscherProperties.LINESTYLE__LINESTARTARROWWIDTH) * 10);
        }
        if (connectorShape.getEscherProperty(EscherProperties.LINESTYLE__LINEENDARROWHEAD) != 0) {
            returned.getConnectorSpecification().setEndSymbol(EndSymbolType.ARROW);
        }
        if (connectorShape.getEscherProperty(EscherProperties.LINESTYLE__LINEENDARROWWIDTH) != 0) {
            returned.getConnectorSpecification().setEndSymbolSize(
                    connectorShape.getEscherProperty(EscherProperties.LINESTYLE__LINEENDARROWWIDTH) * 10);
        }
    }
}