comparison java/src/uk/ac/qmul/eecs/ccmi/gui/LineStyle.java @ 0:9418ab7b7f3f

Initial import
author Fiore Martin <fiore@eecs.qmul.ac.uk>
date Fri, 16 Dec 2011 17:35:51 +0000
parents
children 9e67171477bc
comparison
equal deleted inserted replaced
-1:000000000000 0:9418ab7b7f3f
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()),
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)),
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));
43
44 private LineStyle(BasicStroke stroke){
45 this.stroke = stroke;
46 }
47
48 public Stroke getStroke(){
49 return stroke;
50 }
51
52 private Stroke stroke;
53 }