Java 类net.sf.jasperreports.engine.design.JRDesignRectangle 实例源码

项目:jasperreports    文件:JRRectangleFactory.java   
@Override
public Object createObject(Attributes atts)
{
    JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);

    JRDesignRectangle rectangle = new JRDesignRectangle(jasperDesign);

    String radius = atts.getValue(JRXmlConstants.ATTRIBUTE_radius);
    if (radius != null && radius.length() > 0)
    {
        rectangle.setRadius(Integer.parseInt(radius));
    }

    return rectangle;
}
项目:PDFReporter-Studio    文件:MRectangle.java   
@Override
public Object getPropertyValue(Object id) {
    JRDesignRectangle jrElement = (JRDesignRectangle) getValue();
    if (id.equals(JRBaseStyle.PROPERTY_RADIUS))
        return jrElement.getOwnRadius();
    if (id.equals(JRBaseStyle.PROPERTY_FILL))
        return fillD.getEnumValue(jrElement.getFillValue());
    return super.getPropertyValue(id);
}
项目:PDFReporter-Studio    文件:MRectangle.java   
@Override
public void setPropertyValue(Object id, Object value) {
    JRDesignRectangle jrElement = (JRDesignRectangle) getValue();
    if (id.equals(JRBaseStyle.PROPERTY_FILL))
        jrElement.setFill((FillEnum) fillD.getEnumValue(value));
    else if (id.equals(JRBaseStyle.PROPERTY_RADIUS)) {
        jrElement.setRadius(value != null ? ((Integer) value).intValue() : 0);

    } else
        super.setPropertyValue(id, value);
}
项目:PDFReporter-Studio    文件:MRectangle.java   
@Override
public JRDesignElement createJRElement(JasperDesign jasperDesign) {
    JRDesignRectangle jrDesignRectangle = new JRDesignRectangle(jasperDesign);

    DefaultManager.INSTANCE.applyDefault(this.getClass(), jrDesignRectangle);

    jrDesignRectangle.setWidth(getDefaultWidth());
    jrDesignRectangle.setHeight(getDefaultHeight());
    return jrDesignRectangle;
}
项目:ireport-fork    文件:ElementNodeVisitor.java   
/**
 *
 */
public void visitRectangle(JRRectangle rectangle)
{
    node = new ElementNode(jasperDesign, (JRDesignRectangle)rectangle,doLkp);

    if (rectangle.getRadius() > 0)
        node.setIconBaseWithExtension(ICON_ROUND_RECTANGLE);
    else
        node.setIconBaseWithExtension(ICON_RECTANGLE);
}
项目:ireport-fork    文件:CreateRectangleAction.java   
public JRDesignElement createReportElement(JasperDesign jd)
{
    JRDesignElement element = new JRDesignRectangle();
    element.setWidth(100);
    element.setHeight(20);
    return element;
}
项目:ireport-fork    文件:CreateRoundRectangleAction.java   
public JRDesignElement createReportElement(JasperDesign jd)
{
    JRDesignRectangle element = new JRDesignRectangle();
    element.setWidth(100);
    element.setHeight(20);
    element.setRadius(10);
    return element;
}
项目:ireport-fork    文件:GraphicElementPropertiesFactory.java   
/**
 * Get the GraphicElement properties...
 */
public static List<Sheet.Set> getGraphicPropertySets(JRDesignGraphicElement element, JasperDesign jd)
{
    JRDesignDataset dataset = ModelUtils.getElementDataset(element, jd);

    List<Sheet.Set> list = new ArrayList<Sheet.Set>();
    Sheet.Set propertySet = Sheet.createPropertiesSet();
    propertySet.setName("GRAPHIC_ELEMENT_PROPERTIES");
    propertySet.setDisplayName("Graphic properties");
    //propertySet.put(new PenProperty( element ));
    propertySet.put(new JRPenProperty(element.getLinePen(), element));
    propertySet.put(new FillProperty( element ));

    list.add(propertySet);

    if (element instanceof JRDesignImage)
    {
        Sheet.Set imagePropertySet = Sheet.createPropertiesSet();
        imagePropertySet.setName("IMAGE_ELEMENT_PROPERTIES");
        imagePropertySet.setDisplayName("Image properties");
        imagePropertySet.put(new ImageExpressionProperty((JRDesignImage)element, dataset));
        imagePropertySet.put(new ImageExpressionClassNameProperty((JRDesignImage)element) );
        imagePropertySet.put(new ScaleImageProperty( (JRDesignImage)element ));
        imagePropertySet.put(new HorizontalAlignmentProperty( (JRDesignImage)element ));
        imagePropertySet.put(new VerticalAlignmentProperty( (JRDesignImage)element ));
        imagePropertySet.put(new ImageUsingCacheProperty( (JRDesignImage)element ));
        imagePropertySet.put(new LazyProperty( (JRDesignImage)element ));
        imagePropertySet.put(new OnErrorTypeProperty( (JRDesignImage)element ));
        imagePropertySet.put(new ImageEvaluationTimeProperty((JRDesignImage)element, dataset));//, dataset));
        imagePropertySet.put(new EvaluationGroupProperty((JRDesignImage)element, dataset));
        list.add(imagePropertySet);
    }
    else if (element instanceof JRDesignLine)
    {
        Sheet.Set linePropertySet = Sheet.createPropertiesSet();
        linePropertySet.setName("LINE_ELEMENT_PROPERTIES");
        linePropertySet.setDisplayName("Line properties");
        linePropertySet.put(new LineDirectionProperty( (JRDesignLine)element ));
        list.add(linePropertySet);
    }
    else if (element instanceof JRDesignRectangle)
    {
        Sheet.Set rectanglePropertySet = Sheet.createPropertiesSet();
        rectanglePropertySet.setName("RECTANGLE_ELEMENT_PROPERTIES");
        rectanglePropertySet.setDisplayName("Rectangle properties");
        rectanglePropertySet.put(new RadiusProperty( (JRDesignRectangle)element ));
        list.add(rectanglePropertySet);
    }
    else if (element instanceof JRDesignEllipse)
    {
        // Nothing to do...
    }

    return list;
}
项目:ireport-fork    文件:TransformElementAction.java   
private List<Integer> getTransformationTypes(JRDesignElement element)
{
    List<Integer> commonTransformationTypes = new ArrayList<Integer>();

    if (element instanceof JRDesignRectangle)
    {
        commonTransformationTypes.add(TRANSFORMATION_TYPE_TO_ELLIPSE);
        commonTransformationTypes.add(TRANSFORMATION_TYPE_TO_FRAME);
    } 

    if (element instanceof JRDesignEllipse)
    {
        commonTransformationTypes.add(TRANSFORMATION_TYPE_TO_RECTANGLE);
    }

    if (element instanceof JRDesignTextField)
    {
        commonTransformationTypes.add(TRANSFORMATION_TYPE_TO_STATICTEXT);
    }

    if (element instanceof JRDesignStaticText)
    {
        commonTransformationTypes.add(TRANSFORMATION_TYPE_TO_TEXTFIELD);
    }

    if (element instanceof JRDesignChart)
    {
        JRDesignChart chartElement = (JRDesignChart)element;
        if (chartElement.getChartType() == JRDesignChart.CHART_TYPE_PIE)
        {
            commonTransformationTypes.add(TRANSFORMATION_TYPE_TO_CHART_PIE3D);
        }
        else if (chartElement.getChartType() == JRDesignChart.CHART_TYPE_PIE3D)
        {
            commonTransformationTypes.add(TRANSFORMATION_TYPE_TO_CHART_PIE);
        }
    }

    //if (element instanceof JRDesignTextField ||
    //    element instanceof JRDesignStaticText) return TRANSFORMATION_TYPE_CATEGORY_CHART;


    return commonTransformationTypes;
}
项目:ireport-fork    文件:RadiusProperty.java   
@SuppressWarnings("unchecked")
public RadiusProperty(JRDesignRectangle rectangle)
{
    super(rectangle);
    this.rectangle = rectangle;
}
项目:PDFReporter-Studio    文件:MRectangle.java   
/**
 * Instantiates a new m rectangle.
 * 
 * @param parent
 *          the parent
 * @param jrRectangle
 *          the jr rectangle
 * @param newImage
 *          the new image
 */
public MRectangle(ANode parent, JRDesignRectangle jrRectangle, int newImage) {
    super(parent, newImage);
    setValue(jrRectangle);
}