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

项目:jasperreports    文件:HeaderLabelUtil.java   
/**
 * 
 */
public static HeaderLabelBuiltinExpression alterHeaderLabel(JRDesignFrame frame, String suffix)
{
    HeaderLabelBuiltinExpression evaluator = null;

    JRElement[] elements = frame.getElements();
    JRElement element = (elements == null || elements.length == 0) ? null : elements[0];

    if (element instanceof JRStaticText)
    {
        JRElement elementProxy = getProxy((JRStaticText)element, suffix); 
        frame.getChildren().set(0, elementProxy);
    }
    else if (element instanceof JRTextField)
    {
        evaluator = new HeaderLabelBuiltinExpression(((JRTextField)element).getExpression(), suffix); 
    }


    return evaluator;
}
项目:PDFReporter-Studio    文件:ReportFactory.java   
/**
 * Creates a new Report object.
 * 
 * @param band
 *          the band
 * @param list
 *          the list
 */
public static void createElementsForBand(ANode band, List<?> list) {
    for (Object element : list) {
        ANode node = createNode(band, element, -1);
        // ExtensionManager m = JaspersoftStudioPlugin.getExtensionManager();
        // List<?> children = m.getChildren4Element(element);
        // if (children != null && !children.isEmpty()) {
        // createElementsForBand(node, children);
        // } else
        if (element instanceof JRDesignFrame) {
            JRDesignFrame frame = (JRDesignFrame) element;
            createElementsForBand(node, frame.getChildren());
        } else if (element instanceof JRElementGroup) {
            JRElementGroup group = (JRElementGroup) element;
            createElementsForBand(node, group.getChildren());
        }
    }
}
项目:PDFReporter-Studio    文件:ReorderElementGroupCommand.java   
@Override
public void execute() {
    oldIndex = jrGroup.getChildren().indexOf(jrElement);

    if (jrGroup instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) jrGroup).removeElementGroup(jrElement);
        if (newIndex < 0 || newIndex > jrGroup.getChildren().size())
            ((JRDesignElementGroup) jrGroup).addElementGroup(jrElement);
        else
            ((JRDesignElementGroup) jrGroup).addElementGroup(newIndex, jrElement);
    } else if (jrGroup instanceof JRDesignFrame) {
        ((JRDesignFrame) jrGroup).removeElementGroup(jrElement);
        if (newIndex < 0 || newIndex > jrGroup.getChildren().size())
            ((JRDesignFrame) jrGroup).addElementGroup(jrElement);
        else
            ((JRDesignFrame) jrGroup).addElementGroup(newIndex, jrElement);
    }
}
项目:PDFReporter-Studio    文件:ReorderElementGroupCommand.java   
@Override
public void undo() {
    if (jrGroup instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) jrGroup).removeElementGroup(jrElement);
        if (oldIndex < 0 || oldIndex > jrGroup.getChildren().size())
            ((JRDesignElementGroup) jrGroup).addElementGroup(jrElement);
        else
            ((JRDesignElementGroup) jrGroup).addElementGroup(oldIndex, jrElement);
    } else if (jrGroup instanceof JRDesignFrame) {
        ((JRDesignFrame) jrGroup).removeElementGroup(jrElement);
        if (oldIndex < 0 || oldIndex > jrGroup.getChildren().size())
            ((JRDesignFrame) jrGroup).addElementGroup(jrElement);
        else
            ((JRDesignFrame) jrGroup).addElementGroup(oldIndex, jrElement);
    }
}
项目:PDFReporter-Studio    文件:ReorderElementCommand.java   
@Override
public void execute() {
    oldIndex = jrGroup.getChildren().indexOf(jrElement);

    if (jrGroup instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) jrGroup).removeElement(jrElement);
        if (newIndex < 0 || newIndex > jrGroup.getChildren().size())
            ((JRDesignElementGroup) jrGroup).addElement(jrElement);
        else
            ((JRDesignElementGroup) jrGroup).addElement(newIndex, jrElement);
    } else if (jrGroup instanceof JRDesignFrame) {
        ((JRDesignFrame) jrGroup).removeElement(jrElement);
        if (newIndex < 0 || newIndex > jrGroup.getChildren().size())
            ((JRDesignFrame) jrGroup).addElement(jrElement);
        else
            ((JRDesignFrame) jrGroup).addElement(newIndex, jrElement);
    }
}
项目:PDFReporter-Studio    文件:ReorderElementCommand.java   
@Override
public void undo() {
    if (jrGroup instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) jrGroup).removeElement(jrElement);
        if (oldIndex < 0 || oldIndex > jrGroup.getChildren().size())
            ((JRDesignElementGroup) jrGroup).addElement(jrElement);
        else
            ((JRDesignElementGroup) jrGroup).addElement(oldIndex, jrElement);
    } else if (jrGroup instanceof JRDesignFrame) {
        ((JRDesignFrame) jrGroup).removeElement(jrElement);
        if (oldIndex < 0 || oldIndex > jrGroup.getChildren().size())
            ((JRDesignFrame) jrGroup).addElement(jrElement);
        else
            ((JRDesignFrame) jrGroup).addElement(oldIndex, jrElement);
    }
}
项目:PDFReporter-Studio    文件:DeleteElementCommand.java   
@Override
public void undo() {
    if (lCmd != null)
        lCmd.undo();
    if (jrGroup != null && jrGroup.getChildren() != null) {
        if (jrGroup instanceof JRDesignElementGroup) {
            if (elementPosition > ((JRDesignElementGroup) jrGroup).getChildren().size())
                ((JRDesignElementGroup) jrGroup).addElement(jrElement);
            else
                ((JRDesignElementGroup) jrGroup).addElement(elementPosition, jrElement);
        } else if (jrGroup instanceof JRDesignFrame) {
            if (elementPosition > ((JRDesignFrame) jrGroup).getChildren().size())
                ((JRDesignFrame) jrGroup).addElement(jrElement);
            else
                ((JRDesignFrame) jrGroup).addElement(elementPosition, jrElement);
        }
    }
}
项目:PDFReporter-Studio    文件:OrphanElementCommand.java   
@Override
public void undo() {
    jrElement.setX(location.x);
    jrElement.setY(location.y);
    if (jrGroup instanceof JRDesignElementGroup) {
        if (index > ((JRDesignElementGroup) jrGroup).getChildren().size())
            ((JRDesignElementGroup) jrGroup).addElement(jrElement);
        else
            ((JRDesignElementGroup) jrGroup).addElement(index, jrElement);
    } else if (jrGroup instanceof JRDesignFrame) {
        if (index > ((JRDesignFrame) jrGroup).getChildren().size())
            ((JRDesignFrame) jrGroup).addElement(jrElement);
        else
            ((JRDesignFrame) jrGroup).addElement(index, jrElement);
    }
}
项目:PDFReporter-Studio    文件:CreateElementGroupCommand.java   
@Override
public void execute() {
    if (jrElement != null) {
        // set on JRElementGroup ...
        if (index < 0)
            index = jrGroup.getChildren().size();
        if (jrGroup instanceof JRDesignElementGroup) {
            if (index < 0 || index > jrGroup.getChildren().size())
                ((JRDesignElementGroup) jrGroup).addElementGroup(jrElement);
            else
                ((JRDesignElementGroup) jrGroup).addElementGroup(index, jrElement);
        } else if (jrGroup instanceof JRDesignFrame) {
            if (index < 0 || index > jrGroup.getChildren().size())
                ((JRDesignFrame) jrGroup).addElementGroup(jrElement);
            else
                ((JRDesignFrame) jrGroup).addElementGroup(index, jrElement);
        }
    }
}
项目:ireport-fork    文件:ElementPasteType.java   
private void removeElement(JRElementGroup container, JRDesignElement element)
{
    int index = 0;
    if (container instanceof JRDesignElementGroup)
    {
        index = ((JRDesignElementGroup)container).getChildren().indexOf(element);
        ((JRDesignElementGroup)container).removeElement(element);
    }
    else if (container instanceof JRDesignFrame)
    {
        index = ((JRDesignFrame)container).getChildren().indexOf(element);
        ((JRDesignFrame)container).removeElement(element);
    }

    DeleteElementUndoableEdit edit = new DeleteElementUndoableEdit(element,container,index);
    unduableEdit.concatenate(edit);
}
项目:ireport-fork    文件:ElementPasteType.java   
private void removeElementGroup(JRElementGroup container, JRDesignElementGroup group)
{
    int index=0;
    if (container instanceof JRDesignElementGroup)
    {
        index = ((JRDesignElementGroup)container).getChildren().indexOf(group);
        ((JRDesignElementGroup)container).removeElementGroup(group);
    }
    else if (container instanceof JRDesignFrame)
    {
        index = ((JRDesignFrame)container).getChildren().indexOf(group);
        ((JRDesignFrame)container).removeElementGroup(group);
    }
    DeleteElementGroupUndoableEdit edit = new DeleteElementGroupUndoableEdit(group,container,index);
    unduableEdit.concatenate(edit);

}
项目:ireport-fork    文件:AddElementUndoableEdit.java   
@Override
public void undo() throws CannotUndoException {

    super.undo();

    if (container instanceof JRDesignElementGroup)
    {
        index = ((JRDesignElementGroup)container).getChildren().indexOf(element);
        ((JRDesignElementGroup)container).removeElement(element);
    }
    else if (container instanceof JRDesignFrame)
    {
        index = ((JRDesignFrame)container).getChildren().indexOf(element);
        ((JRDesignFrame)container).removeElement(element);
    }
}
项目:ireport-fork    文件:UnGroupElementsAction.java   
private void addElement(JRDesignElement element, JRElementGroup elementGroup) {

        if (elementGroup instanceof JRDesignElementGroup)
        {
            ((JRDesignElementGroup)elementGroup).addElement(element);
        }
        else if (elementGroup instanceof JRDesignBand)
        {
            ((JRDesignBand)elementGroup).addElement(element);
        }
        else if (elementGroup instanceof JRDesignCellContents)
        {
            ((JRDesignCellContents)elementGroup).addElement(element);
        }
        else if (elementGroup instanceof JRDesignFrame)
        {
            ((JRDesignFrame)elementGroup).addElement(element);
        }
    }
项目:ireport-fork    文件:UnGroupElementsAction.java   
private void addElementGroup(JRDesignElementGroup element, JRElementGroup elementGroup) {

        if (elementGroup instanceof JRDesignElementGroup)
        {
            ((JRDesignElementGroup)elementGroup).addElementGroup(element);
        }
        else if (elementGroup instanceof JRDesignBand)
        {
            ((JRDesignBand)elementGroup).addElementGroup(element);
        }
        else if (elementGroup instanceof JRDesignCellContents)
        {
            ((JRDesignCellContents)elementGroup).addElementGroup(element);
        }
        else if (elementGroup instanceof JRDesignFrame)
        {
            ((JRDesignFrame)elementGroup).addElementGroup(element);
        }
    }
项目:ireport-fork    文件:UnGroupElementsAction.java   
private void removeElementGroup(JRDesignElementGroup element, JRElementGroup elementGroup) {

        if (elementGroup instanceof JRDesignElementGroup)
        {
            ((JRDesignElementGroup)elementGroup).removeElementGroup(element);
        }
        else if (elementGroup instanceof JRDesignBand)
        {
            ((JRDesignBand)elementGroup).removeElementGroup(element);
        }
        else if (elementGroup instanceof JRDesignCellContents)
        {
            ((JRDesignCellContents)elementGroup).removeElementGroup(element);
        }
        else if (elementGroup instanceof JRDesignFrame)
        {
            ((JRDesignFrame)elementGroup).removeElementGroup(element);
        }
    }
项目:kfs    文件:TravelReportFactoryServiceImpl.java   
/**
 * Convenience method for creating {@link JRDesignCrosstabCell} instances. It is possible to be part of a row group and a column group.
 *
 * @param type is a {@link Class} is used to determine how to render the {@link JRDesignTextField} contained
 * in the {@link JRDesignCrosstabCell}
 * @param value is the {@link String} value to render in the {@link JRDesignCrosstabCell}
 * @param rowGroup is the name of the rowgroup this cell is part of.
 * @param colGroup is the name of the column group this cell is part of.
 */
protected JRDesignCrosstabCell crosstabCell(final Class type, final String value, final String rowGroup, final String colGroup) {
    LOG.debug("Creating cell with row group = "+ rowGroup+ " and column group = "+ colGroup);
    final JRDesignCrosstabCell retval = new JRDesignCrosstabCell();
    final JRDesignCellContents contents = new JRDesignCellContents();
    final JRDesignTextField field = normal(value).toTextField(type);
    addDesignElementTo(contents, field, 0, 0, CELL_WIDTH, CELL_HEIGHT);
    contents.setMode(MODE_OPAQUE);
    contents.setBackcolor(Color.LIGHT_GRAY);

    final JRDesignFrame frame = new JRDesignFrame();
    frame.copyBox(new TravelReportLineBox(contents));
    contents.setBox(frame);
    retval.setWidth(CELL_WIDTH);
    retval.setHeight(CELL_HEIGHT);
    retval.setContents(contents);
    retval.setRowTotalGroup(rowGroup);
    retval.setColumnTotalGroup(colGroup);
    return retval;
}
项目:jasperreports    文件:JRFrameFactory.java   
@Override
public Object createObject(Attributes attributes)
{
    JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);

    return new JRDesignFrame(jasperDesign);
}
项目:jasperreports    文件:TableReport.java   
@Override
protected JRDesignFrame createColumnCell(Column column, JRElementGroup parentGroup, Cell cell)
{
    JRDesignFrame frame = (JRDesignFrame) createColumnCell(column, parentGroup, cell, true);
    addHeaderToolbarElement(column, frame, TableUtil.getCellElement(JRTextField.class, column.getDetailCell(), true));
    return frame;
}
项目:jasperreports    文件:TableReport.java   
protected void addIconLabelComponent(Column column, JRDesignFrame frame, String suffix)
{
    List<JRChild> children = frame.getChildren();
    if (children.size() > 0)
    {
        JRBaseTextElement headerTextElement = (JRBaseTextElement)children.get(0);
        if (headerTextElement != null) 
        {
            JRComponentElement componentElement = 
                IconLabelComponentUtil.getInstance(fillContext.getFiller().getJasperReportsContext()).createIconLabelComponentElement(headerTextElement);
            IconLabelComponent iconLabelComponent = (IconLabelComponent)componentElement.getComponent();

            JRDesignTextField labelTextField = (JRDesignTextField)iconLabelComponent.getLabelTextField();
            if (headerTextElement instanceof JRTextField) 
            {
                labelTextField.setExpression(((JRTextField) headerTextElement).getExpression());
            }
            else if (headerTextElement instanceof JRStaticText) 
            {
                labelTextField.setExpression(builtinEvaluatorFactory.createConstantExpression(((JRStaticText)headerTextElement).getText()));
            }

            JRDesignTextField iconTextField = (JRDesignTextField)iconLabelComponent.getIconTextField();
            iconTextField.setExpression(builtinEvaluatorFactory.createConstantExpression(suffix));

            componentElement.getPropertiesMap().setProperty(MatcherExporterFilter.PROPERTY_MATCHER_EXPORT_FILTER_KEY, TABLE_HEADER_ICON_LABEL_MATCHER_EXPORT_KEY);

            JRBaseElement element = (JRBaseElement)frame.getChildren().get(0);
            element.getPropertiesMap().setProperty(MatcherExporterFilter.PROPERTY_MATCHER_EXPORT_FILTER_KEY, TABLE_HEADER_LABEL_MATCHER_EXPORT_KEY);

            //frame.getChildren().remove(0);
            frame.getChildren().add(componentElement);
        }
    }
}
项目:jasperreports    文件:TableReport.java   
@Override
protected JRElement createColumnGroupCell(ColumnGroup columnGroup, Cell cell, JRDesignElementGroup elementGroup)
{
    JRDesignFrame frame = (JRDesignFrame) createCell(elementGroup, cell, 
            columnGroup.getWidth(), fillColumn.getWidth(), 
            xOffset, yOffset, null, deriveUUID(), true);
    frame.getPropertiesMap().setProperty(HtmlExporter.PROPERTY_HTML_CLASS, "jrcolGroupHeader");
    return frame;
}
项目:PDFReporter-Studio    文件:EditChartCommand.java   
private void switchCharts(JRDesignChart chart1, JRDesignChart chart2) {
    int index = jrGroup.getChildren().indexOf(chart1);
    if (jrGroup instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) jrGroup).removeElement(chart1);
        ((JRDesignElementGroup) jrGroup).addElement(index, chart2);
    } else if (jrGroup instanceof JRDesignFrame) {
        ((JRDesignFrame) jrGroup).removeElement(chart1);
        ((JRDesignFrame) jrGroup).addElement(index, chart2);
    }
}
项目:PDFReporter-Studio    文件:EditSpiderChartCommand.java   
private void switchCharts(JRDesignComponentElement chart1,
        JRDesignComponentElement chart2) {
    int index = jrGroup.getChildren().indexOf(chart1);
    if (jrGroup instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) jrGroup).removeElement(chart1);
        ((JRDesignElementGroup) jrGroup).addElement(index, chart2);
    } else if (jrGroup instanceof JRDesignFrame) {
        ((JRDesignFrame) jrGroup).removeElement(chart1);
        ((JRDesignFrame) jrGroup).addElement(index, chart2);
    }
}
项目:PDFReporter-Studio    文件:MTable.java   
@Override
public void propertyChange(PropertyChangeEvent evt) {

    if (evt.getPropertyName().equals(StandardTable.PROPERTY_DATASET_RUN)){
        addDatasetGroupListener();
    }
    if (evt.getPropertyName().equals(JRDesignFrame.PROPERTY_CHILDREN) || evt.getPropertyName().equals(JRDesignElement.PROPERTY_ELEMENT_GROUP) || evt.getPropertyName().equals(MColumn.PROPERTY_NAME)) {
        // The children are changed, need to build a new full model when it will
        // be necessary
        fullModelTable = null;
    }

    if (evt.getPropertyName().equals(MGraphicElement.FORCE_GRAPHICAL_REFRESH)) {
        ANode parent = getParent();
        IGraphicalPropertiesHandler upperGrahpicHandler = null;
        while (parent != null) {
            if (parent instanceof IGraphicalPropertiesHandler) {
                upperGrahpicHandler = (IGraphicalPropertiesHandler) parent;
            }
            parent = parent.getParent();
        }
        if (upperGrahpicHandler != null) {
            ((MGraphicElement) upperGrahpicHandler).getValue().getEventSupport().firePropertyChange(MGraphicElement.FORCE_GRAPHICAL_REFRESH, null, null);
        }
    }

    if (getTableManager() != null
            && (getParent() instanceof MPage && evt instanceof CollectionElementAddedEvent || evt instanceof CollectionElementRemovedEvent || evt.getOldValue() instanceof DesignCell || evt.getNewValue() instanceof DesignCell))
        getTableManager().update();
    else if (getTableManager() != null)
        getTableManager().update();
    super.propertyChange(evt);
}
项目:PDFReporter-Studio    文件:DefaultTemplateEngine.java   
/**
 * Remove an element from its container. This method checks if the container is a frame or an element groups (like a
 * band or a cell);
 * 
 * @param container
 * @param element
 */
public void removeElement(JRElementGroup container, JRDesignElement element) {
    if (container instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) container).removeElement(element);
    }
    if (container instanceof JRDesignFrame) {
        ((JRDesignFrame) container).removeElement(element);
    }
}
项目:PDFReporter-Studio    文件:DefaultTemplateEngine.java   
/**
 * Add an element to a container. This method checks if the container is a frame or an element groups (like a band or
 * a cell);
 * 
 * @param container
 * @param element
 */
public void addElement(JRElementGroup container, JRDesignElement element) {
    if (container instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) container).addElement(element);
    }
    if (container instanceof JRDesignFrame) {
        ((JRDesignFrame) container).addElement(element);
    }
}
项目:PDFReporter-Studio    文件:DefaultTemplateEngine.java   
/**
 * Set the height of a container (which could be a band or a frame). If the height of the container is already bigger
 * than the passed in value, the container is left unchanged.
 * 
 * @param container
 * @param minHeight
 *          - The minimum height of the container
 */
private void setGroupHeight(JRElementGroup container, int minHeight) {
    if (container instanceof JRDesignBand) {
        ((JRDesignBand) container).setHeight(Math.max(minHeight, ((JRDesignBand) container).getHeight()));
    }
    if (container instanceof JRDesignFrame) {
        ((JRDesignFrame) container).setHeight(Math.max(minHeight, ((JRDesignFrame) container).getHeight()));
    }
}
项目:PDFReporter-Studio    文件:MFrame.java   
@Override
public JRDesignElement createJRElement(JasperDesign jasperDesign) {
    JRDesignElement jrDesignElement = new JRDesignFrame();

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

    jrDesignElement.setWidth(getDefaultWidth());
    jrDesignElement.setHeight(getDefaultHeight());
    return jrDesignElement;
}
项目:PDFReporter-Studio    文件:MFrame.java   
@Override
public Dimension getSize() {
    JRDesignFrame jrDesignFrame = getValue();
    int h = jrDesignFrame.getHeight();
    int w = jrDesignFrame.getWidth();
    return new Dimension(w, h);
}
项目:PDFReporter-Studio    文件:CreatePageXofYCommand.java   
@Override
public void undo() {
    if (jrGroup instanceof JRDesignElementGroup)
        ((JRDesignElementGroup) jrGroup).removeElement(tfPageNumber);
    else if (jrGroup instanceof JRDesignFrame)
        ((JRDesignFrame) jrGroup).removeElement(tfPageNumber);

    if (jrGroup instanceof JRDesignElementGroup)
        ((JRDesignElementGroup) jrGroup).removeElement(tfPageTotal);
    else if (jrGroup instanceof JRDesignFrame)
        ((JRDesignFrame) jrGroup).removeElement(tfPageTotal);
}
项目:PDFReporter-Studio    文件:OrphanElementGroupCommand.java   
@Override
public void execute() {
    index = jrGroup.getChildren().indexOf(jrElement);
    if (jrGroup instanceof JRDesignElementGroup)
        ((JRDesignElementGroup) jrGroup).removeElementGroup(jrElement);
    else if (jrGroup instanceof JRDesignFrame)
        ((JRDesignFrame) jrGroup).removeElementGroup(jrElement);
}
项目:PDFReporter-Studio    文件:OrphanElementGroupCommand.java   
@Override
public void undo() {
    if (jrGroup instanceof JRDesignElementGroup) {
        if (index > ((JRDesignElementGroup) jrGroup).getChildren().size())
            ((JRDesignElementGroup) jrGroup).addElementGroup(jrElement);
        else
            ((JRDesignElementGroup) jrGroup).addElementGroup(index, jrElement);
    } else if (jrGroup instanceof JRDesignFrame) {
        if (index > ((JRDesignFrame) jrGroup).getChildren().size())
            ((JRDesignFrame) jrGroup).addElementGroup(jrElement);
        else
            ((JRDesignFrame) jrGroup).addElementGroup(index, jrElement);
    }
}
项目:PDFReporter-Studio    文件:CreateElementCommand.java   
@Override
public void undo() {
    if (commands != null)
        commands.undo();
    if (jrGroup instanceof JRDesignElementGroup)
        ((JRDesignElementGroup) jrGroup).removeElement(jrElement);
    else if (jrGroup instanceof JRDesignFrame)
        ((JRDesignFrame) jrGroup).removeElement(jrElement);
}
项目:PDFReporter-Studio    文件:CreateElementCommand.java   
public static void removeElement(JRDesignElement element, JRElement[] elements) {
    for (JRElement el : elements) {
        if (el instanceof IGroupElement) {
            JRDesignElementGroup egroup = (JRDesignElementGroup) ((IGroupElement) el).getJRElementGroup();
            egroup.removeElement(element);
            removeElement(element, egroup.getElements());
        } else if (el instanceof JRDesignFrame) {
            JRDesignFrame frame = (JRDesignFrame) el;
            frame.removeElement(element);
            removeElement(element, frame.getElements());
        }
    }
}
项目:PDFReporter-Studio    文件:DeleteElementCommand.java   
@Override
public void execute() {
    if (jrGroup != null && jrGroup.getChildren() != null) {
        elementPosition = jrGroup.getChildren().indexOf(jrElement);
        if (jrGroup instanceof JRDesignElementGroup) {
            ((JRDesignElementGroup) jrGroup).removeElement(jrElement);
        } else if (jrGroup instanceof JRDesignFrame) {
            ((JRDesignFrame) jrGroup).removeElement(jrElement);
        }
        if (jrGroup instanceof JRPropertiesHolder) {
            String uuid = null;
            if (jrGroup instanceof JRBaseElement)
                uuid = ((JRBaseElement) jrGroup).getUUID().toString();
            Dimension d = new Dimension(0, 0);
            if (jrGroup instanceof JRCommonElement) {
                JRCommonElement jce = (JRCommonElement) jrGroup;
                // Commented for back-compatibility in 3.6.
                // Replaced with the following line.
                // d.setSize(jce.getWidth(), jce.getHeight());
                d.setSize(new Dimension(jce.getWidth(), jce.getHeight()));
            }
            if (jrGroup instanceof JRDesignBand) {
                int w = jDesign.getPageWidth() - jDesign.getLeftMargin() - jDesign.getRightMargin();
                // Commented for back-compatibility in 3.6.
                // Replaced with the following line.
                // d.setSize(w, ((JRDesignBand) jrGroup).getHeight());
                d.setSize(new Dimension(w, ((JRDesignBand) jrGroup).getHeight()));
            }
            if (lCmd == null) {
                ILayout layout = LayoutManager.getLayout(pholder, jDesign, uuid);
                lCmd = new LayoutCommand(jrGroup, layout, d);
                lCmd.execute();
            }
        }
    }
}
项目:PDFReporter-Studio    文件:OrphanElementCommand.java   
@Override
public void execute() {
    location = new Point(jrElement.getX(), jrElement.getY());
    index = jrGroup.getChildren().indexOf(jrElement);
    if (jrGroup instanceof JRDesignElementGroup)
        ((JRDesignElementGroup) jrGroup).removeElement(jrElement);
    else if (jrGroup instanceof JRDesignFrame)
        ((JRDesignFrame) jrGroup).removeElement(jrElement);
}
项目:PDFReporter-Studio    文件:DeleteElementGroupCommand.java   
@Override
public void execute() {
    elementPosition = jrGroup.getChildren().indexOf(jrElement);
    if (jrGroup instanceof JRDesignElementGroup)
        ((JRDesignElementGroup) jrGroup).removeElementGroup(jrElement);
    else if (jrGroup instanceof JRDesignFrame)
        ((JRDesignFrame) jrGroup).removeElementGroup(jrElement);
}
项目:PDFReporter-Studio    文件:DeleteElementGroupCommand.java   
@Override
public void undo() {
    if (jrGroup instanceof JRDesignElementGroup) {
        if (elementPosition > ((JRDesignElementGroup) jrGroup).getChildren().size())
            ((JRDesignElementGroup) jrGroup).addElementGroup(jrElement);
        else
            ((JRDesignElementGroup) jrGroup).addElementGroup(elementPosition, jrElement);
    } else if (jrGroup instanceof JRDesignFrame) {
        if (elementPosition > ((JRDesignFrame) jrGroup).getChildren().size())
            ((JRDesignFrame) jrGroup).addElementGroup(jrElement);
        else
            ((JRDesignFrame) jrGroup).addElementGroup(elementPosition, jrElement);
    }
}
项目:PDFReporter-Studio    文件:CreateElementGroupCommand.java   
@Override
public void undo() {
    if (jrGroup instanceof JRDesignElementGroup)
        ((JRDesignElementGroup) jrGroup).removeElementGroup(jrElement);
    else if (jrGroup instanceof JRDesignFrame)
        ((JRDesignFrame) jrGroup).removeElementGroup(jrElement);
}
项目:PDFReporter-Studio    文件:ReportGenerator.java   
public void removeElement(JRElementGroup container, JRDesignElement element) {
    if (container instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) container).removeElement(element);
    }
    if (container instanceof JRDesignFrame) {
        ((JRDesignFrame) container).removeElement(element);
    }
}
项目:PDFReporter-Studio    文件:ReportGenerator.java   
public void addElement(JRElementGroup container, JRDesignElement element) {
    if (container instanceof JRDesignElementGroup) {
        ((JRDesignElementGroup) container).addElement(element);

    }
    if (container instanceof JRDesignFrame) {
        ((JRDesignFrame) container).addElement(element);
    }
}