本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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();
}
示例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));
}
示例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;
}
示例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");
}
示例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);
}
示例8: cssColor
import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
static CssColor cssColor(int color) {
return CssColor.make(cssColorString(color));
}
示例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();
}
}
示例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();
}
}
示例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);
}
示例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 + ")");
}
示例13: ColorMap
import com.google.gwt.canvas.dom.client.CssColor; //导入依赖的package包/类
ColorMap(int m, CssColor c)
{
molcol = m;
color = c;
}
示例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());
}
示例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));
}