本文整理汇总了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();
}
示例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;
}
示例3: setStroke
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setStroke(Stroke stroke) {
this.stroke = stroke;
changes.firePropertyChange(Constants.changeSketchStroke, null, stroke);
}
示例4: setStrokeRemote
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setStrokeRemote(Stroke stroke) {
this.stroke = stroke;
}
示例5: getStroke
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public Stroke getStroke() {
return stroke;
}
示例6: getHighlightedStrokes
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public ArrayList<Stroke> getHighlightedStrokes()
{
return highlightStrokes;
}
示例7: setHighlightStrokes
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setHighlightStrokes(ArrayList<Stroke> strokes)
{
highlightStrokes = new ArrayList<Stroke>(strokes);
repaint();
}
示例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
}
}
}
示例9: getCurrentStroke
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public Stroke getCurrentStroke() {
return canvas.getCurrentStroke();
}
示例10: setCurrentStroke
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setCurrentStroke(Stroke currentStroke) {
canvas.setCurrentStroke(currentStroke);
}
示例11: setCurrentStroke
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setCurrentStroke(Stroke currentStroke) {
this.currentStroke = currentStroke;
repaint();
}
示例12: getCurrentStroke
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public Stroke getCurrentStroke() {
return currentStroke;
}
示例13: getCurrentStroke
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public Stroke getCurrentStroke() {
return drawPanel.getCurrentStroke();
}
示例14: setCurrentStroke
import edu.tamu.core.sketch.Stroke; //导入依赖的package包/类
public void setCurrentStroke(Stroke currentStroke) {
drawPanel.setCurrentStroke(currentStroke);
}