Mercurial > hg > accesspd
comparison java/src/uk/ac/qmul/eecs/ccmi/gui/LineStyle.java @ 0:78b7fc5391a2
first import, outcome of NIME 2014 hackaton
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Tue, 08 Jul 2014 16:28:59 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:78b7fc5391a2 |
---|---|
1 /* | |
2 CCmI Editor - A Collaborative Cross-Modal Diagram Editing Tool | |
3 | |
4 Copyright (C) 2011 Queen Mary University of London (http://ccmi.eecs.qmul.ac.uk/) | |
5 | |
6 This program is free software: you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
8 the Free Software Foundation, either version 3 of the License, or | |
9 (at your option) any later version. | |
10 | |
11 This program is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 */ | |
19 package uk.ac.qmul.eecs.ccmi.gui; | |
20 | |
21 import java.awt.BasicStroke; | |
22 import java.awt.Stroke; | |
23 | |
24 /** | |
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>. | |
27 * | |
28 */ | |
29 public enum LineStyle { | |
30 Solid(new BasicStroke(),0xFFFF), | |
31 Dotted(new BasicStroke(1.0f, | |
32 BasicStroke.CAP_ROUND, | |
33 BasicStroke.JOIN_ROUND, | |
34 0.0f, | |
35 new float[]{1.0f,3.0f}, | |
36 0.0f),0xAAAA), | |
37 Dashed(new BasicStroke(1.0f, | |
38 BasicStroke.CAP_ROUND, | |
39 BasicStroke.JOIN_ROUND, | |
40 0.0f, | |
41 new float[]{5.0f,5.0f}, | |
42 0.0f),0xF0F0); | |
43 | |
44 private LineStyle(BasicStroke stroke, int stipplePattern){ | |
45 this.stroke = stroke; | |
46 this.stipplePattern = stipplePattern; | |
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 */ | |
55 public Stroke getStroke(){ | |
56 return stroke; | |
57 } | |
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 * | |
64 * @see <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLineStipple.xml">glLineStipple</a> | |
65 * | |
66 * @return an int with the bit representation of the stipple pattern | |
67 */ | |
68 public int getStipplePattern(){ | |
69 return stipplePattern; | |
70 } | |
71 | |
72 private Stroke stroke; | |
73 private int stipplePattern; | |
74 } |