本文整理汇总了Java中net.sf.jasperreports.charts.type.TimePeriodEnum类的典型用法代码示例。如果您正苦于以下问题:Java TimePeriodEnum类的具体用法?Java TimePeriodEnum怎么用?Java TimePeriodEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TimePeriodEnum类属于net.sf.jasperreports.charts.type包,在下文中一共展示了TimePeriodEnum类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeTimeSeriesDataset
import net.sf.jasperreports.charts.type.TimePeriodEnum; //导入依赖的package包/类
private void writeTimeSeriesDataset(JRTimeSeriesDataset dataset) throws IOException
{
writer.startElement(JRXmlConstants.ELEMENT_timeSeriesDataset);
writer.addAttribute(JRXmlConstants.ATTRIBUTE_timePeriod, TimePeriodEnum.getByValue(dataset.getTimePeriod()), TimePeriodEnum.DAY);
writeElementDataset( dataset );
JRTimeSeries[] timeSeries = dataset.getSeries();
if( timeSeries != null && timeSeries.length > 0 )
{
for( int i = 0; i < timeSeries.length; i++ )
{
writeTimeSeries( timeSeries[i] );
}
}
writer.closeElement();
}
示例2: createPropertyDescriptors
import net.sf.jasperreports.charts.type.TimePeriodEnum; //导入依赖的package包/类
/**
* Creates the property descriptors.
*
* @param desc
* the desc
*/
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc,
Map<String, Object> defaultsMap) {
super.createPropertyDescriptors(desc, defaultsMap);
JSSEnumPropertyDescriptor timePeriodD = new JSSEnumPropertyDescriptor(
JRDesignTimeSeriesDataset.PROPERTY_TIME_PERIOD,
Messages.MChartTimeSeriesDataset_time_period,
TimePeriodEnum.class, NullEnum.NULL);
timePeriodD
.setDescription(Messages.MChartTimeSeriesDataset_time_period_description);
desc.add(timePeriodD);
timePeriodD
.setCategory(Messages.MChartTimeSeriesDataset_chart_time_period_dataset_category);
defaultsMap.put(JRDesignTimeSeriesDataset.PROPERTY_TIME_PERIOD,
TimePeriodEnum.DAY.getTimePeriod());
setHelpPrefix(desc,
"net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#timeSeriesDataset");
}
示例3: getPropertyValue
import net.sf.jasperreports.charts.type.TimePeriodEnum; //导入依赖的package包/类
@Override
public Object getPropertyValue(Object id) {
JRDesignTimeSeriesDataset jrElement = (JRDesignTimeSeriesDataset) getValue();
if (jrElement != null)
if (id.equals(JRDesignTimeSeriesDataset.PROPERTY_TIME_PERIOD)) {
if (jrElement.getTimePeriod() == null)
return 0;
TimePeriodEnum tpe = TimePeriodEnum.getByValue(jrElement
.getTimePeriod());
TimePeriodEnum[] tpevalues = TimePeriodEnum.values();
for (int i = 0; i < tpevalues.length; i++) {
if (tpe.equals(tpevalues[i]))
return i + 1;
}
// Class<?> timePeriod = jrElement.getTimePeriod();
// if (timePeriod != null)
// return timePeriod.toString();
// return null;
}
return super.getPropertyValue(id);
}
示例4: setData
import net.sf.jasperreports.charts.type.TimePeriodEnum; //导入依赖的package包/类
@Override
public void setData(JSSDrawVisitor drawVisitor, JRDesignElement jrChart,
JRDesignElementDataset eDataset,
JasperReportsConfiguration jrContext) {
Assert.isTrue(eDataset instanceof JRDesignTimeSeriesDataset);
super.setData(drawVisitor, jrChart, eDataset, jrContext);
dataset = (JRDesignTimeSeriesDataset) eDataset;
setSeries(0);
TimePeriodEnum tpe = TimePeriodEnum.getByValue(dataset.getTimePeriod());
if (tpe == null) {
timePeriodCombo.select(5);
} else {
TimePeriodEnum[] tpevalues = TimePeriodEnum.values();
for (int i = 0; i < tpevalues.length; i++) {
if (tpe.equals(tpevalues[i])) {
timePeriodCombo.select(i + 1);
break;
}
}
}
}
示例5: TimeSeriesDatasetPanel
import net.sf.jasperreports.charts.type.TimePeriodEnum; //导入依赖的package包/类
/** Creates new form PieDatasetPanel */
public TimeSeriesDatasetPanel() {
initComponents();
//applyI18n();
// Year | Quarter | Month | Week | Day | Hour | Minute | Second | Milisecond
// Year | Quarter | Month | Week | Day | Hour | Minute | Second | Milisecond
this.jComboBoxPeriod.addItem(new Tag(TimePeriodEnum.YEAR.getTimePeriod() ,I18n.getString("Global.ComboBox.Year")));
this.jComboBoxPeriod.addItem(new Tag(TimePeriodEnum.QUARTER.getTimePeriod(),I18n.getString("Global.ComboBox.Quarter")));
this.jComboBoxPeriod.addItem(new Tag(TimePeriodEnum.MONTH.getTimePeriod(),I18n.getString("Global.ComboBox.Month")));
this.jComboBoxPeriod.addItem(new Tag(TimePeriodEnum.WEEK.getTimePeriod(),I18n.getString("Global.ComboBox.Week")));
this.jComboBoxPeriod.addItem(new Tag(TimePeriodEnum.DAY.getTimePeriod(),I18n.getString("Global.ComboBox.Day")));
this.jComboBoxPeriod.addItem(new Tag(TimePeriodEnum.HOUR.getTimePeriod(),I18n.getString("Global.ComboBox.Hour")));
this.jComboBoxPeriod.addItem(new Tag(TimePeriodEnum.MINUTE.getTimePeriod(),I18n.getString("Global.ComboBox.Minute")));
this.jComboBoxPeriod.addItem(new Tag(TimePeriodEnum.SECOND.getTimePeriod(),I18n.getString("Global.ComboBox.Second")));
this.jComboBoxPeriod.addItem(new Tag(TimePeriodEnum.MILLISECOND.getTimePeriod(),I18n.getString("Global.ComboBox.Milisecond")));
jList1.setModel( new javax.swing.DefaultListModel());
jList1.setCellRenderer(new DatasetListsCellRenderer());
}
示例6: setTimeSeriesDataset
import net.sf.jasperreports.charts.type.TimePeriodEnum; //导入依赖的package包/类
public void setTimeSeriesDataset(JRDesignTimeSeriesDataset timeSeriesDataset) {
init = true;
this.timeSeriesDataset = timeSeriesDataset;
jButtonModify.setEnabled( false );
jButtonModify.setEnabled( false );
javax.swing.DefaultListModel lm = (javax.swing.DefaultListModel)jList1.getModel();
lm.removeAllElements();
List series = timeSeriesDataset.getSeriesList();
for (int i=0; i< series.size(); ++i)
{
lm.addElement(series.get(i) );
}
if (timeSeriesDataset.getTimePeriod() == null)
{
timeSeriesDataset.setTimePeriod(TimePeriodEnum.DAY.getTimePeriod()); //JRXmlConstants.getTimePeriod("Day"));
}
Misc.setComboboxSelectedTagValue(jComboBoxPeriod, timeSeriesDataset.getTimePeriod() );
init = false;
}