]> gerrit.simantics Code Review - simantics/district.git/blob
14e9f47f76dda61591adb6d271cbccab11de7dc9
[simantics/district.git] /
1 package org.simantics.district.network.visualisations.model;
2
3 public class SizeBarOptions {
4
5     private boolean showColorBars;
6     private boolean showColorBarsTicks;
7     private SizeBarsLocation location;
8     private SizeBarsSize size;
9
10     public boolean isShowSizeBars() {
11         return showColorBars;
12     }
13
14     public SizeBarOptions showSizeBars(boolean show) {
15         this.showColorBars = show;
16         return this;
17     }
18
19     public boolean isShowSizeBarsTicks() {
20         return showColorBarsTicks;
21     }
22
23     public SizeBarOptions showSizeBarsTicks(boolean show) {
24         this.showColorBarsTicks = show;
25         return this;
26     }
27
28     public SizeBarsLocation getLocation() {
29         return location;
30     }
31
32     public SizeBarOptions withLocation(SizeBarsLocation location) {
33         this.location = location;
34         return this;
35     }
36
37     public SizeBarsSize getSize() {
38         return size;
39     }
40
41     public SizeBarOptions withSize(SizeBarsSize size) {
42         this.size = size;
43         return this;
44     }
45     public enum SizeBarsLocation {
46         NORTH, EAST, SOUTH, WEST
47     }
48
49     public enum SizeBarsSize {
50         SMALL(1), MEDIUM(2), LARGE(3);
51
52         int size;
53
54         SizeBarsSize(int size) {
55             this.size = size;
56         }
57
58         public double getSize() {
59             return size;
60         }
61     }
62
63     public static SizeBarOptions useDefault() {
64         return new SizeBarOptions().showSizeBars(true).withLocation(SizeBarsLocation.EAST).withSize(SizeBarsSize.SMALL);
65     }
66 }