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


Java Stroke类代码示例

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


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

示例1: RecognizeController

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public RecognizeController(Pane pDrawPane, AbstractDiagramController pController) {
    aDrawPane = pDrawPane;
    diagramController = pController;
    graph = diagramController.getGraphModel();

    //TODO Find a nicer solution for this:
    //This is to load the recognizer when starting app, not when starting to draw.

    recognizer = new PaleoSketchRecognizer(PaleoConfig.allOn());
    Stroke init = new Stroke();
    init.addPoint(new Point(0,1));
    recognizer.setStroke(init);
    recognizer.recognize().getBestShape();
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:15,代码来源:RecognizeController.java

示例2: Sketch

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public Sketch(){
    //TODO, should this make a copy of the path?
    path = new Path();
    stroke = new Stroke();
    path.toFront();
    path.setStrokeWidth(2);
    path.setStroke(Color.BLACK);
    id = ++objectCount;
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:10,代码来源:Sketch.java

示例3: setStroke

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setStroke(Stroke stroke) {
    this.stroke = stroke;
    changes.firePropertyChange(Constants.changeSketchStroke, null, stroke);
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:5,代码来源:Sketch.java

示例4: setStrokeRemote

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setStrokeRemote(Stroke stroke) {
    this.stroke = stroke;
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:4,代码来源:Sketch.java

示例5: getStroke

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public Stroke getStroke() {
    return stroke;
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:4,代码来源:Sketch.java

示例6: getHighlightedStrokes

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public ArrayList<Stroke> getHighlightedStrokes()
{
	return highlightStrokes;
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:5,代码来源:BackgroundImagePanel.java

示例7: setHighlightStrokes

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setHighlightStrokes(ArrayList<Stroke> strokes)
{
	highlightStrokes = new ArrayList<Stroke>(strokes);
	repaint();
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:6,代码来源:BackgroundImagePanel.java

示例8: paintComponent

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void paintComponent(Graphics g)
{
	Graphics2D g2 = (Graphics2D) g;
	
	RenderingHints renderHints = new RenderingHints(
			RenderingHints.KEY_ANTIALIASING,
			RenderingHints.VALUE_ANTIALIAS_ON);
	renderHints.put(RenderingHints.KEY_RENDERING,
			RenderingHints.VALUE_RENDER_QUALITY);
	renderHints.put(RenderingHints.KEY_ALPHA_INTERPOLATION,
					RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
	
	g2.setRenderingHints(renderHints);
	
	// paper color background
	g2.setBackground(new Color(251, 255, 235));
	g2.clearRect(0, 0, getWidth(), getHeight());
	
	// draw the grid for graph paper
	g2.setColor(new Color(197, 214, 162));
	for (int i = 0; i < getWidth(); i += 20)
	{
		g2.drawLine(i, 0, i, getHeight());
	}
	for (int i = 0; i < getHeight(); i += 20)
	{
		g2.drawLine(0, i, getWidth(), i);
	}
	
	// draw a background image if loaded
	if (bg != null)
	{
		g2.drawImage(bg, 
					 0, 0,
					 bg.getWidth(), 
					 bg.getHeight(),
				     0, 0,
				     bg.getWidth(),
				     bg.getHeight(),
				     null);
	}
	
	// draw highlighted strokes
	if (highlightStrokes.size() > 0)
	{
		if (drawBlur && highlightImage != null)
		{
			g2.drawImage(highlightImage, 
						 (int)highlightBox.x, 
						 (int)highlightBox.y, 
						 (int)highlightBox.x + (int)highlightBox.width, 
						 (int)highlightBox.y + (int)highlightBox.height,
						 0, 0, 
						 highlightImage.getWidth(), 
						 highlightImage.getHeight(), 
						 null);
		}
		else
		{
			g2.setColor(HIGHLIGHT_COLOR);
			g2.setStroke(highlightStroke);
			for (Stroke stroke : highlightStrokes)
			{
				QuadPath.drawPath(stroke, g2);
			}
		}
	}
	
	if(areasWrong.size() > 0) {
		g2.setColor(INCORRECT_COLOR);
		for (BoundingBox area : areasWrong) {
			g2.fillRect((int)area.x, (int)area.y, (int)area.width, (int)area.height);
			// draw some kind of ghostly, fuzzy outline or shape behind 
			//   the normal strokes where there is something missing/wrong	
		}
	}
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:78,代码来源:BackgroundImagePanel.java

示例9: getCurrentStroke

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public Stroke getCurrentStroke() {
	return canvas.getCurrentStroke();
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:4,代码来源:DrawingGUI.java

示例10: setCurrentStroke

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setCurrentStroke(Stroke currentStroke) {
	canvas.setCurrentStroke(currentStroke);
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:4,代码来源:DrawingGUI.java

示例11: setCurrentStroke

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setCurrentStroke(Stroke currentStroke) {
	 this.currentStroke = currentStroke;
	 repaint();
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:5,代码来源:JDrawPanel.java

示例12: getCurrentStroke

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public Stroke getCurrentStroke() {
	return currentStroke;
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:4,代码来源:JDrawPanel.java

示例13: getCurrentStroke

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public Stroke getCurrentStroke() {
	return drawPanel.getCurrentStroke();
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:4,代码来源:JSketchCanvas.java

示例14: setCurrentStroke

import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setCurrentStroke(Stroke currentStroke) {
	drawPanel.setCurrentStroke(currentStroke);
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:4,代码来源:JSketchCanvas.java


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