-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.java
More file actions
134 lines (109 loc) · 2.59 KB
/
Config.java
File metadata and controls
134 lines (109 loc) · 2.59 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.UIManager;
public class Config
{
String skin_dir , softtitle ;
int width,height;
int leftmenuwidth , splitbarwidth ;
boolean iffulltop , ifnormaltop , openfull , lmenucanclose;
private int splitbarHeight;
Config()
{
skin_dir = "icon";
width = 1024 ;
height = 728 ;
iffulltop = true ;
ifnormaltop = false ;
leftmenuwidth = 150 ;
splitbarwidth = 6 ;
splitbarHeight = 6;
openfull = false ;
softtitle = "Visualisation Tool for a Selection Hyper-Heuristic (code.google.com/p/vch)";
lmenucanclose = true;
}
public String getSkinDir()
{
return skin_dir;
}
public ImageIcon getImgUrl(String img)
{
return new ImageIcon(VSHMainFrame.class.getResource(getSkinDir() + "/" + img));
}
public Dimension getFrameSmallSize(boolean full)
{
if(!full)
{
return new Dimension(width,height);
}
else
{
Toolkit kit = Toolkit.getDefaultToolkit();
return new Dimension(kit.getScreenSize());
}
}
public Dimension getScreenSize()
{
Toolkit kit = Toolkit.getDefaultToolkit();
return new Dimension(kit.getScreenSize());
}
public void fullAllWaysTop(VSHMainFrame frame)
{
frame.setAlwaysOnTop(iffulltop);
}
public void normalAllWaysTop(VSHMainFrame frame)
{
frame.setAlwaysOnTop(ifnormaltop);
}
public FlowLayout getFlowLayout(int flag,int hgap,int vgap)
{
FlowLayout fl = new FlowLayout();
fl.setHgap(hgap);
fl.setVgap(vgap);
fl.setAlignment(flag);
return fl;
}
public int getLeftMenuWidth()
{
return this.leftmenuwidth;
}
public int getSplitBarWidth()
{
return this.splitbarwidth;
}
public Color getLeftBgColor()
{
return new Color(50,52,55);
}
public Color getSplitBgColor()
{
return new Color(30,30,30);
}
public Color getMainColor()
{
return new Color(55,55,55);
}
public void setFrameUI()
{
Font font = new Font("Verdana", Font.PLAIN, 12);
UIManager.put("Label.font", font);
UIManager.put("Button.font", font);
Color gray = new Color(240,240,240);
Color black = new Color(0,0,0);
}
public int getSplitBarHeight() {
// TODO Auto-generated method stub
return this.splitbarHeight;
}
public int getUpMenuHeight(int height ) {
// TODO Auto-generated method stub
return (int) ((height-splitbarHeight)*0.65) ;
}
}