当前位置: 首页>>代码示例>>Java>>正文


Java ReleaseInfoAdapter类代码示例

本文整理汇总了Java中ro.nextreports.engine.ReleaseInfoAdapter的典型用法代码示例。如果您正苦于以下问题:Java ReleaseInfoAdapter类的具体用法?Java ReleaseInfoAdapter怎么用?Java ReleaseInfoAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ReleaseInfoAdapter类属于ro.nextreports.engine包,在下文中一共展示了ReleaseInfoAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveXStream

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
private static void saveXStream(File file, Chart chart) throws Exception {
	XStream xstream = XStreamFactory.createXStream();
	FileOutputStream fos = new FileOutputStream(file);
	if (chart == null) {
		chart = Globals.getChartDesignerPanel().getChart();
		chart.setVersion(ReleaseInfoAdapter.getVersionNumber());
		chart.setName(getChartFileName(file));
		Report query = ro.nextreports.designer.Globals.getMainFrame().getQueryBuilderPanel()
				.createReport(file.getName());
		chart.setReport(query);
	}
	System.out.println("----- set Keys = " + I18nManager.getInstance().getKeys());
	System.out.println("----- set Languages = " + I18nManager.getInstance().getLanguages());
	chart.setI18nkeys(I18nManager.getInstance().getKeys());
	chart.setLanguages(I18nManager.getInstance().getLanguages());
	xstream.toXML(chart, fos);
	fos.close();
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:19,代码来源:ChartUtil.java

示例2: getTemplate

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
public static ChartTemplate getTemplate(Chart chart) {
ChartTemplate template = new ChartTemplate();
template.setVersion(ReleaseInfoAdapter.getVersionNumber());
      template.setBackground(chart.getBackground());
      template.setForegrounds(chart.getForegrounds());
      template.setTitleColor(chart.getTitle().getColor());
      template.setxAxisColor(chart.getxAxisColor());
      template.setyAxisColor(chart.getyAxisColor());
      template.setxLabelColor(chart.getXColor());
      template.setyLabelColor(chart.getYColor());
      template.setxLegendColor(chart.getXLegend().getColor());
      template.setyLegendColor(chart.getYLegend().getColor());
      template.setxGridColor(chart.getXGridColor());
      template.setyGridColor(chart.getYGridColor());
      return template;
  }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:17,代码来源:TemplateManager.java

示例3: getMetaData

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
private String getMetaData() {
    StringBuilder sb = new StringBuilder();
    sb.append("\t<meta name=\"author\" content=\"").
            append(ReleaseInfoAdapter.getCompany()).
            append("\"/>").append(lineSeparator);
    sb.append("\t<meta name=\"creator\" content=\"").
            append("NextReports ").append(ReleaseInfoAdapter.getVersionNumber()).
            append("\"/>").append(lineSeparator);
    sb.append("\t<meta name=\"subject\" content=\"").
            append("Created by NextReports Designer ").append(ReleaseInfoAdapter.getVersionNumber()).
            append("\"/>").append(lineSeparator);
    sb.append("\t<meta name=\"date\" content=\"").
            append(new Date()).
            append("\"/>").append(lineSeparator);
    sb.append("\t<meta name=\"keywords\" content=\"").
            append(ReleaseInfoAdapter.getHome()).
            append("\"/>").append(lineSeparator);
    return sb.toString();
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:20,代码来源:XmlExporter.java

示例4: createReport

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
    public Report createReport(String name) {
        Report report = new Report();
        report.setName(name);
        report.setVersion(ReleaseInfoAdapter.getVersionNumber());
        if (queryWasModified(true)) {
            report.setSql(getUserSql());
        } else {
            report.setQuery(getSelectQuery());
            report.setTables(getTables());
            report.setRows(getRows());
        }
        LinkedList<QueryParameter> parameters = (LinkedList) ParameterManager.getInstance().getParameters();
        // Saved the parameters in the order inside sql!
//		LinkedList<QueryParameter> parameters = new LinkedList();
//		ParameterManager manager = ParameterManager.getInstance();
//		String[] paramNames = (new Query(getUserSql())).getParameterNames();
//		for (String pname : paramNames) {
//			QueryParameter qp = manager.getParameter(pname);
//			if (!parameters.contains(qp)) {
//				parameters.add(qp);
//			}
//		}

        report.setParameters(parameters);                
        return report;
    }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:28,代码来源:QueryBuilderPanel.java

示例5: createDefaultReportTemplate

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
public static ReportTemplate createDefaultReportTemplate() {
    ReportTemplate template = new ReportTemplate();
    template.setVersion(ReleaseInfoAdapter.getVersionNumber());
    BandElement title = new BandElement("Title");
    title.setBackground(Color.WHITE);
    title.setForeground(Color.BLACK);
    Font font = (Font) UIManager.getDefaults().get("Panel.font");
    title.setFont(font);
    title.setPadding(new Padding(0, 0, 0, 0));
    Border border  = new Border();
    border.setLeftColor(Color.BLACK);
    border.setRightColor(Color.BLACK);
    border.setTopColor(Color.BLACK);
    border.setBottomColor(Color.BLACK);
    title.setBorder(border);
    template.setTitleBand(title);

    BandElement header = new BandElement("Header");
    TemplateManager.restoreBandElement(header, title);
    template.setHeaderBand(header);

    BandElement detail = new BandElement("Detail");
    TemplateManager.restoreBandElement(detail, title);
    template.setDetailBand(detail);
    
    BandElement footer = new BandElement("Footer");
    TemplateManager.restoreBandElement(footer, title);
    template.setFooterBand(footer);

    return template;
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:32,代码来源:TemplateManager.java

示例6: createSummaryInformation

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
private void createSummaryInformation(String title) {

		DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

		POIXMLProperties xmlProps = wb.getProperties();
		POIXMLProperties.CoreProperties coreProps = xmlProps.getCoreProperties();

		coreProps.setTitle(title);
		coreProps.setCreator(ReleaseInfoAdapter.getCompany());
		coreProps.setDescription("NextReports " + ReleaseInfoAdapter.getVersionNumber());
		xmlProps.getExtendedProperties().getUnderlyingProperties().setApplication("NextReports " + ReleaseInfoAdapter.getVersionNumber());
		coreProps.setSubjectProperty("Created by NextReports Designer" + ReleaseInfoAdapter.getVersionNumber());
		coreProps.setCreated(df.format(new Date()));
		coreProps.setKeywords(ReleaseInfoAdapter.getHome());
	}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:16,代码来源:XlsxExporter.java

示例7: addMetaData

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
private void addMetaData() {
	document.addTitle(getDocumentTitle());
	document.addAuthor(ReleaseInfoAdapter.getCompany());
	document.addCreator("NextReports " + ReleaseInfoAdapter.getVersionNumber());
	document.addSubject("Created by NextReports Designer" + ReleaseInfoAdapter.getVersionNumber());
	document.addCreationDate();
	document.addKeywords(ReleaseInfoAdapter.getHome());
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:9,代码来源:RtfExporter.java

示例8: getMetaData

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
private String getMetaData() {
    StringBuilder sb = new StringBuilder();
    sb.append("<meta name=\"author\" content=\"").
            append(ReleaseInfoAdapter.getCompany()).append("\">\n");
    sb.append("<meta name=\"creator\" content=\"").
            append("NextReports ").append(ReleaseInfoAdapter.getVersionNumber()).append("\">\n");
    sb.append("<meta name=\"subject\" content=\"").
            append("Created by NextReports Designer ").append(ReleaseInfoAdapter.getVersionNumber()).append("\">\n");
    sb.append("<meta name=\"date\" content=\"").
            append(new Date()).append("\">\n");
    sb.append("<meta name=\"keywords\" content=\"").
            append(ReleaseInfoAdapter.getHome()).append("\">\n");
    return sb.toString();
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:15,代码来源:HtmlExporter.java

示例9: addMetaData

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
private void addMetaData() {
    document.addTitle(getDocumentTitle());
    document.addAuthor(ReleaseInfoAdapter.getCompany());
    document.addCreator("NextReports " + ReleaseInfoAdapter.getVersionNumber());
    document.addSubject("Created by NextReports Designer" + ReleaseInfoAdapter.getVersionNumber());
    document.addCreationDate();
    document.addKeywords(ReleaseInfoAdapter.getHome());
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:9,代码来源:PdfExporter.java

示例10: addMetadata

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
private void addMetadata() {				
	try {
		DocPropsCorePart docPropsCorePart = wordMLPackage.getDocPropsCorePart();
		CoreProperties coreProps = (CoreProperties) docPropsCorePart.getContents();
		
		org.docx4j.docProps.core.ObjectFactory CorePropsfactory = new org.docx4j.docProps.core.ObjectFactory();
		org.docx4j.docProps.core.dc.elements.ObjectFactory dcElfactory = new org.docx4j.docProps.core.dc.elements.ObjectFactory();
		
		SimpleLiteral desc = dcElfactory.createSimpleLiteral();
		desc.getContent().add("Created by NextReports Designer" + ReleaseInfoAdapter.getVersionNumber());
		coreProps.setDescription(dcElfactory.createDescription(desc));
		
		SimpleLiteral title = dcElfactory.createSimpleLiteral();
		title.getContent().add(getDocumentTitle());
		coreProps.setTitle(dcElfactory.createTitle(title));
		
		SimpleLiteral author = dcElfactory.createSimpleLiteral();
		author.getContent().add(ReleaseInfoAdapter.getCompany());
		coreProps.setCreator(author);
		
		SimpleLiteral subject = dcElfactory.createSimpleLiteral();
		subject.getContent().add("Created by NextReports Designer" + ReleaseInfoAdapter.getVersionNumber());
		coreProps.setSubject(subject);
				
		coreProps.setKeywords(ReleaseInfoAdapter.getHome());
	} catch (Docx4JException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:32,代码来源:DocxExporter.java

示例11: createSummaryInformation

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
public static void createSummaryInformation(String filePath, String title) {

        if (filePath == null) {
            return;
        }
        try {
            File poiFilesystem = new File(filePath);
            InputStream is = new FileInputStream(poiFilesystem);
            POIFSFileSystem poifs = new POIFSFileSystem(is);
            is.close();
            DirectoryEntry dir = poifs.getRoot();

            SummaryInformation si = PropertySetFactory.newSummaryInformation();
            si.setTitle(title);
            si.setAuthor(ReleaseInfoAdapter.getCompany());
            si.setApplicationName("NextReports " + ReleaseInfoAdapter.getVersionNumber());
            si.setSubject("Created by NextReports Designer" + ReleaseInfoAdapter.getVersionNumber());
            si.setCreateDateTime(new Date());
            si.setKeywords(ReleaseInfoAdapter.getHome());

            si.write(dir, SummaryInformation.DEFAULT_STREAM_NAME);

            OutputStream out = new FileOutputStream(poiFilesystem);
            poifs.writeFilesystem(out);
            out.close();
        }
        catch (Exception ex) {
            ex.printStackTrace();
        }
    }
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:31,代码来源:XlsExporter.java

示例12: changeVersion

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
public String changeVersion(String xml) throws ConverterException {
	// use xstream to load and save report to make xml without spaces and
	// with correct indents also set the new version
	Report report = ReportUtil.loadConvertedReport(xml);
	if (report == null) {
		throw new ConverterException("Converter " + getConverterVersion() + " : Report could not be read after conversion");
	}
	report.setVersion(ReleaseInfoAdapter.getVersionNumber());
	return ReportUtil.reportToXml(report);
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:11,代码来源:AbstractNextConverter.java

示例13: isNewerUnsupportedVersion

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
/**
 * Return true if version string is newer than version of the report engine
 * 
 * @param version
 *            version string
 * @return true if version string is newer than version of the report engine
 */
public static boolean isNewerUnsupportedVersion(String version) {
	if ((version == null) || "".equals(version)) {
		return true;
	}
	String engineVersion = ReleaseInfoAdapter.getVersionNumber();
	String[] ev = engineVersion.split("\\.");
	String[] rv = version.split("\\.");
	return ((Integer.parseInt(ev[0]) < Integer.parseInt(rv[0])) || ((Integer.parseInt(ev[0]) == Integer.parseInt(rv[0])) && (Integer
			.parseInt(ev[1]) < Integer.parseInt(rv[1]))));
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:18,代码来源:ReportUtil.java

示例14: downloadChart

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
public static void downloadChart(String chartPath, WebServiceClient client, UIActivator activator)
		throws Exception {
	ChartMetaData chartMetaData = client.getChart(chartPath);
	XStream xstream = XStreamFactory.createXStream();
	Chart chart = (Chart) xstream.fromXML(new String(chartMetaData.getMainFile().getFileContent(), "UTF-8"));

	byte status = NextChartUtil.isValidChartVersion(chart);
	if (NextChartUtil.CHART_INVALID_NEWER == status) {
		Show.error(I18NSupport.getString("chart.version.invalid.newer", ReleaseInfoAdapter.getVersionNumber()));
		return;
	}

	// save the chart
	String existingPath = Globals.getCurrentChartAbsolutePath();

	String chartAbsolutePath = chartMetaData.getPath();
	chartAbsolutePath = chartAbsolutePath.replaceFirst("/charts", "");
	String chartName = null;
	try {
		chartName = chartAbsolutePath.substring(chartAbsolutePath.lastIndexOf("/") + 1);
		chartAbsolutePath = chartAbsolutePath.substring(0, chartAbsolutePath.lastIndexOf("/"));
	} catch (Exception e) {
		chartName = chartAbsolutePath.substring(chartAbsolutePath.lastIndexOf("\\"));
		chartAbsolutePath = chartAbsolutePath.substring(0, chartAbsolutePath.lastIndexOf("/"));
	}

	File chartsGlobalFolderPathFile = new File(FileReportPersistence.getChartsRelativePath());
	if (!chartsGlobalFolderPathFile.exists()) {
		chartsGlobalFolderPathFile.mkdirs();
	}

	chartAbsolutePath = FileReportPersistence.getChartsRelativePath() + File.separator + chartAbsolutePath;
	File chartFolderPath = new File(chartAbsolutePath);

	String name = null;
	// if the path exists ask for a new name for the
	// report
	if (!chartFolderPath.exists()) {
		chartFolderPath.mkdirs();
	}

	File chartFullPathFile = new File(chartFolderPath.getAbsolutePath() + File.separator + chartName
			+ (chartName.endsWith(ChartUtil.CHART_EXTENSION) ? ""
					: ChartUtil.CHART_EXTENSION_SEPARATOR + ChartUtil.CHART_EXTENSION));
	// report name usually contains .report in it, charts it does not

	if (!chartFullPathFile.exists()) {
		Globals.setCurrentChartAbsolutePath(chartFolderPath.getAbsolutePath() + File.separator + chartName
				+ ChartUtil.CHART_EXTENSION_SEPARATOR + ChartUtil.CHART_EXTENSION);
		chart.setName(chartName + ChartUtil.CHART_EXTENSION_SEPARATOR + ChartUtil.CHART_EXTENSION);
		name = ChartUtil.saveChart(I18NSupport.getString("save.chart"), false, chart);
	} else {
		chart.setName(chartName);
		name = ChartUtil.saveChart(I18NSupport.getString("save.chart"), true, chart);
	}

	if (name != null) {
		String path = Globals.getCurrentChartAbsolutePath();
		Globals.getMainFrame().getQueryBuilderPanel().addChart(name, path);
		Globals.getReportUndoManager().discardAllEdits();
	}
	Globals.setCurrentChartAbsolutePath(existingPath);

	if (activator != null) {
		activator.updateProgress();
	}
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:68,代码来源:DownloadHelper.java

示例15: actionPerformed

import ro.nextreports.engine.ReleaseInfoAdapter; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {

        if (!LicenseUtil.allowToAddAnotherReport()) {
            return;
        }

        DataSourceManager manager = DefaultDataSourceManager.getInstance();
        DataSource ds = manager.getConnectedDataSource();
        if(ds == null) {
            Show.info(I18NSupport.getString("no.data.source.connected"));
            return;
        }
        String name = FileReportPersistence.getChartsRelativePath();
        File destFolder;
        if (destinationPath == null) {
            destFolder = new File(name);
        } else {
            destFolder = new File(destinationPath);
        }

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(I18NSupport.getString("import.chart.title", ds.getName()));
        fc.setAcceptAllFileFilterUsed(false);
        fc.addChoosableFileFilter(new ChartFilter());
        String importPath = ReporterPreferencesManager.getInstance().loadParameter(ReporterPreferencesManager.NEXT_REPORT_IMPORT_PATH);
        if (importPath == null) {
            importPath = FileReportPersistence.CONNECTIONS_DIR;
        }
        fc.setCurrentDirectory(new File(importPath));
        int returnVal = fc.showSaveDialog(Globals.getMainFrame());
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File f = fc.getSelectedFile();
            if (f != null) {
                try {
                    byte status = NextChartUtil.isValidChartVersion(f.getAbsolutePath());
                    if (NextChartUtil.CHART_INVALID_NEWER == status) {
                        Show.error(I18NSupport.getString("chart.version.invalid.newer", ReleaseInfoAdapter.getVersionNumber()));
                        return;
                    }
                    File destFile = new File(destFolder.getAbsolutePath() + File.separator + f.getName());
                    boolean copy= false;
                    if (destFile.exists()) {
                        int option = JOptionPane.showConfirmDialog(Globals.getMainFrame(), I18NSupport.getString("import.chart.exists", f.getName()), "", JOptionPane.YES_NO_OPTION);
                        if (option == JOptionPane.YES_OPTION) {
                            copy = true;
                        }
                    } else {
                        copy = true;
                    }
                    if (copy) {
                        FileUtil.copyToDir(f, destFolder, true);
                        TreeUtil.refreshCharts();
                        ReporterPreferencesManager.getInstance().storeParameter(
                            ReporterPreferencesManager.NEXT_REPORT_IMPORT_PATH ,f.getParentFile().getAbsolutePath());
                        Show.info(I18NSupport.getString("import.chart.success"));
                    }
                } catch (Exception ex) {
                    Show.error(ex);
                }
            }
        }

    }
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:64,代码来源:ImportChartAction.java


注:本文中的ro.nextreports.engine.ReleaseInfoAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。