1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.utgenome.gwt.utgb.client.track;
26
27 public class TrackFrameState {
28 private boolean isPacked = true;
29 private boolean isMinimized = false;
30 private int minFrameHeight = DEFAULT_MIN_TRACKFRAME_HEIGHT;
31 private int previousFrameHeight = DEFAULT_MIN_TRACKFRAME_HEIGHT;
32 private int currentHeight;
33
34 public static final int DEFAULT_MIN_TRACKFRAME_HEIGHT = 18;
35
36 public boolean isPacked() {
37 return isPacked;
38 }
39
40 public void setPacked(boolean isPacked) {
41 this.isPacked = isPacked;
42 }
43
44 public boolean isMinimized() {
45 return isMinimized;
46 }
47
48 public void setMinimized(boolean isMinimized) {
49 this.isMinimized = isMinimized;
50 }
51
52 public int getMinFrameHeight() {
53 return minFrameHeight;
54 }
55
56 public void setMinFrameHeight(int minFrameHeight) {
57 this.minFrameHeight = Math.max(minFrameHeight, DEFAULT_MIN_TRACKFRAME_HEIGHT);
58 }
59
60 public int getPreviousFrameHeight() {
61 return previousFrameHeight;
62 }
63
64 public void setPreviousFrameHeight(int previousFrameHeight) {
65 this.previousFrameHeight = Math.max(minFrameHeight, previousFrameHeight);
66 }
67
68
69 public int resizeFrameHeight(int height)
70 {
71 int newHeight = height;
72 if(isMinimized())
73 {
74 if(height < DEFAULT_MIN_TRACKFRAME_HEIGHT)
75 newHeight = DEFAULT_MIN_TRACKFRAME_HEIGHT;
76 }
77 else
78 {
79 if(height < minFrameHeight)
80 newHeight = minFrameHeight;
81 }
82 return newHeight;
83 }
84
85
86 }
87
88
89
90