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


Java ColorUtil类代码示例

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


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

示例1: createTitle

import ro.nextreports.engine.util.ColorUtil; //导入依赖的package包/类
private NextChartTitle createTitle(ChartTitle chartTitle) {
    NextChartTitle nct = new NextChartTitle(StringUtil.getI18nString(chartTitle.getTitle(), I18nUtil.getLanguageByName(chart, language)));
    Font font = chartTitle.getFont();
    
    if (chartTitle.getColor() !=  null) {
    	nct.setColor(ColorUtil.getHexColor(chartTitle.getColor()));
    }
    nct.setFont(createFont(font));
    
    byte align = chartTitle.getAlignment();
    if (align == ChartTitle.LEFT_ALIGNMENT) {
        nct.setAlignment(NextChart.Alignment.left);
    } else if (align == ChartTitle.CENTRAL_ALIGNMENT) {
    	nct.setAlignment(NextChart.Alignment.center);
    } else if (align == ChartTitle.RIGHT_ALIGNMENT) {
    	nct.setAlignment(NextChart.Alignment.right);
    }
    return nct;        
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:20,代码来源:JsonHTML5Exporter.java

示例2: setColors

import ro.nextreports.engine.util.ColorUtil; //导入依赖的package包/类
private void setColors(boolean isCombo) {
  	List<String> colors = new ArrayList<String>();
  	if (ChartType.PIE == chart.getType().getType()) {
  		for (Color color : chart.getForegrounds()) {
  			if (color != null) {
  				colors.add(ColorUtil.getHexColor(color));
  			}
          }    
  	} else {
  		int size = chart.getYColumns().size();
	if (isCombo) {
		if (size > 1) {
			size--;
			List<String> lineColorList = new ArrayList<String>();
			lineColorList.add(ColorUtil.getHexColor(chart.getForegrounds().get(size)));
			nc.setLineColor(lineColorList);
		}
	}
   	for (int i=0; i < size; i++) {
   		colors.add(ColorUtil.getHexColor(chart.getForegrounds().get(i)));	    		
   	}     
  	}
nc.setColor(colors);
  }
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:25,代码来源:JsonHTML5Exporter.java

示例3: getData

import ro.nextreports.engine.util.ColorUtil; //导入依赖的package包/类
public DisplayData getData() {
	DisplayData data = new DisplayData();
	data.setTitle(titleField.getText());
	data.setShouldRise(shouldRise.isSelected());
	data.setShadow(shadow.isSelected());
	data.setTitleColor(ColorUtil.getHexColor(new Color(Integer.parseInt(titleColorField.getText()))));
	data.setValueColor(ColorUtil.getHexColor(new Color(Integer.parseInt(valueColorField.getText()))));
	data.setPreviousColor(ColorUtil.getHexColor(new Color(Integer.parseInt(previousColorField.getText()))));
	data.setBackground(ColorUtil.getHexColor(new Color(Integer.parseInt(backgroundColorField.getText()))));
	return data;
}
 
开发者ID:nextreports,项目名称:nextreports-designer,代码行数:12,代码来源:SelectDisplaySettingsWizardPanel.java

示例4: DisplayData

import ro.nextreports.engine.util.ColorUtil; //导入依赖的package包/类
public DisplayData() {
	super();
	title = "";
	titleAlignment = TITLE_ALIGNMENT_VALUE;
	titleColor = ColorUtil.getHexColor(Color.BLACK);
	value = "0";
	valueColor = ColorUtil.getHexColor(Color.BLACK);
	previous = null;
	previousColor = ColorUtil.getHexColor(Color.GRAY);
	background = ColorUtil.getHexColor(Color.WHITE);
	up = true;
	shadow = false;
	shouldRise = true;
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:15,代码来源:DisplayData.java

示例5: setBackground

import ro.nextreports.engine.util.ColorUtil; //导入依赖的package包/类
private void setBackground(Tc tableCell, Map<String, Object> style) {
	// to see a background image all cells must not have any background!
	if (bean.getReportLayout().getBackgroundImage() == null) {
		if (style.containsKey(StyleFormatConstants.BACKGROUND_COLOR)) {
			Color val = (Color) style.get(StyleFormatConstants.BACKGROUND_COLOR);
			setCellColor(tableCell, ColorUtil.getHexColor(val).substring(1));
		}
	}
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:10,代码来源:DocxExporter.java

示例6: setBackground

import ro.nextreports.engine.util.ColorUtil; //导入依赖的package包/类
private void setBackground() {
    if (chart.getBackground() != null) {
    	nc.setBackground(ColorUtil.getHexColor(chart.getBackground()));
    }
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:6,代码来源:JsonHTML5Exporter.java

示例7: exportCell

import ro.nextreports.engine.util.ColorUtil; //导入依赖的package包/类
protected void exportCell(String bandName, BandElement bandElement, Object value, int gridRow, int row, int column, int cols,
		int rowSpan, int colSpan, boolean isImage) {

	int headerRows = getHeaderRows();
	int detailRows = getDetailRows();
	Map<String, Object> style = buildCellStyleMap(bandElement, value, gridRow, column, colSpan);

	if (ReportLayout.HEADER_BAND_NAME.equals(bandName)) {
		if (headerRows == 1) {
			if (row == 0) {
				switch (column) {
				case 0:
					data.setTitle(replaceParameters(getBandElementValueAsString(bandElement)));
					if (bandElement.getHorizontalAlign() == BandElement.CENTER) {
						data.setTitleAlignment(DisplayData.TITLE_ALIGNMENT_CENTER);
					} else {
						data.setTitleAlignment(DisplayData.TITLE_ALIGNMENT_VALUE);
					}
					data.setBackground(ColorUtil.getHexColor(bandElement.getBackground()));
					if (style.containsKey(StyleFormatConstants.BACKGROUND_COLOR)) {
						data.setBackground(ColorUtil.getHexColor((Color) style.get(StyleFormatConstants.BACKGROUND_COLOR)));
					}
					data.setTitleColor(ColorUtil.getHexColor(bandElement.getForeground()));
					if (style.containsKey(StyleFormatConstants.FONT_COLOR)) {
						data.setTitleColor(ColorUtil.getHexColor((Color) style.get(StyleFormatConstants.FONT_COLOR)));
					}
					break;
				case 1:
					data.setShouldRise(Boolean.parseBoolean(bandElement.getText()));
					break;
				case 2:
					data.setShadow(Boolean.parseBoolean(bandElement.getText()));
					break;
				}
			} 
		}
	} else if (ReportLayout.DETAIL_BAND_NAME.equals(bandName)) {
		if (detailRows == 1) {
			if (column == 0) {					
				data.setValueColor(ColorUtil.getHexColor(bandElement.getForeground()));
				if (style.containsKey(StyleFormatConstants.FONT_COLOR)) {
					data.setValueColor(ColorUtil.getHexColor((Color) style.get(StyleFormatConstants.FONT_COLOR)));
				}
				data.setValue(StringUtil.getValueAsString(value, ((ColumnBandElement)bandElement).getPattern()));
				for (Alert alert : alerts) {                	
					if (isAlert(alert, value)) {
						executeAlert(alert, value, "");
					} 
				}
			} else if (column == 1) {					
				data.setPreviousColor(ColorUtil.getHexColor(bandElement.getForeground()));
				if (style.containsKey(StyleFormatConstants.FONT_COLOR)) {
					data.setPreviousColor(ColorUtil.getHexColor((Color) style.get(StyleFormatConstants.FONT_COLOR)));
				}					
				data.setPrevious(StringUtil.getValueAsString(value, ((ColumnBandElement)bandElement).getPattern()));
			} else if (column == 2) {										
				data.setUp((Boolean)value);
			} else if (column == 3) {	
				String prev = getBandElementValueAsString(bandElement);
				if ((prev != null) && !prev.endsWith("%")) {
					prev = prev + "%";
				}
				data.setPrevious(prev);
			}
		}
		return;
	}

}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:70,代码来源:DisplayExporter.java

示例8: exportCell

import ro.nextreports.engine.util.ColorUtil; //导入依赖的package包/类
protected void exportCell(String bandName, BandElement bandElement, Object value, int gridRow,
                          int row, int column, int cols, int rowSpan, int colSpan, boolean isImage) {

    int rows = getDetailRows();  
    Map<String, Object> style = buildCellStyleMap(bandElement, value, gridRow, column, colSpan); 

    // only first row from detail is important
    if (ReportLayout.DETAIL_BAND_NAME.equals(bandName)) {
        if (rows == 1) {            	
            if (column == 0) {
            	data.setColor(ColorUtil.getHexColor(bandElement.getBackground()));
            	if (style.containsKey(StyleFormatConstants.BACKGROUND_COLOR)) {
                    data.setColor(ColorUtil.getHexColor((Color) style.get(StyleFormatConstants.BACKGROUND_COLOR)));                        
                }
	for (Alert alert : alerts) {
		if (isAlert(alert, value)) {
			alertValues.add(value);
		} else {
			alertValues.add(null);
		}
	}
            } else if (column == 1) {
            	if (value == null) {
            		data.setText("");
            	} else {
            		data.setText(value.toString());
            	}
            	for (int i=0, size=alertValues.size(); i<size; i++) {
            		Object alertValue = alertValues.get(i);
            		if (alertValue != null) {                		
            			executeAlert(alerts.get(i), alertValue, value.toString());
            		}
            	}
            } else if (column == 2) {
            	data.setShadow(Boolean.parseBoolean(bandElement.getText()));
            }
        }
        return;
    }
           
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:42,代码来源:AlarmExporter.java

示例9: AlarmData

import ro.nextreports.engine.util.ColorUtil; //导入依赖的package包/类
public AlarmData() {
	color =  ColorUtil.getHexColor(Color.WHITE);
       text = "";
       shadow = false;
}
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:6,代码来源:AlarmData.java


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