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

项目:ireport-fork    文件:CreateBreakAction.java   
public JRDesignElement createReportElement(JasperDesign jd)
{
    if (getScene() instanceof CrosstabObjectScene)
    {
        Runnable r = new Runnable() {
            public void run() {
                JOptionPane.showMessageDialog(Misc.getMainFrame(), "You can not use a break element inside a crosstab","Error", JOptionPane.WARNING_MESSAGE);
            }
        };

        Mutex.EVENT.readAccess(r); 
        return null;
    }

    JRDesignBreak element = new JRDesignBreak();

    BreakTypeDialog dialog = new BreakTypeDialog(Misc.getMainFrame(), true);
    dialog.setVisible(true);

    element.setWidth(100);
    element.setType(  dialog.getBreakTypeValue()  );
    return element;
}
项目:jasperreports    文件:JRBreakFactory.java   
@Override
public Object createObject(Attributes atts)
{
    JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);

    JRDesignBreak breakElement = new JRDesignBreak(jasperDesign);

    BreakTypeEnum type = BreakTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_type));
    if (type != null)
    {
        breakElement.setType(type);
    }

    return breakElement;
}
项目:PDFReporter-Studio    文件:MBreak.java   
@Override
public Object getPropertyValue(Object id) {
    JRDesignBreak jrElement = (JRDesignBreak) getValue();
    if (id.equals(JRBaseBreak.PROPERTY_TYPE))
        return typeD.getEnumValue(jrElement.getTypeValue());
    return super.getPropertyValue(id);
}
项目:PDFReporter-Studio    文件:MBreak.java   
@Override
public void setPropertyValue(Object id, Object value) {
    JRDesignBreak jrElement = (JRDesignBreak) getValue();

    if (id.equals(JRBaseBreak.PROPERTY_TYPE))
        jrElement.setType((BreakTypeEnum) typeD.getEnumValue(value));
    else
        super.setPropertyValue(id, value);
}
项目:PDFReporter-Studio    文件:MBreak.java   
@Override
public JRDesignElement createJRElement(JasperDesign jasperDesign) {
    JRDesignBreak brk = new JRDesignBreak();
    brk.setWidth(getDefaultWidth());
    brk.setHeight(getDefaultHeight());

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

    return brk;
}
项目:PDFReporter-Studio    文件:MBreak.java   
@Override
public void trasnferProperties(JRElement target){
    super.trasnferProperties(target);

    JRDesignBreak jrSource = (JRDesignBreak) getValue();
    if (jrSource != null){
        JRDesignBreak jrTarget = (JRDesignBreak)target;
        jrTarget.setType(jrSource.getTypeValue());
    }
}
项目:ireport-fork    文件:ElementPropertiesFactory.java   
public static Sheet.Set getBreakPropertySet(JRDesignBreak breakElement)
{
    Sheet.Set propertySet = Sheet.createPropertiesSet();
    propertySet.setName("BREAK_PROPERTIES");
    propertySet.setDisplayName("Break properties");
    propertySet.put(new BreakTypeProperty(breakElement));

    return propertySet;
}
项目:ireport-fork    文件:ElementNodeVisitor.java   
/**
 *
 */
public void visitBreak(JRBreak breakElement)
{
    node = new ElementNode(jasperDesign, (JRDesignBreak)breakElement,doLkp);
    node.setIconBaseWithExtension(ICON_BREAK);
}
项目:ireport-fork    文件:ElementPropertiesFactory.java   
/**
 * Convenient way to get all the properties of an element.
 * Properties positions could be reordered to have a better order.
 */
public static List<Sheet.Set> getPropertySets(JRDesignElement element, JasperDesign jd)
{
    List<Sheet.Set> sets = new ArrayList<Sheet.Set>();
    sets.add( getCommonPropertySet(element, jd) );

    if (element instanceof  JRDesignGraphicElement)
    {
        sets.addAll( GraphicElementPropertiesFactory.getGraphicPropertySets((JRDesignGraphicElement)element, jd) );
    }
    if (element instanceof  JRDesignTextElement)
    {
        sets.addAll( TextElementPropertiesFactory.getPropertySets(element, jd) );
    }
    if (element instanceof  JRDesignSubreport)
    {
        sets.addAll( SubreportPropertiesFactory.getPropertySets(element, jd) );
    }
    if (element instanceof JRDesignBreak)
    {
        sets.add( getBreakPropertySet((JRDesignBreak)element) );

    }

    if (element instanceof  JRDesignChart)
    {
        sets.addAll( ChartPropertiesFactory.getPropertySets((JRDesignChart)element, jd) );
    }



    if (element instanceof  JRBox)
    {
        sets.add( getBoxPropertySet((JRBox)element) );
    }

    if (element instanceof  JRDesignGenericElement)
    {
        sets.add(  getGenericElementPropertySet((JRDesignGenericElement)element, jd ) );
    }

    return sets;
}
项目:ireport-fork    文件:BreakTypeProperty.java   
@SuppressWarnings("unchecked")
public BreakTypeProperty(JRDesignBreak breakElement)
{
    super( BreakTypeEnum.class, breakElement);
    this.breakElement = breakElement;
}
项目:PDFReporter-Studio    文件:MBreak.java   
/**
 * Instantiates a new m break.
 * 
 * @param parent
 *          the parent
 * @param jrBreak
 *          the jr break
 * @param newIndex
 *          the new index
 */
public MBreak(ANode parent, JRDesignBreak jrBreak, int newIndex) {
    super(parent, newIndex);
    setValue(jrBreak);
}