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


Java CssColor类代码示例

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


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

示例1: drawZoom

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
public void drawZoom() {
	if (mouseDown) {
		CssColor fillcolor = CssColor.make("rgba(" + 0 + ", " + 0 + "," + 0
				+ ", " + 0.0 + ")");
		CssColor drawcolor = CssColor.make("rgba(" + 255 + ", " + 0 + ","
				+ 0 + ", " + 1 + ")");

		context.setFillStyle(fillcolor);
		context.setStrokeStyle(drawcolor);

		if (currentx == -1) {
			context.strokeRect(startx, starty, 2, 2);
		} else {
			int width = currentx - startx;
			int height = currenty - starty;

			context.strokeRect(startx, starty, width, height);

			classLogger.log(Level.INFO, "Zoom rect: x: " + startx + ", y: "
					+ starty + ", width: " + width + ", height: " + height);
		}
	}
}
 
开发者ID:metafora-project,项目名称:ReflectionTool,代码行数:24,代码来源:ReflectionToolHtml.java

示例2: clearZoom

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
public void clearZoom() {
	if (mouseDown) {
		CssColor color = CssColor.make("rgba(" + 255 + ", " + 255 + ","
				+ 255 + ", " + 1 + ")");

		context.setFillStyle(color);
		context.setStrokeStyle(color);

		if (currentx == -1) {
			context.strokeRect(startx, starty, 2, 2);
		} else {
			int width = currentx - startx;
			int height = currenty - starty;

			context.strokeRect(startx, starty, width, height);

			classLogger.log(Level.INFO, "Zoom rect: x: " + startx + ", y: "
					+ starty + ", width: " + width + ", height: " + height);
		}
	}
}
 
开发者ID:metafora-project,项目名称:ReflectionTool,代码行数:22,代码来源:ReflectionToolHtml.java

示例3: Timeline

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
public Timeline(Canvas canvas, ScrollPanel scroll, LayoutPanel viewPanel) {
	logger.setLevel(Level.INFO);

	this.canvas = canvas;
	this.scroll = scroll;
	this.viewPanel = viewPanel;

	landmarks = new Vector<Landmark>();
	landmarkbars = new Vector<LandmarkBar>();

	startTime = new Date();
	currentTime = new Date();

	lenghtOfAMinute = 1000;

	color = CssColor.make("rgba(" + 0 + ", " + 0 + "," + 255 + ", " + 1
			+ ")");

	canvas.setWidth(minWidth + "px");
	canvas.setCoordinateSpaceWidth(minWidth);

	canvas.setHeight(minHeight + "px");
	canvas.setCoordinateSpaceHeight(minHeight);

	timer = new Timer() {
		@Override
		public void run() {
			updateTime();
			drawTimeline();
		}
	};
	timer.scheduleRepeating(5000);

	updateTime();
	drawTimeline();
}
 
开发者ID:metafora-project,项目名称:ReflectionTool,代码行数:37,代码来源:Timeline.java

示例4: createColor

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
private CssColor createColor(long color)
{
    return CssColor.make(
            (int) ((color & 0xFF000000l) >> 24),
            (int) ((color & 0x00FF0000l) >> 16),
            (int) ((color & 0x0000FF00l) >> 8));
}
 
开发者ID:cheminfo,项目名称:openchemlib-js,代码行数:8,代码来源:GraphicsContext.java

示例5: getColor

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
private CssColor getColor(int i)
{
    for (ColorMap cm : MOLECULECOLORS) {
        if (cm.molcol == i) {
            return cm.color;
        }
    }
    return MOLECULECOLORS[0].color;
}
 
开发者ID:cheminfo,项目名称:openchemlib-js,代码行数:10,代码来源:GWTDepictor.java

示例6: computeBgFgColors

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
private void computeBgFgColors() {
  int r = rnd(255);
  int g = rnd(255);
  int b = rnd(255);
  bg = CssColor.make(r, g, b);
  double i = (r << 16 | g << 8 | b);
  fg = CssColor.make((0xffffff / 2) < i ? "#111111" : "#ffffff");
}
 
开发者ID:manolo,项目名称:gwt-captcha,代码行数:9,代码来源:Captcha.java

示例7: setColor

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
public void setColor(String color)
{
	m_fillStyle = CssColor.make(color);
	
	Context2d stageContext = m_stagingCanvas.getContext2d();
	stageContext.setFillStyle(m_fillStyle);
}
 
开发者ID:dougkoellmer,项目名称:swarm,代码行数:8,代码来源:CanvasBacking.java

示例8: cssColor

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
static CssColor cssColor(int color) {
  return CssColor.make(cssColorString(color));
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:4,代码来源:FlashGraphics.java

示例9: renderFlowMap

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
@Override
public void renderFlowMap(final Map<String, StationItem> stationItems) {
    // canvas size in px
    final int width = 1121;
    final int height = 2585;
    
       // get the 2D rendering context
       context2 = flowCanvas.getContext2d();

       // initialize the canvas
       flowCanvas.setWidth(width + "px");
       flowCanvas.setHeight(height + "px");
       flowCanvas.setPixelSize(width, height);
       flowCanvas.setCoordinateSpaceWidth(width);
       flowCanvas.setCoordinateSpaceHeight(height);
              
       for (Map.Entry<String, StationItem> entry: stationItems.entrySet()) {
       	String[] values = entry.getValue().getXY().split(";");

           context2.beginPath();
           
           for (int i = 1; i < values.length; i++) {
               String[] coords = values[i].split(",");
               if (i == 1) {
               	context2.moveTo(Double.valueOf(coords[0]) + 0.5, Double.valueOf(coords[1]) + 0.5);
               } else {
               	context2.lineTo(Double.valueOf(coords[0]) + 0.5, Double.valueOf(coords[1]) + 0.5);
               }
           }
           
           String cssColor = getColorStyle(entry.getValue().getSpeed());
           
           context2.closePath();
           context2.setFillStyle(CssColor.make(cssColor));
           context2.fill();
           context2.setStrokeStyle(CssColor.make(cssColor));
           context2.setLineWidth(1);
           context2.setLineCap(LineCap.SQUARE);
           context2.setLineJoin(LineJoin.BEVEL);
           context2.stroke();
       }
}
 
开发者ID:waynedyck,项目名称:mgwt-traffic-flow,代码行数:43,代码来源:SeattleViewGwtImpl.java

示例10: renderFlowMap

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
@Override
public void renderFlowMap(final Map<String, StationItem> stationItems) {
    // canvas size in px
    final int width = 1360;
    final int height = 1204;
    
       // get the 2D rendering context
       context2 = flowCanvas.getContext2d();

       // initialize the canvas
       flowCanvas.setWidth(width + "px");
       flowCanvas.setHeight(height + "px");
       flowCanvas.setPixelSize(width, height);
       flowCanvas.setCoordinateSpaceWidth(width);
       flowCanvas.setCoordinateSpaceHeight(height);
              
       for (Map.Entry<String, StationItem> entry: stationItems.entrySet()) {
       	String[] values = entry.getValue().getXY().split(";");

           context2.beginPath();
           
           for (int i = 1; i < values.length; i++) {
               String[] coords = values[i].split(",");
               if (i == 1) {
               	context2.moveTo(Double.valueOf(coords[0]) + 0.5, Double.valueOf(coords[1]) + 0.5);
               } else {
               	context2.lineTo(Double.valueOf(coords[0]) + 0.5, Double.valueOf(coords[1]) + 0.5);
               }
           }
           
           String cssColor = getColorStyle(entry.getValue().getSpeed());
           
           context2.closePath();
           context2.setFillStyle(CssColor.make(cssColor));
           context2.fill();
           context2.setStrokeStyle(CssColor.make(cssColor));
           context2.setLineWidth(1);
           context2.setLineCap(LineCap.SQUARE);
           context2.setLineJoin(LineJoin.BEVEL);
           context2.stroke();
       }
}
 
开发者ID:waynedyck,项目名称:mgwt-traffic-flow,代码行数:43,代码来源:TacomaViewGwtImpl.java

示例11: makeColor

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
public static CssColor makeColor(String c)  {
    if (GwtUtil.isHexColor(c))  {
        c= "#" + c;
    }
    return CssColor.make(c);
}
 
开发者ID:lsst,项目名称:firefly,代码行数:7,代码来源:HtmlGwtCanvas.java

示例12: convert

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
public static CssColor convert(ColorOwn in) {
	if (in == null) {
		return null;
	}
	return CssColor.make("rgba(" + in.getRed() + ", " + in.getGreen() + "," + in.getBlue() + ", " + in.getAlpha() / 255.0 + ")");
}
 
开发者ID:umlet,项目名称:umlet,代码行数:7,代码来源:Converter.java

示例13: ColorMap

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
ColorMap(int m, CssColor c)
{
    molcol = m;
    color = c;
}
 
开发者ID:cheminfo,项目名称:openchemlib-js,代码行数:6,代码来源:GWTDepictor.java

示例14: setColor

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
@Override
protected void setColor(Color theColor)
{
    currentColor = CssColor.make(theColor.getRed(), theColor.getGreen(), theColor.getBlue());
}
 
开发者ID:cheminfo,项目名称:openchemlib-js,代码行数:6,代码来源:GWTDepictor.java

示例15: setFragmentNoColor

import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
@Override
public void setFragmentNoColor(long color) {
    CssColor c = CssColor.make((int)(color >> 24 & 0xFF),(int)(color >> 16 & 0xFF),(int)(color >> 8 & 0xFF));
}
 
开发者ID:cheminfo,项目名称:openchemlib-js,代码行数:5,代码来源:MoleculeDrawDepictor.java


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