Java 类net.sf.jasperreports.engine.type.TabStopAlignEnum 实例源码

项目:jasperreports    文件:TabStopFactory.java   
@Override
public Object createObject(Attributes atts)
{
    TabStop tabStop = new TabStop();

    String position = atts.getValue(JRXmlConstants.ATTRIBUTE_position);
    if (position != null && position.length() > 0)
    {
        tabStop.setPosition(Integer.parseInt(position));
    }

    TabStopAlignEnum alignment = TabStopAlignEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_alignment));
    if (alignment != null)
    {
        tabStop.setAlignment(alignment);
    }

    return tabStop;
}
项目:jasperreports    文件:DocxParagraphHelper.java   
/**
 *
 */
public static String getTabStopAlignment(TabStopAlignEnum alignment)
{
    if (alignment != null)
    {
        switch (alignment)
        {
            case RIGHT :
                return TAB_STOP_ALIGN_RIGHT;
            case CENTER :
                return TAB_STOP_ALIGN_CENTER;
            case LEFT :
            default :
                return TAB_STOP_ALIGN_LEFT;
        }
    }
    return null;
}
项目:ireport-fork    文件:JRTabStopsPropertyCustomEditor.java   
public List getTabStops() {


        List<TabStop> tabStops = new ArrayList<TabStop>();

        DefaultTableModel dtm = (DefaultTableModel)jTableProperties.getModel();
        for (int i=0; i<dtm.getRowCount(); ++i)
        {
            if (dtm.getValueAt(i, 0) != null)
            {
                tabStops.add( new TabStop( (Integer)dtm.getValueAt(i, 0)  , TabStopAlignEnum.getByValue( (Byte)dtm.getValueAt(i, 1)  )));
            }
        }

        return tabStops;
    }
项目:dynamicreports-jasper    文件:Style7Test.java   
@Override
public void test() {
    super.test();

    numberOfPagesTest(1);

    JRStyle style = getElementAt("title.textField1", 0).getStyle();
    Assert.assertEquals("line spacing", LineSpacingEnum.DOUBLE, style.getParagraph().getLineSpacing());
    Assert.assertEquals("line spacing size", new Float(2), style.getParagraph().getLineSpacingSize());
    Assert.assertEquals("first line indent", new Integer(10), style.getParagraph().getFirstLineIndent());
    Assert.assertEquals("left indent", new Integer(15), style.getParagraph().getLeftIndent());
    Assert.assertEquals("right indent", new Integer(20), style.getParagraph().getRightIndent());
    Assert.assertEquals("spacing before", new Integer(5), style.getParagraph().getSpacingBefore());
    Assert.assertEquals("spacing after", new Integer(6), style.getParagraph().getSpacingAfter());
    Assert.assertEquals("tab stop width", new Integer(9), style.getParagraph().getTabStopWidth());
    TabStop[] tabStops = style.getParagraph().getTabStops();
    Assert.assertNotNull("tab stops", tabStops);
    Assert.assertEquals("tab stop position", 12, tabStops[0].getPosition());
    Assert.assertEquals("tab stop alignment", TabStopAlignEnum.CENTER, tabStops[0].getAlignment());
}
项目:jasperreports    文件:JRApiWriter.java   
/**
 *
 */
private void writeTabStop(TabStop tabStop, String tabStopName)
{
    if (tabStop != null)
    {
        write( "TabStop " + tabStopName + " = new TabStop();\n");
        write( tabStopName + ".setAlignment({0});\n", tabStop.getAlignment(), TabStopAlignEnum.LEFT);
        write( tabStopName + ".setPosition({0});\n", tabStop.getPosition());
        flush();
    }
}
项目:jasperreports    文件:ParagraphStyle.java   
/**
 *
 */
public static String getTabStopAlignment(TabStopAlignEnum tabStopAlignment)
{
    switch (tabStopAlignment)
    {
        case RIGHT :
            return TAB_STOP_ALIGN_RIGHT;
        case CENTER :
            return TAB_STOP_ALIGN_CENTER;
        case LEFT :
        default :
            return TAB_STOP_ALIGN_LEFT;
    }
}
项目:PDFReporter-Studio    文件:TabStopsPage.java   
public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    composite.setLayout(layout);
    setControl(composite);

    buildTable(composite);

    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 400;
    table.setLayoutData(gd);

    Composite bGroup = new Composite(composite, SWT.NONE);
    bGroup.setLayout(new GridLayout(1, false));
    bGroup.setLayoutData(new GridData(GridData.FILL_VERTICAL));

    new NewButton().createNewButtons(bGroup, tableViewer, new INewElement() {

        public Object newElement(List<?> input, int pos) {
            TabStop p = new TabStop();
            p.setPosition(20);
            p.setAlignment(TabStopAlignEnum.LEFT);
            return p;
        }

    });

    new DeleteButton().createDeleteButton(bGroup, tableViewer);
    new ListOrderButtons().createOrderButtons(bGroup, tableViewer);
}
项目:ireport-fork    文件:JRTabStopsPropertyCustomEditor.java   
public JRTabStopsPropertyCustomEditor (Object value, PropertyEditor editor, PropertyEnv env) {
    this.env = env;
    this.editor = editor;
    this.env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
    this.env.addPropertyChangeListener(this);

    initComponents();

    Tag[] tags = new Tag[] {
                new Tag( TabStopAlignEnum.LEFT.getValueByte(), I18n.getString("AbstractStyleNode.Property.Left")  ),
                new Tag( TabStopAlignEnum.CENTER.getValueByte(), I18n.getString("AbstractStyleNode.Property.Center")  ),
                new Tag( TabStopAlignEnum.RIGHT.getValueByte(), I18n.getString("AbstractStyleNode.Property.Right")  )
                };

    jTableProperties.getColumnModel().getColumn(1).setCellEditor(new ComboBoxEditor(tags));

    jTableProperties.getColumnModel().getColumn(1).setCellRenderer(new ComboBoxRenderer(tags));

    DefaultListSelectionModel dlsm =  (DefaultListSelectionModel)this.jTableProperties.getSelectionModel();
    dlsm.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e)  {
            jTablePropertiesListSelectionValueChanged(e);
        }
    });  

    if (value instanceof List && value != null)
    {
        setTabStops((List)value);
    }
}
项目:dynamicreports-jasper    文件:JasperTemplateStyleLoader.java   
private static TabStopAlignment tabStopAlignment(TabStopAlignEnum alignment) {
    switch (alignment) {
    case LEFT:
        return TabStopAlignment.LEFT;
    case CENTER:
        return TabStopAlignment.CENTER;
    case RIGHT:
        return TabStopAlignment.RIGHT;
    default:
        throw new JasperDesignException("TabStopAlignment " + alignment.name() + " not supported");
    }
}
项目:dynamicreports-jasper    文件:ConstantTransform.java   
public static TabStopAlignEnum tabStopAlignment(TabStopAlignment alignment) {
    switch (alignment) {
    case LEFT:
        return TabStopAlignEnum.LEFT;
    case CENTER:
        return TabStopAlignEnum.CENTER;
    case RIGHT:
        return TabStopAlignEnum.RIGHT;
    default:
        throw new JasperDesignException("TabStopAlignment " + alignment.name() + " not supported");
    }
}
项目:jasperreports    文件:TabStop.java   
/**
 * 
 */
public TabStop(int position, TabStopAlignEnum alignment)
{
    this.position = position;
    this.alignment = alignment;
}
项目:jasperreports    文件:TabStop.java   
/**
 * Gets the tab stop alignment.
 */
public TabStopAlignEnum getAlignment()
{
    return alignment;
}
项目:jasperreports    文件:TabStop.java   
/**
 * Sets the tab stop alignment.
 */
public void setAlignment(TabStopAlignEnum alignment)
{
    this.alignment = alignment;
}
项目:ireport-fork    文件:JRTabStopsPropertyCustomEditor.java   
private void jButtonNewPropertyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNewPropertyActionPerformed

    DefaultTableModel dtm = (DefaultTableModel)jTableProperties.getModel();

    Vector row = new Vector();
    row.addElement(0);
    row.addElement( TabStopAlignEnum.LEFT.getValue() );
    dtm.addRow(row);


}