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

项目:PDFReporter-Studio    文件:HyperLinkPanel.java   
/**
 * Refresh the contents of the controls, setting into them the data of the selected element
 */
public void refresh() {
    APropertyNode element = getElement();
    if (element != null) {
        setExpressionComponentData(anchorWidget, element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION));
        setExpressionComponentData(referenceWidget, element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION));
        setExpressionComponentData(whenWidget, element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION));
        setExpressionComponentData(pageWidget, element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION));
        setExpressionComponentData(tooltipWidget, element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION));
        parametersWidget.updateData();
        Object propertyValue = element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_LINK_TARGET);
        targetCombo.setText(propertyValue != null ? propertyValue.toString() : linkTargetItems[0]);
        propertyValue = element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_LINK_TYPE);
        String typeValue = propertyValue != null ? propertyValue.toString() : linkTypeItems[0];
        //I don't set the text on the combo if it has already the right value to avoid to raise the panel refresh
        if (!typeValue.equals(typeCombo.getText())) typeCombo.setText(typeValue);
    }
}
项目:PDFReporter-Studio    文件:HyperlinkSection.java   
/**
 * Refresh the contents of the controls, setting into them the data of the selected element
 */
@Override
public void refresh() {
    setRefreshing(true);
    APropertyNode element = getElement();
    if (element != null) {
        anchorWidget.setData(element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION));
        referenceWidget.setData(element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION));
        whenWidget.setData(element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION));
        pageWidget.setData(element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION));
        tooltipWidget.setData(element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION));
        parametersWidget.setData(element, element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS));
        Object propertyValue = element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_LINK_TARGET);
        targetCombo.setText(propertyValue != null ? propertyValue.toString() : linkTargetItems[0]);
        propertyValue = element.getPropertyActualValue(JRDesignHyperlink.PROPERTY_LINK_TYPE);
        String typeValue = propertyValue != null ? propertyValue.toString() : linkTypeItems[0];
        //I don't set the text on the combo if it has already the right value to avoid to raise the panel refresh
        if (!typeValue.equals(typeCombo.getText())) typeCombo.setText(typeValue);   
    }
    setRefreshing(false);
}
项目:PDFReporter-Studio    文件:ReportUnitDropTargetListener.java   
/**
 * Drop action, get a list of string from the event, where the first position it the name of the unit and the other
 * are the parameters of the unit, using this set the parameter inside the element model
 */
@Override
protected void handleDrop() {
    if (getTargetEditPart() instanceof TextFieldFigureEditPart || getTargetEditPart() instanceof ImageFigureEditPart){
      APropertyNode textField = (APropertyNode)getTargetEditPart().getModel();
      if (textField != null){
        ParameterDTO parameters = (ParameterDTO)textField.getPropertyValue(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS);
        if (parameters.getValue()== null){
            parameters.setValue(new JRHyperlinkParameter[0]);
        }
        //JRHyperlinkParameter[] params = parameters.getValue();
        List<JRHyperlinkParameter> newParams = new ArrayList<JRHyperlinkParameter>();
        //newParams.addAll(Arrays.asList(params));
        String[] dropParameters = (String[])getCurrentEvent().data;

        newParams.add(generateParameter("_report", dropParameters[0]));
        for(int i=1; i<dropParameters.length;i++){
            newParams.add(generateParameter(dropParameters[i], ""));
        }
        parameters.setValue(newParams.toArray(new JRHyperlinkParameter[newParams.size()]));
        textField.setPropertyValue(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS, parameters);
        textField.setPropertyValue(JRDesignHyperlink.PROPERTY_LINK_TYPE, "ReportExecution");
      }
    }
}
项目:ireport-fork    文件:PieSeriesPanel.java   
/**
 * @param pieDataset the pieDataset to set
 */
public void setPieSeries(JRDesignPieSeries originalPieSeries) {
    this.pieSeries = originalPieSeries;

    jRTextExpressionKey.setText(  Misc.getExpressionText(pieSeries.getKeyExpression()) );
    jRTextExpressionValue.setText(  Misc.getExpressionText(pieSeries.getValueExpression()) );
    jRTextExpressionLabel.setText(  Misc.getExpressionText(pieSeries.getLabelExpression()) );


    if (pieSeries.getSectionHyperlink() == null)
    {
        JRDesignHyperlink hl = new JRDesignHyperlink();
        hl.setHyperlinkType( HyperlinkTypeEnum.NONE);
        pieSeries.setSectionHyperlink(hl);
    }
    sectionItemHyperlinkPanel1.setHyperlink( pieSeries.getSectionHyperlink() );

}
项目:jasperreports    文件:JRHyperlinkFactory.java   
@Override
public Object createObject(Attributes atts) throws Exception
{
    JRDesignHyperlink link = new JRDesignHyperlink();

    link.setLinkType(atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkType));
    link.setLinkTarget(atts.getValue(JRXmlConstants.ATTRIBUTE_hyperlinkTarget));

    return link;
}
项目:jasperreports    文件:StandardChartSettings.java   
/**
 * Adds a custom hyperlink parameter.
 * 
 * @param parameter the parameter to add
 */
public void addHyperlinkParameter(JRHyperlinkParameter parameter)
{
    hyperlinkParameters.add(parameter);
    getEventSupport().fireCollectionElementAddedEvent(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS, 
            parameter, hyperlinkParameters.size() - 1);
}
项目:jasperreports    文件:StandardChartSettings.java   
/**
 * Removes a custom hyperlink parameter.
 * 
 * @param parameter the parameter to remove
 */
public void removeHyperlinkParameter(JRHyperlinkParameter parameter)
{
    int idx = hyperlinkParameters.indexOf(parameter);
    if (idx >= 0)
    {
        hyperlinkParameters.remove(idx);
        getEventSupport().fireCollectionElementRemovedEvent(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS, 
                parameter, idx);
    }
}
项目:jasperreports    文件:StandardChartSettings.java   
/**
 * Removes a custom hyperlink parameter.
 * <p>
 * If multiple parameters having the specified name exist, all of them
 * will be removed
 * </p>
 * 
 * @param parameterName the parameter name
 */
public void removeHyperlinkParameter(String parameterName)
{
    for (ListIterator<JRHyperlinkParameter> it = hyperlinkParameters.listIterator(); it.hasNext();)
    {
        JRHyperlinkParameter parameter = it.next();
        if (parameter.getName() != null && parameter.getName().equals(parameterName))
        {
            it.remove();
            getEventSupport().fireCollectionElementRemovedEvent(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS, 
                    parameter, it.nextIndex());
        }
    }
}
项目:PDFReporter-Studio    文件:OtherSectionPage.java   
@Override
protected void createFormContent(IManagedForm mform) {
    super.createFormContent(mform);
    mform.getForm().setText(Messages.OtherSectionPage_dialogText);


    Composite body = mform.getForm().getBody();
    body.setLayout(new GridLayout(1,false));
    CTabFolder folder = new CTabFolder(body, SWT.BORDER);
    folder.setLayoutData(new GridData(GridData.FILL_BOTH));

    CTabItem otherSectionValues = new CTabItem(folder, SWT.NONE);
    Composite valuesContainer = new Composite(folder, SWT.NONE); 
    valuesContainer.setLayout(new GridLayout(1,false));
    createValueControls(valuesContainer);
    otherSectionValues.setText(Messages.OtherSectionPage_groupValue);
    otherSectionValues.setControl(valuesContainer);

    CTabItem otherSectionHyperlink = new CTabItem(folder, SWT.NONE);
    Composite hyperlinkContainer = new Composite(folder, SWT.NONE); 
    hyperlinkContainer.setLayout(new GridLayout(1,false));
    createHyperlinkControls(hyperlinkContainer);
    otherSectionHyperlink.setText(Messages.OtherSectionPage_groupHyperlink);
    otherSectionHyperlink.setControl(hyperlinkContainer);

    folder.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            if (((CTabFolder)e.getSource()).getSelectionIndex() == 1){
                if (hyperlinkControls.getElement() != null && hyperlinkControls.getElement().getValue() == null){
                    hyperlinkControls.getElement().setValue(new JRDesignHyperlink());
                }
            }
        }
    });

    PlatformUI.getWorkbench().getHelpSystem().setHelp(body,"com.jaspersoft.studio.doc.editOtherSection");
}
项目:PDFReporter-Studio    文件:HyperLinkPanel.java   
/**
 * Update the values inside the MHyperlink property node with the value defined inside the expression widgets. 
 * The parameters are not updated here since the are update on the fly when the appropriate widget is used
 */
public void setAllExpressionValues(){
    setExpressionProperty(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION, anchorWidget);
    setExpressionProperty(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION, pageWidget);
    setExpressionProperty(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION, referenceWidget);
    setExpressionProperty(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION, whenWidget);
    setExpressionProperty(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION, tooltipWidget);
}
项目:PDFReporter-Studio    文件:HyperlinkSection.java   
@Override
public IHighlightPropertyWidget getWidgetForProperty(Object propertyId) {
    if (JRDesignHyperlink.PROPERTY_LINK_TARGET.equals(propertyId)){
        return new ASHighlightControl(targetCombo, new BackgroundHighlight(targetCombo));
    } else if (JRDesignHyperlink.PROPERTY_LINK_TYPE.equals(propertyId)){
        return new ASHighlightControl(typeCombo, new BackgroundHighlight(typeCombo));
    } else return super.getWidgetForProperty(propertyId);
}
项目:PDFReporter-Studio    文件:HyperlinkSection.java   
protected void initializeProvidedProperties() {
    super.initializeProvidedProperties();
    addProvidedProperties(JRDesignHyperlink.PROPERTY_LINK_TARGET, Messages.MHyperLink_link_target);
    addProvidedProperties(JRDesignHyperlink.PROPERTY_LINK_TYPE, Messages.MHyperLink_link_type);
    addProvidedProperties(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION, Messages.MHyperLink_hyperlink_anchor_expression);
    addProvidedProperties(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION, Messages.MHyperLink_hyperlink_page_expression);
    addProvidedProperties(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION, Messages.MHyperLink_hyperlink_reference_expression);
    addProvidedProperties(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION, Messages.MHyperLink_whenexpr);
    addProvidedProperties(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION, Messages.MHyperLink_hyperlink_tooltip_expression);
    addProvidedProperties(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS, Messages.common_parameters);
}
项目:PDFReporter-Studio    文件:MHyperLink.java   
public Object getPropertyValue(Object id) {
    // pen
    JRHyperlink jrElement = (JRHyperlink) getValue();
    if (jrElement != null) {
        if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET))
            return jrElement.getLinkTarget();
        if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE))
            return jrElement.getLinkType();
        if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION))
            return ExprUtil.getExpression(jrElement.getHyperlinkAnchorExpression());
        if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION))
            return ExprUtil.getExpression(jrElement.getHyperlinkPageExpression());
        if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION))
            return ExprUtil.getExpression(jrElement.getHyperlinkReferenceExpression());
        if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION))
            return ExprUtil.getExpression(jrElement.getHyperlinkWhenExpression());
        if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION))
            return ExprUtil.getExpression(jrElement.getHyperlinkTooltipExpression());
        if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) {
            if (propertyDTO == null) {
                propertyDTO = new ParameterDTO();
                propertyDTO.setJasperDesign(getJasperDesign());
                propertyDTO.setValue(jrElement.getHyperlinkParameters());
            }
            return propertyDTO;
        }
    }
    return null;
}
项目:PDFReporter-Studio    文件:MHyperLink.java   
public void setPropertyValue(Object id, Object value) {
    JRDesignHyperlink jrElement = (JRDesignHyperlink) getValue();
    if (jrElement != null) {
        if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET))
            jrElement.setLinkTarget((String) value);
        else if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE))
            jrElement.setLinkType((String) value);
        else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION))
            jrElement.setHyperlinkAnchorExpression(ExprUtil.setValues(jrElement.getHyperlinkAnchorExpression(), value));
        else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION))
            jrElement.setHyperlinkPageExpression(ExprUtil.setValues(jrElement.getHyperlinkPageExpression(), value));
        else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION))
            jrElement
                    .setHyperlinkReferenceExpression(ExprUtil.setValues(jrElement.getHyperlinkReferenceExpression(), value));
        else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION))
            jrElement.setHyperlinkWhenExpression(ExprUtil.setValues(jrElement.getHyperlinkWhenExpression(), value));
        else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION))
            jrElement.setHyperlinkTooltipExpression(ExprUtil.setValues(jrElement.getHyperlinkTooltipExpression(), value));
        else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) {
            if (value instanceof ParameterDTO) {
                ParameterDTO v = (ParameterDTO) value;

                JRHyperlinkParameter[] hyperlinkParameters = jrElement.getHyperlinkParameters();
                if (hyperlinkParameters != null)
                    for (JRHyperlinkParameter prm : hyperlinkParameters)
                        jrElement.removeHyperlinkParameter(prm);

                for (JRHyperlinkParameter param : v.getValue())
                    jrElement.addHyperlinkParameter(param);

                propertyDTO = v;
            }
        }
    }
}
项目:ireport-fork    文件:SpiderChartPanel.java   
private void jButtonModifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyActionPerformed

        if (currentSelectedChartComponent == null) return;
        if (jList1.getSelectedIndex() >= 0) {
            JRDesignCategorySeries cs = (JRDesignCategorySeries)jList1.getSelectedValue();
            CategorySeriesDialog csd = new CategorySeriesDialog(Misc.getMainFrame() ,true);

            csd.setSeriesExpression( (JRDesignExpression)cs.getSeriesExpression() );
            csd.setValueExpression( (JRDesignExpression)cs.getValueExpression() );
            csd.setLabelExpression( (JRDesignExpression)cs.getLabelExpression() );
            csd.setCategoryExpression((JRDesignExpression)cs.getCategoryExpression() );

            JRDesignHyperlink link = new JRDesignHyperlink();
            ModelUtils.copyHyperlink(cs.getItemHyperlink(), link);
            csd.setSectionItemHyperlink( link  );

            csd.setExpressionContext( this.getExpressionContext() );
            csd.setVisible(true);

            if (csd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
                cs.setSeriesExpression( csd.getSeriesExpression() );
                cs.setValueExpression( csd.getValueExpression() );
                cs.setLabelExpression( csd.getLabelExpression() );
                cs.setCategoryExpression(csd.getCategoryExpression() );
                cs.setItemHyperlink( csd.getSectionItemHyperlink() );

                jList1.updateUI();
                notifyChange();
            }

        }
}
项目:ireport-fork    文件:SpiderChartPanel.java   
public JRDesignCategorySeries cloneChartDatasetItem(JRDesignCategorySeries original)
{
    JRDesignCategorySeries cs = new JRDesignCategorySeries();
    cs.setSeriesExpression( (JRDesignExpression)original.getSeriesExpression().clone() );
    cs.setValueExpression( (JRDesignExpression)original.getValueExpression().clone() );
    cs.setLabelExpression( (JRDesignExpression)original.getLabelExpression().clone() );
    JRDesignHyperlink link = new JRDesignHyperlink();
    ModelUtils.copyHyperlink(original.getItemHyperlink(), link);
    cs.setItemHyperlink( link  );

    return cs;
}
项目:ireport-fork    文件:XYZDatasetPanel.java   
private void jButtonModifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyActionPerformed

    if (jList1.getSelectedIndex() >= 0)
    {
        JRDesignXyzSeries cs = (JRDesignXyzSeries)jList1.getSelectedValue();
        XYZSeriesDialog csd = new XYZSeriesDialog(Misc.getMainFrame() ,true);

        csd.setSeriesExpression( (JRDesignExpression)cs.getSeriesExpression() );
        csd.setXValueExpression( (JRDesignExpression)cs.getXValueExpression() );
        csd.setYValueExpression( (JRDesignExpression)cs.getYValueExpression() );
        csd.setZValueExpression( (JRDesignExpression)cs.getZValueExpression() );
        JRDesignHyperlink link = new JRDesignHyperlink();
        ModelUtils.copyHyperlink(cs.getItemHyperlink(), link);
        csd.setSectionItemHyperlink( link  );

        csd.setExpressionContext( this.getExpressionContext() );

        if (newInfo != null)
        {
            csd.setFocusedExpression(newInfo);
        }
        csd.setVisible(true);

        if (csd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION)
        {
            cs.setSeriesExpression( csd.getSeriesExpression() );
            cs.setXValueExpression( csd.getXValueExpression() );
            cs.setYValueExpression( csd.getYValueExpression() );
            cs.setZValueExpression( csd.getZValueExpression() );
            cs.setItemHyperlink( csd.getSectionItemHyperlink() );

            jList1.updateUI();
        }

    }
}
项目:ireport-fork    文件:XYDatasetPanel.java   
private void jButtonModifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyActionPerformed

    if (jList1.getSelectedIndex() >= 0)
    {

            JRDesignXySeries cs = (JRDesignXySeries)jList1.getSelectedValue();
            XYSeriesDialog csd = new XYSeriesDialog(Misc.getMainFrame() ,true);

            csd.setSeriesExpression( (JRDesignExpression)cs.getSeriesExpression() );
            csd.setXValueExpression( (JRDesignExpression)cs.getXValueExpression() );
            csd.setYValueExpression( (JRDesignExpression)cs.getYValueExpression() );
            csd.setLabelExpression( (JRDesignExpression)cs.getLabelExpression() );

            JRDesignHyperlink link = new JRDesignHyperlink();
            ModelUtils.copyHyperlink(cs.getItemHyperlink(), link);
            csd.setSectionItemHyperlink( link  );

            csd.setExpressionContext( this.getExpressionContext() );

            if (newInfo != null)
            {
                csd.setFocusedExpression(newInfo);
            }
            csd.setVisible(true);

            if (csd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION)
            {
                cs.setSeriesExpression( csd.getSeriesExpression() );
                cs.setXValueExpression( csd.getXValueExpression() );
                cs.setYValueExpression( csd.getYValueExpression() );
                cs.setLabelExpression( csd.getLabelExpression() );
                cs.setItemHyperlink( csd.getSectionItemHyperlink() );

                jList1.updateUI();
            }
    }
}
项目:ireport-fork    文件:TimeSeriesDatasetPanel.java   
private void jButtonModifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyActionPerformed

    if (jList1.getSelectedIndex() >= 0)
    {
        JRDesignTimeSeries cs = (JRDesignTimeSeries)jList1.getSelectedValue();
        TimeSeriesDialog csd = new TimeSeriesDialog(Misc.getMainFrame() ,true);
        csd.setExpressionContext( this.getExpressionContext() );

        csd.setSeriesExpression( (JRDesignExpression)cs.getSeriesExpression() );
        csd.setTimePeriodExpression( (JRDesignExpression)cs.getTimePeriodExpression() );
        csd.setValueExpression( (JRDesignExpression)cs.getValueExpression() );
        csd.setLabelExpression( (JRDesignExpression)cs.getLabelExpression() );
        JRDesignHyperlink link = new JRDesignHyperlink();
        ModelUtils.copyHyperlink(cs.getItemHyperlink(), link);
        csd.setSectionItemHyperlink( link  );

        if (newInfo != null)
        {
            csd.setFocusedExpression(newInfo);
        }

        csd.setVisible(true);

        if (csd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION)
        {
            cs.setSeriesExpression( csd.getSeriesExpression() );
            cs.setTimePeriodExpression( csd.getTimePeriodExpression() );
            cs.setValueExpression( csd.getValueExpression() );
            cs.setLabelExpression( csd.getLabelExpression() );
            cs.setItemHyperlink( csd.getSectionItemHyperlink() );   

            jList1.updateUI();
        }

    }
}
项目:ireport-fork    文件:CategoryDatasetPanel.java   
private void jButtonModifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyActionPerformed

    if (jList1.getSelectedIndex() >= 0)
    {
        JRDesignCategorySeries cs = (JRDesignCategorySeries)jList1.getSelectedValue();
        CategorySeriesDialog csd = new CategorySeriesDialog(Misc.getMainFrame() ,true);

        csd.setSeriesExpression( (JRDesignExpression)cs.getSeriesExpression() );
        csd.setCategoryExpression( (JRDesignExpression)cs.getCategoryExpression() );
        csd.setValueExpression( (JRDesignExpression)cs.getValueExpression() );
        csd.setLabelExpression( (JRDesignExpression)cs.getLabelExpression() );

        JRDesignHyperlink link = new JRDesignHyperlink();
        ModelUtils.copyHyperlink(cs.getItemHyperlink(), link);
        csd.setSectionItemHyperlink( link  );

        csd.setExpressionContext( this.getExpressionContext() );
        if (newInfo != null)
        {
            csd.setFocusedExpression ( newInfo );
        }
        csd.setVisible(true);

        if (csd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION)
        {
            cs.setSeriesExpression( csd.getSeriesExpression() );
            cs.setCategoryExpression( csd.getCategoryExpression() );
            cs.setValueExpression( csd.getValueExpression() );
            cs.setLabelExpression( csd.getLabelExpression() );
            cs.setItemHyperlink( csd.getSectionItemHyperlink() );

            jList1.updateUI();
        }

    }
}
项目:ireport-fork    文件:TimePeriodDatasetPanel.java   
private void jButtonModifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyActionPerformed

    if (jList1.getSelectedIndex() >= 0)
    {
        JRDesignTimePeriodSeries cs = (JRDesignTimePeriodSeries)jList1.getSelectedValue();
        TimePeriodSeriesDialog csd = new TimePeriodSeriesDialog(Misc.getMainFrame() ,true);

        csd.setSeriesExpression( (JRDesignExpression)cs.getSeriesExpression() );
        csd.setStartDateExpression( (JRDesignExpression)cs.getStartDateExpression() );
        csd.setEndDateExpression( (JRDesignExpression)cs.getEndDateExpression() );
        csd.setValueExpression( (JRDesignExpression)cs.getValueExpression() );
        csd.setLabelExpression( (JRDesignExpression)cs.getLabelExpression() );
        JRDesignHyperlink link = new JRDesignHyperlink();
        ModelUtils.copyHyperlink(cs.getItemHyperlink(), link);
        csd.setSectionItemHyperlink( link  );

        csd.setExpressionContext( this.getExpressionContext() );
        if (newInfo != null)
        {
            csd.setFocusedExpression(newInfo);
        }
        csd.setVisible(true);

        if (csd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION)
        {
            cs.setSeriesExpression( csd.getSeriesExpression() );
            cs.setStartDateExpression( csd.getStartDateExpression() );
            cs.setEndDateExpression( csd.getEndDateExpression() );
            cs.setValueExpression( csd.getValueExpression() );
            cs.setLabelExpression( csd.getLabelExpression() );
            //cs.setSectionItemHyperlink( csd.getSectionItemHyperlink() );
            cs.setItemHyperlink( csd.getSectionItemHyperlink() );              

            jList1.updateUI();
        }

    }
}
项目:PDFReporter-Studio    文件:MTextField.java   
@Override
public Object getPropertyValue(Object id) {
    JRDesignTextField jrElement = (JRDesignTextField) getValue();
    if (id.equals(JRDesignTextField.PROPERTY_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getExpression());
    if (id.equals(JRDesignTextField.PROPERTY_PATTERN_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getPatternExpression());

    if (id.equals(JRDesignTextField.PROPERTY_EVALUATION_TIME))
        return evaluationTimeD.getEnumValue(jrElement.getEvaluationTimeValue());
    if (id.equals(JRDesignStyle.PROPERTY_BLANK_WHEN_NULL))
        return jrElement.isOwnBlankWhenNull();
    if (id.equals(JRBaseTextField.PROPERTY_STRETCH_WITH_OVERFLOW))
        return new Boolean(jrElement.isStretchWithOverflow());
    if (id.equals(JRDesignStyle.PROPERTY_PATTERN))
        return jrElement.getOwnPattern();

    if (id.equals(JRDesignTextField.PROPERTY_EVALUATION_GROUP)) {
        if (jrElement.getEvaluationGroup() != null)
            return jrElement.getEvaluationGroup().getName();
        return ""; //$NON-NLS-1$
    }

    // hyperlink --------------------------------------
    if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET))
        return jrElement.getLinkTarget();
    if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE))
        return jrElement.getLinkType();
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) {
        if (propertyDTO == null) {
            propertyDTO = new ParameterDTO();
            propertyDTO.setJasperDesign(getJasperDesign());
            propertyDTO.setValue(jrElement.getHyperlinkParameters());
        }
        return propertyDTO;
    }
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION)) {
        return ExprUtil.getExpression(jrElement.getHyperlinkAnchorExpression());
    }
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION)) {
        return ExprUtil.getExpression(jrElement.getHyperlinkPageExpression());
    }
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION)) {
        return ExprUtil.getExpression(jrElement.getHyperlinkReferenceExpression());
    }
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION)) {
        return ExprUtil.getExpression(jrElement.getHyperlinkTooltipExpression());
    }
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION)) {
        return ExprUtil.getExpression(jrElement.getHyperlinkWhenExpression());
    }
    if (id.equals(JRDesignTextField.PROPERTY_ANCHOR_NAME_EXPRESSION)){
        return ExprUtil.getExpression(jrElement.getAnchorNameExpression());
    }
    if (id.equals(JRDesignTextField.PROPERTY_BOOKMARK_LEVEL)){
        return jrElement.getBookmarkLevel();
    }
    return super.getPropertyValue(id);
}
项目:PDFReporter-Studio    文件:MTextField.java   
@Override
public void setPropertyValue(Object id, Object value) {
    JRDesignTextField jrElement = (JRDesignTextField) getValue();

    if (id.equals(JRDesignTextField.PROPERTY_EVALUATION_TIME))
        jrElement.setEvaluationTime((EvaluationTimeEnum) evaluationTimeD.getEnumValue(value));
    else if (id.equals(JRDesignTextField.PROPERTY_EVALUATION_GROUP)) {
        if (value != null && !value.equals("")) { //$NON-NLS-1$
            JRDesignDataset dataset = (JRDesignDataset)getElementDataset();
            JRGroup group = (JRGroup) dataset.getGroupsMap().get(value);
            jrElement.setEvaluationGroup(group);
        } else
            jrElement.setEvaluationGroup(null);
    } else if (id.equals(JRDesignTextField.PROPERTY_EXPRESSION)){
        jrElement.setExpression(ExprUtil.setValues(jrElement.getExpression(), value));
        JRDesignExpression expression = (JRDesignExpression)jrElement.getExpression();
        //When the expression changes update also the listeners
        if (expression != null){
            removeListeners(expression);
            expression.getEventSupport().addPropertyChangeListener(new ExpressionNameChanged(this));
        }
    } else if (id.equals(JRDesignTextField.PROPERTY_PATTERN_EXPRESSION))
        jrElement.setPatternExpression(ExprUtil.setValues(jrElement.getPatternExpression(), value));
    else if (id.equals(JRDesignStyle.PROPERTY_BLANK_WHEN_NULL))
        jrElement.setBlankWhenNull((Boolean) value);
    else if (id.equals(JRDesignStyle.PROPERTY_PATTERN))
        jrElement.setPattern((String) value);
    else if (id.equals(JRBaseTextField.PROPERTY_STRETCH_WITH_OVERFLOW))
        jrElement.setStretchWithOverflow(((Boolean) value).booleanValue());
    else if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET))
        jrElement.setLinkTarget((String) value);
    else if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE))
        jrElement.setLinkType((String) value);
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION))
        jrElement.setHyperlinkAnchorExpression(ExprUtil.setValues(jrElement.getHyperlinkAnchorExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION))
        jrElement.setHyperlinkPageExpression(ExprUtil.setValues(jrElement.getHyperlinkPageExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION))
        jrElement.setHyperlinkReferenceExpression(ExprUtil.setValues(jrElement.getHyperlinkReferenceExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION)) {
        jrElement.setHyperlinkWhenExpression(ExprUtil.setValues(jrElement.getHyperlinkWhenExpression(), value));
    } else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION))
        jrElement.setHyperlinkTooltipExpression(ExprUtil.setValues(jrElement.getHyperlinkTooltipExpression(), value));
    else if (id.equals(JRDesignTextField.PROPERTY_ANCHOR_NAME_EXPRESSION))
        jrElement.setAnchorNameExpression(ExprUtil.setValues(jrElement.getAnchorNameExpression(), value));
    else if (id.equals(JRDesignTextField.PROPERTY_BOOKMARK_LEVEL))
        jrElement.setBookmarkLevel(value != null ? Integer.parseInt(value.toString()) : 0);
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) {
        if (value instanceof ParameterDTO) {
            ParameterDTO v = (ParameterDTO) value;

            JRHyperlinkParameter[] hyperlinkParameters = jrElement.getHyperlinkParameters();
            if (hyperlinkParameters != null)
                for (JRHyperlinkParameter prm : hyperlinkParameters)
                    jrElement.removeHyperlinkParameter(prm);

            for (JRHyperlinkParameter param : v.getValue())
                jrElement.addHyperlinkParameter(param);

            propertyDTO = v;
        }
    } else
        super.setPropertyValue(id, value);
}
项目:PDFReporter-Studio    文件:MHyperLink.java   
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) {

    String prefix = "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#";

    JRExpressionPropertyDescriptor anchorExpressionD = new JRExpressionPropertyDescriptor(
            JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION, Messages.MHyperLink_hyperlink_anchor_expression);
    anchorExpressionD.setDescription(Messages.MHyperLink_hyperlink_anchor_expression_description);
    desc.add(anchorExpressionD);
    anchorExpressionD.setHelpRefBuilder(new HelpReferenceBuilder(prefix + JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION));

    JRExpressionPropertyDescriptor pageExpressionD = new JRExpressionPropertyDescriptor(
            JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION, Messages.MHyperLink_hyperlink_page_expression);
    pageExpressionD.setDescription(Messages.MHyperLink_hyperlink_page_expression_description);
    desc.add(pageExpressionD);
    pageExpressionD.setHelpRefBuilder(new HelpReferenceBuilder(prefix + JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION));

    JRExpressionPropertyDescriptor referenceExpressionD = new JRExpressionPropertyDescriptor(
            JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION, Messages.MHyperLink_hyperlink_reference_expression);
    referenceExpressionD.setDescription(Messages.MHyperLink_hyperlink_reference_expression_description);
    desc.add(referenceExpressionD);
    referenceExpressionD.setHelpRefBuilder(new HelpReferenceBuilder(prefix + JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION));

    JRExpressionPropertyDescriptor whenExpressionD = new JRExpressionPropertyDescriptor(
            JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION, Messages.MHyperLink_whenexpr);
    whenExpressionD.setDescription(Messages.MHyperLink_whenexpr_desc);
    desc.add(whenExpressionD);
    whenExpressionD.setHelpRefBuilder(new HelpReferenceBuilder(prefix + JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION));

    JRExpressionPropertyDescriptor toolTipExpressionD = new JRExpressionPropertyDescriptor(
            JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION, Messages.MHyperLink_hyperlink_tooltip_expression);
    toolTipExpressionD.setDescription(Messages.MHyperLink_hyperlink_tooltip_expression_description);
    desc.add(toolTipExpressionD);
    toolTipExpressionD.setHelpRefBuilder(new HelpReferenceBuilder(prefix + JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION));

    ParameterPropertyDescriptor propertiesD = new ParameterPropertyDescriptor(
            JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS, Messages.common_parameters);
    propertiesD.setDescription(Messages.MHyperLink_parameters_description);
    desc.add(propertiesD);
    propertiesD.setHelpRefBuilder(new HelpReferenceBuilder(prefix + JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS));

    RComboBoxPropertyDescriptor linkTargetD = new RComboBoxPropertyDescriptor(
            JRDesignHyperlink.PROPERTY_HYPERLINK_TARGET, Messages.MHyperLink_link_target, EnumHelper.getEnumNames(
                    HyperlinkTargetEnum.values(), NullEnum.NULL));
    linkTargetD.setDescription(Messages.MHyperLink_link_target_description);
    desc.add(linkTargetD);
    linkTargetD.setHelpRefBuilder(new HelpReferenceBuilder(prefix + "sectionHyperlink_hyperlinkTarget"));

    RComboBoxPropertyDescriptor linkTypeD = new RComboBoxPropertyDescriptor(JRDesignHyperlink.PROPERTY_LINK_TYPE,
            Messages.MHyperLink_link_type, EnumHelper.getEnumNames(HyperlinkTypeEnum.values(), NullEnum.NULL));
    linkTypeD.setDescription(Messages.MHyperLink_link_type_description);
    desc.add(linkTypeD);
    linkTypeD.setHelpRefBuilder(new HelpReferenceBuilder(prefix + "sectionHyperlink_hyperlinkType"));


    propertiesD.setCategory(Messages.MHyperLink_hyperlink_category);
    anchorExpressionD.setCategory(Messages.MHyperLink_hyperlink_category);
    whenExpressionD.setCategory(Messages.MHyperLink_hyperlink_category);
    pageExpressionD.setCategory(Messages.MHyperLink_hyperlink_category);
    referenceExpressionD.setCategory(Messages.MHyperLink_hyperlink_category);
    toolTipExpressionD.setCategory(Messages.MHyperLink_hyperlink_category);

    linkTargetD.setCategory(Messages.MHyperLink_hyperlink_category);
    linkTypeD.setCategory(Messages.MHyperLink_hyperlink_category);

}
项目:PDFReporter-Studio    文件:MImage.java   
@Override
public Object getPropertyValue(Object id) {
    JRDesignImage jrElement = (JRDesignImage) getValue();
    if (id.equals(JRBaseStyle.PROPERTY_FILL))
        return fillD.getEnumValue(jrElement.getOwnFillValue());
    if (id.equals(JRBaseStyle.PROPERTY_SCALE_IMAGE))
        return scaleImageD.getEnumValue(jrElement.getOwnScaleImageValue());
    if (id.equals(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT))
        return hAlignD.getEnumValue(jrElement.getOwnHorizontalAlignmentValue());
    if (id.equals(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT))
        return vAlignD.getEnumValue(jrElement.getOwnVerticalAlignmentValue());
    if (id.equals(JRBaseImage.PROPERTY_ON_ERROR_TYPE))
        return onErrorTypeD.getEnumValue(jrElement.getOnErrorTypeValue());
    if (id.equals(JRDesignImage.PROPERTY_EVALUATION_TIME))
        return evaluationTimeD.getEnumValue(jrElement.getEvaluationTimeValue());
    if (id.equals(JRDesignImage.PROPERTY_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getExpression());

    if (id.equals(JRDesignImage.PROPERTY_EVALUATION_GROUP)) {
        if (jrElement.getEvaluationGroup() != null)
            return jrElement.getEvaluationGroup().getName();
        return ""; //$NON-NLS-1$
    }

    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) {
        if (propertyDTO == null) {
            propertyDTO = new ParameterDTO();
            propertyDTO.setJasperDesign(getJasperDesign());
            propertyDTO.setValue(jrElement.getHyperlinkParameters());
        }
        return propertyDTO;
    }
    if (id.equals(JRBaseImage.PROPERTY_USING_CACHE))
        return jrElement.getUsingCache();
    if (id.equals(JRBaseImage.PROPERTY_LAZY))
        return new Boolean(jrElement.isLazy());
    // hyperlink --------------------------------------
    if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET))
        return jrElement.getLinkTarget();
    if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE))
        return jrElement.getLinkType();
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getHyperlinkAnchorExpression());
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getHyperlinkPageExpression());
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getHyperlinkReferenceExpression());
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getHyperlinkTooltipExpression());
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION)) {
        return ExprUtil.getExpression(jrElement.getHyperlinkWhenExpression());
    }
    if (id.equals(JRDesignImage.PROPERTY_ANCHOR_NAME_EXPRESSION)){
        return ExprUtil.getExpression(jrElement.getAnchorNameExpression());
    }
    if (id.equals(JRDesignImage.PROPERTY_BOOKMARK_LEVEL)){
        return jrElement.getBookmarkLevel();
    }
    return super.getPropertyValue(id);
}
项目:PDFReporter-Studio    文件:MImage.java   
@Override
public Object getPropertyActualValue(Object id) {
    JRDesignImage jrElement = (JRDesignImage) getValue();
    if (id.equals(JRBaseStyle.PROPERTY_FILL))
        return fillD.getEnumValue(jrElement.getFillValue());
    if (id.equals(JRBaseStyle.PROPERTY_SCALE_IMAGE))
        return scaleImageD.getEnumValue(jrElement.getScaleImageValue());
    if (id.equals(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT))
        return hAlignD.getEnumValue(jrElement.getHorizontalAlignmentValue());
    if (id.equals(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT))
        return vAlignD.getEnumValue(jrElement.getVerticalAlignmentValue());
    if (id.equals(JRBaseImage.PROPERTY_ON_ERROR_TYPE))
        return onErrorTypeD.getEnumValue(jrElement.getOnErrorTypeValue());
    if (id.equals(JRDesignImage.PROPERTY_EVALUATION_TIME))
        return evaluationTimeD.getEnumValue(jrElement.getEvaluationTimeValue());
    if (id.equals(JRDesignImage.PROPERTY_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getExpression());

    if (id.equals(JRDesignImage.PROPERTY_EVALUATION_GROUP)) {
        if (jrElement.getEvaluationGroup() != null)
            return jrElement.getEvaluationGroup().getName();
        return ""; //$NON-NLS-1$
    }

    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) {
        if (propertyDTO == null) {
            propertyDTO = new ParameterDTO();
            propertyDTO.setJasperDesign(getJasperDesign());
            propertyDTO.setValue(jrElement.getHyperlinkParameters());
        }
        return propertyDTO;
    }
    if (id.equals(JRBaseImage.PROPERTY_USING_CACHE))
        return jrElement.getUsingCache();
    if (id.equals(JRBaseImage.PROPERTY_LAZY))
        return new Boolean(jrElement.isLazy());
    // hyperlink --------------------------------------
    if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET))
        return jrElement.getLinkTarget();
    if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE))
        return jrElement.getLinkType();
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getHyperlinkAnchorExpression());
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getHyperlinkPageExpression());
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getHyperlinkReferenceExpression());
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getHyperlinkTooltipExpression());
    if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION))
        return ExprUtil.getExpression(jrElement.getHyperlinkWhenExpression());
    return super.getPropertyActualValue(id);
}
项目:PDFReporter-Studio    文件:MImage.java   
@Override
public void setPropertyValue(Object id, Object value) {
    JRDesignImage jrElement = (JRDesignImage) getValue();
    if (id.equals(JRBaseStyle.PROPERTY_FILL))
        jrElement.setFill((FillEnum) fillD.getEnumValue(value));
    else if (id.equals(JRBaseStyle.PROPERTY_SCALE_IMAGE))
        jrElement.setScaleImage((ScaleImageEnum) scaleImageD.getEnumValue(value));
    else if (id.equals(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT))
        jrElement.setHorizontalAlignment((HorizontalAlignEnum) hAlignD.getEnumValue(value));
    else if (id.equals(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT))
        jrElement.setVerticalAlignment((VerticalAlignEnum) vAlignD.getEnumValue(value));
    else if (id.equals(JRBaseImage.PROPERTY_ON_ERROR_TYPE))
        jrElement.setOnErrorType((OnErrorTypeEnum) onErrorTypeD.getEnumValue(value));
    else if (id.equals(JRDesignImage.PROPERTY_EVALUATION_TIME))
        jrElement.setEvaluationTime((EvaluationTimeEnum) evaluationTimeD.getEnumValue(value));
    else if (id.equals(JRDesignImage.PROPERTY_EVALUATION_GROUP)) {
        if (value != null && !value.equals("")) { //$NON-NLS-1$
            JRDesignDataset dataset = (JRDesignDataset)getElementDataset();
            JRGroup group = (JRGroup) dataset.getGroupsMap().get(value);
            jrElement.setEvaluationGroup(group);
        }
    } else if (id.equals(JRDesignImage.PROPERTY_EXPRESSION))
        jrElement.setExpression(ExprUtil.setValues(jrElement.getExpression(), value));
    else if (id.equals(JRBaseImage.PROPERTY_USING_CACHE))
        jrElement.setUsingCache((Boolean) value);
    else if (id.equals(JRBaseImage.PROPERTY_LAZY))
        jrElement.setLazy(((Boolean) value).booleanValue());
    else if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET))
        jrElement.setLinkTarget((String) value);
    else if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE))
        jrElement.setLinkType((String) value);
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION))
        jrElement.setHyperlinkAnchorExpression(ExprUtil.setValues(jrElement.getHyperlinkAnchorExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION))
        jrElement.setHyperlinkPageExpression(ExprUtil.setValues(jrElement.getHyperlinkPageExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION))
        jrElement.setHyperlinkReferenceExpression(ExprUtil.setValues(jrElement.getHyperlinkReferenceExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION))
        jrElement.setHyperlinkTooltipExpression(ExprUtil.setValues(jrElement.getHyperlinkTooltipExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION)) {
        jrElement.setHyperlinkWhenExpression(ExprUtil.setValues(jrElement.getHyperlinkWhenExpression(), value));
    } else if (id.equals(JRDesignImage.PROPERTY_ANCHOR_NAME_EXPRESSION))
        jrElement.setAnchorNameExpression(ExprUtil.setValues(jrElement.getAnchorNameExpression(), value));
    else if (id.equals(JRDesignImage.PROPERTY_BOOKMARK_LEVEL))
        jrElement.setBookmarkLevel(value != null ? Integer.parseInt(value.toString()) : 0); 
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) {
        if (value instanceof ParameterDTO) {
            ParameterDTO v = (ParameterDTO) value;

            JRHyperlinkParameter[] hyperlinkParameters = jrElement.getHyperlinkParameters();
            if (hyperlinkParameters != null)
                for (JRHyperlinkParameter prm : hyperlinkParameters)
                    jrElement.removeHyperlinkParameter(prm);

            for (JRHyperlinkParameter param : v.getValue())
                jrElement.addHyperlinkParameter(param);

            propertyDTO = v;
        }
    }
    super.setPropertyValue(id, value);
}
项目:PDFReporter-Studio    文件:WHyperlink.java   
/**
 * Returns the actual {@link JRDesignHyperlink} instance handled by the widget. 
 * 
 * @return the current hyperlink
 */
public JRDesignHyperlink getHyperlink(){
    if(this.hyperlink.getHyperlinkTypeValue()==null){
        return null;            
    }

    // Adjust the hyperlink object depending on the hyperlink type,
    // resetting all useless properties that may be dirty due to editing.
    boolean clearParameters=false;
    switch (this.hyperlink.getHyperlinkTypeValue()) {
        case CUSTOM:
            this.hyperlink.setHyperlinkAnchorExpression(null);
            this.hyperlink.setHyperlinkPageExpression(null);
            this.hyperlink.setHyperlinkReferenceExpression(null);
            break;
        case LOCAL_ANCHOR:
            this.hyperlink.setHyperlinkPageExpression(null);
            this.hyperlink.setHyperlinkReferenceExpression(null);
            clearParameters=true;
            break;
        case LOCAL_PAGE:
            this.hyperlink.setHyperlinkAnchorExpression(null);
            this.hyperlink.setHyperlinkReferenceExpression(null);
            clearParameters=true;
            break;
        case REMOTE_ANCHOR:
            this.hyperlink.setHyperlinkPageExpression(null);
            clearParameters=true;
            break;
        case REMOTE_PAGE:
            this.hyperlink.setHyperlinkAnchorExpression(null);
            clearParameters=true;
            break;
        case NONE:
            this.hyperlink.setHyperlinkAnchorExpression(null);
            this.hyperlink.setHyperlinkPageExpression(null);
            this.hyperlink.setHyperlinkReferenceExpression(null);
            clearParameters=true;
            break;
        case REFERENCE: 
            this.hyperlink.setHyperlinkAnchorExpression(null);
            this.hyperlink.setHyperlinkPageExpression(null);
            clearParameters=true;
            break;
        default:
            return null;
    }

    if(clearParameters){
        List<JRHyperlinkParameter> allParameters = this.hyperlink.getHyperlinkParametersList();
        if(allParameters!=null){
            for(JRHyperlinkParameter p : allParameters){
                this.hyperlink.removeHyperlinkParameter(p);
            }
        }
        allParameters.clear();
    }

    return this.hyperlink;
}
项目:ireport-fork    文件:TimeSeriesDialog.java   
public void setSectionItemHyperlink(JRDesignHyperlink sectionItemHyperlink)
{
    sectionItemHyperlinkPanel1.setHyperlink( sectionItemHyperlink );
}
项目:ireport-fork    文件:XYZSeriesDialog.java   
public void setSectionItemHyperlink(JRDesignHyperlink sectionItemHyperlink)
{
    sectionItemHyperlinkPanel1.setHyperlink( sectionItemHyperlink );
}
项目:ireport-fork    文件:XYSeriesDialog.java   
public void setSectionItemHyperlink(JRDesignHyperlink sectionItemHyperlink)
{
    sectionItemHyperlinkPanel1.setHyperlink( sectionItemHyperlink );
}
项目:ireport-fork    文件:GanttSeriesDialog.java   
public void setSectionItemHyperlink(JRDesignHyperlink sectionItemHyperlink)
{
    sectionItemHyperlinkPanel1.setHyperlink( sectionItemHyperlink );
}
项目:ireport-fork    文件:TimePeriodSeriesDialog.java   
public void setSectionItemHyperlink(JRDesignHyperlink sectionItemHyperlink)
{
    sectionItemHyperlinkPanel1.setHyperlink( sectionItemHyperlink );
}
项目:ireport-fork    文件:CategorySeriesDialog.java   
public void setSectionItemHyperlink(JRDesignHyperlink sectionItemHyperlink)
{
    sectionItemHyperlinkPanel1.setHyperlink( sectionItemHyperlink );
}
项目:PDFReporter-Studio    文件:WHyperlink.java   
/**
 * Sets the new hyperlink object and updates the UI content according.
 * Hyperlink can not be null.
 * 
 * @param hyperlink the new {@link JRDesignHyperlink} instance to set
 */
public void setHyperlink(JRDesignHyperlink hyperlink){
    Assert.isNotNull(hyperlink);
    this.hyperlink=hyperlink;
    refreshWidgetsContent();
}