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


Java ChartType类代码示例

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


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

示例1: getStyle

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
private byte getStyle(String style) {
    if (STYLE_BAR_GLASS.equals(style)) {
        return ChartType.STYLE_BAR_GLASS;
    } else if (STYLE_BAR_CYLINDER.equals(style)) {
        return ChartType.STYLE_BAR_CYLINDER;
    } else if (STYLE_BAR_PARALLELIPIPED.equals(style)) {
        return ChartType.STYLE_BAR_PARALLELIPIPED;
    } else if (STYLE_BAR_DOME.equals(style)) {
        return ChartType.STYLE_BAR_DOME;
    } else if (STYLE_LINE_DOT_SOLID.equals(style)) {
        return ChartType.STYLE_LINE_DOT_SOLID;
    } else if (STYLE_LINE_DOT_HOLLOW.equals(style)) {
        return ChartType.STYLE_LINE_DOT_HOLLOW;
    } else if (STYLE_LINE_DOT_ANCHOR.equals(style)) {
        return ChartType.STYLE_LINE_DOT_ANCHOR;
    } else if (STYLE_LINE_DOT_BOW.equals(style)) {
        return ChartType.STYLE_LINE_DOT_BOW;
    } else if (STYLE_LINE_DOT_STAR.equals(style)) {
        return ChartType.STYLE_LINE_DOT_STAR;
    } else {
        return ChartType.STYLE_NORMAL;
    }
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:24,代码来源:ChartPropertyPanel.java

示例2: setType

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
public void setType(byte type) {
    ImageIcon image = null;
    if (ChartType.PIE == type) {
        image = ImageUtil.getImageIcon("chart_pie_main");
    } else if (ChartType.BAR == type) {
        image = ImageUtil.getImageIcon("chart_bar_main");
    } else if (ChartType.NEGATIVE_BAR == type) {
        image = ImageUtil.getImageIcon("chart_negative_bar_main");    
    } else if (ChartType.BAR_COMBO == type) {
        image = ImageUtil.getImageIcon("chart_bar_combo_main");    
    } else if (ChartType.STACKED_BAR == type) {
        image = ImageUtil.getImageIcon("chart_stacked_bar_main");
    } else if (ChartType.STACKED_BAR_COMBO == type) {
        image = ImageUtil.getImageIcon("chart_stacked_bar_combo_main");    
    } else if (ChartType.HORIZONTAL_BAR == type) {
        image = ImageUtil.getImageIcon("chart_horizontal_bar_main");
    } else if (ChartType.HORIZONTAL_STACKED_BAR == type) {
        image = ImageUtil.getImageIcon("chart_horizontal_stacked_bar_main");
    } else if (ChartType.LINE == type) {
        image = ImageUtil.getImageIcon("chart_line_main");
    } else if (ChartType.AREA == type) {
        image = ImageUtil.getImageIcon("chart_area_main");
    } else if (ChartType.BUBBLE == type) {
        image = ImageUtil.getImageIcon("chart_bubble_main");
    }
    
    
    previewFlashAction.setEnabled(!ChartType.hasNoFlashSupport(type));
    
    if (image != null) {
        mainButton.setIcon(image);
    }        
    reverseAxis(Globals.getChartDesignerPanel().getChart().getType().isHorizontal());
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:35,代码来源:ChartLayoutPanel.java

示例3: getTypeProperty

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
private Property getTypeProperty() {
    DefaultProperty typeProp = new DefaultProperty();
    typeProp.setName(CHART_TYPE);
    typeProp.setDisplayName(TYPE_PARAM_NAME);
    typeProp.setType(String.class);
    ComboBoxPropertyEditor typeEditor = new ComboBoxPropertyEditor();
    typeEditor.setAvailableValues(new String[]{BAR, NEGATIVE_BAR, BAR_COMBO, HORIZONTAL_BAR, STACKED_BAR, STACKED_BAR_COMBO, HORIZONTAL_STACKED_BAR, PIE, LINE, AREA, BUBBLE});
    typeEditor.setAvailableIcons(new Icon[]{
            ImageUtil.getImageIcon("chart_bar"),
            ImageUtil.getImageIcon("chart_negative_bar"),
            ImageUtil.getImageIcon("chart_bar_combo"),
            ImageUtil.getImageIcon("chart_horizontal_bar"),
            ImageUtil.getImageIcon("chart_stacked_bar"),
            ImageUtil.getImageIcon("chart_stacked_bar_combo"),
            ImageUtil.getImageIcon("chart_horizontal_stacked_bar"),
            ImageUtil.getImageIcon("chart_pie"),
            ImageUtil.getImageIcon("chart_line"),
            ImageUtil.getImageIcon("chart_area"),
            ImageUtil.getImageIcon("chart_bubble")}); 
    JComboBox cb = (JComboBox)typeEditor.getCustomEditor();
    cb.setMaximumRowCount(11);
    ChartType chartType = chart.getType();
    byte type = ChartType.NONE;
    if (chartType != null) {
        type = chartType.getType();
    }
    setChartType(type, typeProp);
    typeProp.setCategory(I18NSupport.getString("property.category.main"));

    editorRegistry.registerEditor(typeProp, typeEditor);

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

示例4: getStyleProperty

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
private Property getStyleProperty() {
    DefaultProperty styleProp = new DefaultProperty();
    styleProp.setName(CHART_STYLE);
    styleProp.setDisplayName(STYLE_PARAM_NAME);
    styleProp.setType(String.class);
    ComboBoxPropertyEditor styleEditor = new ComboBoxPropertyEditor();
    String[] availableValues = new String[]{STYLE_NORMAL};
    Object type = getTypeProperty().getValue();
    if (BAR.equals(type) || STACKED_BAR.equals(type) || HORIZONTAL_STACKED_BAR.equals(type)
    		|| BAR_COMBO.equals(type) || STACKED_BAR_COMBO.equals(type)) {
        availableValues = new String[]{STYLE_NORMAL, STYLE_BAR_GLASS, STYLE_BAR_CYLINDER,
                STYLE_BAR_PARALLELIPIPED, STYLE_BAR_DOME};
    } else if (NEGATIVE_BAR.equals(type)) {
    	availableValues = new String[]{STYLE_NORMAL, STYLE_BAR_GLASS};
    } else if (LINE.equals(type)) {
        availableValues = new String[]{STYLE_NORMAL, STYLE_LINE_DOT_SOLID, STYLE_LINE_DOT_HOLLOW,
                STYLE_LINE_DOT_ANCHOR, STYLE_LINE_DOT_BOW, STYLE_LINE_DOT_STAR};
    }
    styleEditor.setAvailableValues(availableValues);

    ChartType chartType = chart.getType();
    setStyle(chartType.getStyle(), styleProp);
    styleProp.setCategory(I18NSupport.getString("property.category.main"));

    editorRegistry.registerEditor(styleProp, styleEditor);

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

示例5: getChartType

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
private ChartType getChartType(String type) {
    if (BAR.equals(type)) {
        return new ChartType(ChartType.BAR);
    } else if (NEGATIVE_BAR.equals(type)) {
        return new ChartType(ChartType.NEGATIVE_BAR);    
    } else if (BAR_COMBO.equals(type)) {
        return new ChartType(ChartType.BAR_COMBO);    
    } else if (HORIZONTAL_BAR.equals(type)) {
        return new ChartType(ChartType.HORIZONTAL_BAR);
    } else if (STACKED_BAR.equals(type)) {
        return new ChartType(ChartType.STACKED_BAR);
    } else if (STACKED_BAR_COMBO.equals(type)) {
        return new ChartType(ChartType.STACKED_BAR_COMBO);    
    } else if (HORIZONTAL_STACKED_BAR.equals(type)) {
        return new ChartType(ChartType.HORIZONTAL_STACKED_BAR);
    } else if (PIE.equals(type)) {
        return new ChartType(ChartType.PIE);
    } else if (LINE.equals(type)) {
        return new ChartType(ChartType.LINE);
    }  else if (AREA.equals(type)) {
        return new ChartType(ChartType.AREA);
    }  else if (BUBBLE.equals(type)) {
        return new ChartType(ChartType.BUBBLE);    
    } else {
        return new ChartType(ChartType.NONE);
    }
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:28,代码来源:ChartPropertyPanel.java

示例6: setStyle

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
private void setStyle(byte style, Property styleProp) {
    String styleS;
    switch (style) {
        case ChartType.STYLE_BAR_GLASS:
            styleS = STYLE_BAR_GLASS;
            break;
        case ChartType.STYLE_BAR_CYLINDER:
            styleS = STYLE_BAR_CYLINDER;
            break;
        case ChartType.STYLE_BAR_PARALLELIPIPED:
            styleS = STYLE_BAR_PARALLELIPIPED;
            break;
        case ChartType.STYLE_BAR_DOME:
            styleS = STYLE_BAR_DOME;
            break;
        case ChartType.STYLE_LINE_DOT_SOLID:
            styleS = STYLE_LINE_DOT_SOLID;
            break;
        case ChartType.STYLE_LINE_DOT_HOLLOW:
            styleS = STYLE_LINE_DOT_HOLLOW;
            break;
        case ChartType.STYLE_LINE_DOT_ANCHOR:
            styleS = STYLE_LINE_DOT_ANCHOR;
            break;
        case ChartType.STYLE_LINE_DOT_BOW:
            styleS = STYLE_LINE_DOT_BOW;
            break;
        case ChartType.STYLE_LINE_DOT_STAR:
            styleS = STYLE_LINE_DOT_STAR;
            break;
        default:
            styleS = STYLE_NORMAL;
            break;
    }
    styleProp.setValue(styleS);
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:37,代码来源:ChartPropertyPanel.java

示例7: setChart

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
public void setChart(Chart chart) {
	if (ChartType.hasNoFlashSupport(chart.getType().getType())) {
		supported = false;
	}
    this.chart = chart;
    if (!loaded) {
        oldParameters = ParameterManager.getInstance().getParameters();
        ParameterManager.getInstance().setParameters(chart.getReport().getParameters());            
    }
    I18nManager.getInstance().setKeys(chart.getI18nkeys());
    I18nManager.getInstance().setLanguages(chart.getLanguages());
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:13,代码来源:PreviewChartAction.java

示例8: getChartType

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
public static byte getChartType(String type) {
    if (CHART_BAR.equals(type)) {
        return ChartType.BAR;
    } else if (CHART_NEGATIVE_BAR.equals(type)) {
        return ChartType.NEGATIVE_BAR;        
    } else if (CHART_BAR_COMBO.equals(type)) {
        return ChartType.BAR_COMBO;    
    }  else if (CHART_HORIZONTAL_BAR.equals(type)) {
        return ChartType.HORIZONTAL_BAR;
    }  else if (CHART_HORIZONTAL_STACKED_BAR.equals(type)) {
        return ChartType.HORIZONTAL_STACKED_BAR;    
    } else if (CHART_STACKED_BAR.equals(type)) {
        return ChartType.STACKED_BAR;
    } else if (CHART_STACKED_BAR_COMBO.equals(type)) {
        return ChartType.STACKED_BAR_COMBO;    
    } else if (CHART_PIE.equals(type)) {
        return ChartType.PIE;
    } else if (CHART_LINE.equals(type)) {
        return ChartType.LINE;
    } else if (CHART_AREA.equals(type)) {
        return ChartType.AREA;
    } else if (CHART_BUBBLE.equals(type)) {
        return ChartType.BUBBLE;    
    } else {
        return ChartType.NONE;
    }
}
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:28,代码来源:ChartUtil.java

示例9: chartUndefined

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
public static boolean chartUndefined(Chart chart) {
	if (chart == null) {
		chart = Globals.getChartDesignerPanel().getChart();
	}
	if (chart.getType() == null) {
		Show.info(I18NSupport.getString("chart.undefined.type"));
		return true;
	}
	if (chart.getXColumn() == null) {
		Show.info(I18NSupport.getString("chart.undefined.xcolumn"));
		return true;
	}
	if ((chart.getYColumns() == null) || (chart.getYColumns().size() == 0)) {
		if (chart.getYColumnQuery() == null) {
			Show.info(I18NSupport.getString("chart.undefined.ycolumn"));
			return true;
		}
	}
	if ((chart.getType().getType() == ChartType.BUBBLE) && (chart.getYColumns().size() != 4)) {
		Show.info(I18NSupport.getString("chart.undefined.ycolumn.bubble"));
		return true;
	}

	if (chart.getYColumns() != null) {
		if ((chart.getType().getType() == ChartType.PIE) && (getNotNullCount(chart.getYColumns()) > 1)) {
			Show.info(I18NSupport.getString("chart.undefined.ycolumn.toomany"));
			return true;
		}

		if ((chart.getYColumns().size() > 1) && (!FunctionFactory.isCountFunction(chart.getYFunction()))) {
			for (String column : chart.getYColumns()) {
				if (Globals.getChartLayoutPanel().getMarked(column)) {
					Show.info(I18NSupport.getString("chart.undefined.ycolumn.type.error", column));
					return true;
				}
			}
		}
	}

	if (!allParametersHaveDefaults(chart)) {
		return true;
	}

	// try {
	// Report report = chart.getReport();
	// String sql;
	// if (report != null) {
	// if (report.getSql() != null) {
	// sql = report.getSql();
	// } else {
	// sql = report.getQuery().toString();
	// }
	// List<NameType> columns =
	// Globals.getChartDesignerPanel().getPropertiesPanel().getColumns();
	// NameType found = null;
	// for (NameType nt : columns) {
	// if (nt.getName().equals(chart.getYColumn())) {
	// found = nt;
	// break;
	// }
	// }
	// //String columnType =
	// ReportLayoutUtil.getColumnTypeForReportColumn(sql,
	// chart.getYColumn());
	// String columnType = found.getType();
	// //System.out.println("*** yColumnType=" + columnType);
	// if (!Number.class.isAssignableFrom(Class.forName(columnType))) {
	// Show.info(I18NSupport.getString("chart.undefined.ycolumn.type"));
	// return true;
	// }
	// }
	// } catch (Exception e) {
	// e.printStackTrace();
	// }

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

示例10: setChartType

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
private void setChartType(byte type, Property typeProp) {
    String typeS;
    switch (type) {
        case ChartType.BAR:
            typeS = BAR;
            break;
        case ChartType.NEGATIVE_BAR:
            typeS = NEGATIVE_BAR;
            break;    
        case ChartType.BAR_COMBO:
            typeS = BAR_COMBO;
            break;    
        case ChartType.HORIZONTAL_BAR:
            typeS = HORIZONTAL_BAR;
            break;
        case ChartType.STACKED_BAR:
            typeS = STACKED_BAR;
            break;
        case ChartType.STACKED_BAR_COMBO:
            typeS = STACKED_BAR_COMBO;
            break;    
        case ChartType.HORIZONTAL_STACKED_BAR:
            typeS = HORIZONTAL_STACKED_BAR;
            break;    
        case ChartType.PIE:
            typeS = PIE;
            break;
        case ChartType.LINE:
            typeS = LINE;
            break;
        case ChartType.AREA:
            typeS = AREA;
            break;
        case ChartType.BUBBLE:
            typeS = BUBBLE;
            break;    
        default:
            typeS = null;
            break;
    }
    typeProp.setValue(typeS);
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:43,代码来源:ChartPropertyPanel.java

示例11: selectionChart

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
private void selectionChart(DBBrowserNode selectedNode, MouseEvent e, boolean pressed) {
	OpenChartAction openAction = new OpenChartAction();
	openAction.setChartName(selectedNode.getDBObject().getName());
	openAction.setChartPath(selectedNode.getDBObject().getAbsolutePath());

	if (e.getClickCount() == 2) {
		if (pressed) {
			openAction.actionPerformed(new ActionEvent(e.getSource(), e.getID(), ""));
		}

	} else {
		JPopupMenu popupMenu = new JPopupMenu();
		JMenuItem menuItem = new JMenuItem(openAction);
		popupMenu.add(menuItem);

		DeleteChartAction deleteAction = new DeleteChartAction(instance, selectedNode);
		JMenuItem menuItem2 = new JMenuItem(deleteAction);
		popupMenu.add(menuItem2);

		RenameChartAction renameAction = new RenameChartAction(instance, selectedNode);
		JMenuItem menuItem3 = new JMenuItem(renameAction);
		popupMenu.add(menuItem3);

		ExportChartAction exportAction = new ExportChartAction(instance, selectedNode);
		JMenuItem menuItem4 = new JMenuItem(exportAction);
		popupMenu.add(menuItem4);

		Chart chart = ChartUtil.loadChart(selectedNode.getDBObject().getAbsolutePath());
		PreviewChartAction previewHTML5Action = new PreviewChartAction(ChartRunner.GRAPHIC_FORMAT,
				ChartRunner.HTML5_TYPE, I18NSupport.getString("preview.html5"));
		previewHTML5Action.setChart(chart);
		popupMenu.add(previewHTML5Action);
		PreviewChartAction previewFlashAction = new PreviewChartAction(ChartRunner.GRAPHIC_FORMAT,
				ChartRunner.FLASH_TYPE, I18NSupport.getString("preview.flash"));
		previewFlashAction.setChart(chart);
		popupMenu.add(previewFlashAction);
		previewFlashAction.setEnabled(!ChartType.hasNoFlashSupport(chart.getType().getType()));
		PreviewChartAction previewImageAction = new PreviewChartAction(ChartRunner.IMAGE_FORMAT,
				ChartRunner.NO_TYPE, I18NSupport.getString("preview.image"));
		previewImageAction.setChart(chart);
		popupMenu.add(previewImageAction);

		PublishChartAction publishAction = new PublishChartAction(selectedNode.getDBObject().getAbsolutePath());
		JMenuItem menuItem5 = new JMenuItem(publishAction);
		popupMenu.add(menuItem5);

		JMenuItem menuItem6 = new JMenuItem(new ValidateSqlsAction(selectedNode.getDBObject()));
		popupMenu.add(menuItem6);

		JMenuItem menuItem7 = new JMenuItem(new AddToFavoritesAction(selectedNode.getDBObject()));
		popupMenu.add(menuItem7);

		popupMenu.show((Component) e.getSource(), e.getX(), e.getY());
	}
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:56,代码来源:DBBrowserTree.java

示例12: createChartXStream

import ro.nextreports.engine.chart.ChartType; //导入依赖的package包/类
private static XStream createChartXStream(XStream xstream) {
    xstream.alias("chart-title", ChartTitle.class);
    xstream.alias("chart-type", ChartType.class);
    
    return xstream;
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:7,代码来源:XStreamFactory.java


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