Mercurial > hg > ccmieditor
comparison java/src/uk/ac/qmul/eecs/ccmi/gui/LineStyle.java @ 3:9e67171477bc
PHANTOM Omni Heptic device release
author | Fiore Martin <fiore@eecs.qmul.ac.uk> |
---|---|
date | Wed, 25 Apr 2012 17:09:09 +0100 |
parents | 9418ab7b7f3f |
children | d66dd5880081 |
comparison
equal
deleted
inserted
replaced
2:4b2f975e35fa | 3:9e67171477bc |
---|---|
25 * Defines the possible values for the stroke of lines painted on the graph when drawing an {@link Edge}. | 25 * Defines the possible values for the stroke of lines painted on the graph when drawing an {@link Edge}. |
26 * It can be <i>Solid</i>, <i>Dotted</i> or <i>Dashed</i>. | 26 * It can be <i>Solid</i>, <i>Dotted</i> or <i>Dashed</i>. |
27 * | 27 * |
28 */ | 28 */ |
29 public enum LineStyle { | 29 public enum LineStyle { |
30 Solid(new BasicStroke()), | 30 Solid(new BasicStroke(),0xFFFF), |
31 Dotted(new BasicStroke(1.0f, | 31 Dotted(new BasicStroke(1.0f, |
32 BasicStroke.CAP_ROUND, | 32 BasicStroke.CAP_ROUND, |
33 BasicStroke.JOIN_ROUND, | 33 BasicStroke.JOIN_ROUND, |
34 0.0f, | 34 0.0f, |
35 new float[]{1.0f,3.0f}, | 35 new float[]{1.0f,3.0f}, |
36 0.0f)), | 36 0.0f),0xF0F0), |
37 Dashed(new BasicStroke(1.0f, | 37 Dashed(new BasicStroke(1.0f, |
38 BasicStroke.CAP_ROUND, | 38 BasicStroke.CAP_ROUND, |
39 BasicStroke.JOIN_ROUND, | 39 BasicStroke.JOIN_ROUND, |
40 0.0f, | 40 0.0f, |
41 new float[]{5.0f,5.0f}, | 41 new float[]{5.0f,5.0f}, |
42 0.0f)); | 42 0.0f),0xAAAA); |
43 | 43 |
44 private LineStyle(BasicStroke stroke){ | 44 private LineStyle(BasicStroke stroke, int stipplePattern){ |
45 this.stroke = stroke; | 45 this.stroke = stroke; |
46 this.stipplePattern = stipplePattern; | |
46 } | 47 } |
47 | 48 |
49 /** | |
50 * returns the stroke of this line style. The stroke is used to paint | |
51 * the edge that has this line style on a graphics. | |
52 * | |
53 * @return the stroke for this line style | |
54 */ | |
48 public Stroke getStroke(){ | 55 public Stroke getStroke(){ |
49 return stroke; | 56 return stroke; |
50 } | 57 } |
51 | 58 |
59 /** | |
60 * Returns an a bit representation of the stippling of this edge. | |
61 * This value can be used by openGL like libraries to draw the edge and it's used by | |
62 * the OmniHaptic device native code to paint the edge visually and haptically. | |
63 * See also {@link http://www.opengl.org/sdk/docs/man/xhtml/glLineStipple.xml} | |
64 * | |
65 * | |
66 * @return an int with the bit representation of the stipple pattern | |
67 */ | |
68 public int getStipplePattern(){ | |
69 return stipplePattern; | |
70 } | |
71 | |
52 private Stroke stroke; | 72 private Stroke stroke; |
73 private int stipplePattern; | |
53 } | 74 } |