Package javax.swing.table

Examples of javax.swing.table.DefaultTableModel


  public void testEventOrder() throws Exception
  {
    setUp();
    final MasterReport report = getReport();
    final DefaultTableModel model = new DefaultTableModel(2, 1);
    model.setValueAt("0-0", 0, 0);
    model.setValueAt("0-1", 1, 0);
    report.setDataFactory(new TableDataFactory
        ("default", model));

    logger.debug("   GRAPHICS2D ..");
    assertTrue(FunctionalityTestLib.execGraphics2D(report));
View Full Code Here


      }
      else
      {
        expressionRuntime = new GenericExpressionRuntime
            (new CompoundDataRow(staticDataRow, createDataRow(entries)),
                new DefaultTableModel(), -1, new DefaultProcessingContext());
      }


      final String formula = computeFormula(configIndicator);
      final Formula compiledFormula = new Formula(formula);
View Full Code Here

    ClassicEngineBoot.getInstance().start();
    String[] COLNAMES = {
        "crew", "trial", "run", "FloatVar", "IntVar", "run", "clock"
    };

    final DefaultTableModel tableModel = new DefaultTableModel(COLNAMES, 8000);

    final MasterReport report = new MasterReport();
    report.setDataFactory(new TableDataFactory
        ("default", tableModel));

    final RelationalGroup group = new RelationalGroup();
    group.setName("Run");
    group.addField("run");

    LabelElementFactory labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(0, 0));
    labelFactory.setMinimumSize(new FloatDimension(160, 12));
    labelFactory.setText("Crew:");
    group.getHeader().addElement(labelFactory.createElement());

    TextFieldElementFactory textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("crew");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(50, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(-100, 12));
    group.getHeader().addElement(textFieldFactory.createElement());

    labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(100, 0));
    labelFactory.setMinimumSize(new FloatDimension(160, 12));
    labelFactory.setText("Trial:");
    group.getHeader().addElement(labelFactory.createElement());

    textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("trial");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(150, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(-100, 12));
    group.getHeader().addElement(textFieldFactory.createElement());

    labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    labelFactory.setMinimumSize(new FloatDimension(160, 12));
    labelFactory.setText("Run:");
    group.getHeader().addElement(labelFactory.createElement());

    textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("run");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(250, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(-100, 12));
    group.getHeader().addElement(textFieldFactory.createElement());

    group.getFooter().getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(15));

    report.addGroup(group);

    final Band b = new Band();
    b.setName("variables");
    b.getStyle().setStyleProperty(TextStyleKeys.BOLD, Boolean.FALSE);
    b.getStyle().setStyleProperty(TextStyleKeys.FONT, "SansSerif");
    b.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(10));
//    b.setLayoutCacheable(false);

    for (int i = 3, max = tableModel.getColumnCount(); i < max; ++i)
    {
      TextFieldElementFactory tFF = new TextFieldElementFactory();
      tFF.setFieldname(tableModel.getColumnName(i));
      tFF.setAbsolutePosition(new Point2D.Float(200 * (i - 3), 0));
      tFF.setMinimumSize(new FloatDimension(200, 12));
      b.addElement(tFF.createElement());
    }
    report.getItemBand().addElement(b);
View Full Code Here

    switchFunction.setNumberOfElements(1);
    report.getExpressions().add(switchFunction);

    report.getReportConfiguration().setConfigProperty("org.pentaho.reporting.engine.classic.core.layout.fontrenderer.UseMaxCharBounds", Boolean.TRUE.toString());

    DefaultTableModel tm1 = new DefaultTableModel(new Object[][]{{"1"}, {"2"}, {"3"}, {"4"}, {"5"}, {"6"}, {"7"}, {"8"}, {"9"}}, new Object[]{"column"});

    TableDataFactory dataFactory = new TableDataFactory("default", tm1);
    report.setDataFactory(dataFactory);

    ClassicEngineBoot.getInstance().start();
View Full Code Here

    Object[] names = new Object[]{
            "Capacity", "Cost", "Group", "Location", "Type", "Container", "Date Acquired" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-7
    };

    final TableModel dataModel = new DefaultTableModel(data, names);
    MasterReport report = parseReport(getReportDefinitionSource());
    report.setDataFactory(new TableDataFactory
        ("default", dataModel)); //$NON-NLS-1$
    assertTrue(FunctionalityTestLib.execGraphics2D(report)); }
View Full Code Here

    CSVTableModelProducer csvTableModelProducer = new CSVTableModelProducer(stream);
    csvTableModelProducer.setColumnNameFirstLine(true);
    final TableModel tableModel = csvTableModelProducer.parse();
    csvTableModelProducer.close();

    final DefaultTableModel model = copyInto(tableModel);
    model.setValueAt(largeText, 3,2);

    report.setDataFactory(new TableDataFactory(report.getQuery(), model));
    TestSystem.showPreview(report);
  }
View Full Code Here

        rowData[j] = model.getValueAt(i, j);
      }
      data[i] = rowData;
    }

    return new DefaultTableModel(data, names);
  }
View Full Code Here

  public  void testPre112() throws ReportProcessingException, IOException, ReportDefinitionException
  {
    ClassicEngineBoot.getInstance().start();
    String outputFilename = getReportOutputPath() + "/report-282.html"; //$NON-NLS-1$
    final MasterReport report = parseReport(getReportDefinitionSource());
    report.setDataFactory(new TableDataFactory(report.getQuery(), new DefaultTableModel(10, 10)));
    HtmlReportUtil.createStreamHTML(report, outputFilename);
    assertTrue(true);
  }
View Full Code Here

  public void test268() throws ReportProcessingException, IOException, ReportDefinitionException
  {
    final MasterReport report = parseReport(getReportDefinitionSource());

    final TableDataFactory tdf = new TableDataFactory();
    tdf.addTable("default", new DefaultTableModel(10, 10));
    tdf.addTable("SubQ1", new DefaultTableModel(11, 10));
    report.setDataFactory(tdf);
   
    final PageFormat pageFormat = report.getPageDefinition().getPageFormat(0);
//    pageFormat.setOrientation(PageFormat.LANDSCAPE);
    report.setPageDefinition(new SimplePageDefinition(pageFormat));
View Full Code Here

    catch (Exception e)
    {
      // ignore generate a new dataset
      final String[] columnNames = {"January", "February", "March", "April", "May", "June", "July", "August",
          "September", "October", "November", "December"};
      return new DefaultTableModel(columnNames, 0);
    }
  }
View Full Code Here

TOP

Related Classes of javax.swing.table.DefaultTableModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.