package jminhep.gui;
import java.awt.*;
import java.io.*;
import java.util.*;
import javax.swing.JLabel;
import jminhep.cluster.*;
/**
*
* Class to keep some global variables
* @author S.Chekanov
*
*/
public class SetEnv {
// size of the window
public static int SizeX;
public static int SizeY;
public static int SizeB;
public static JLabel statusbar;
public static Locale locale;
public static String LANGU;
public static String OSsys;
public static Plotter PLOT;
// file with the settings
public static String INIFILE="";
public static Font FontBold;
public static Font FontPlain;
// hold the data
public static DataHolder DATA;
// hold seeds
public static DataHolder SEED;
// centers of clusters
public static DataHolder ClusCenter;
// title of the data
public static String Mtitle;
// dimention of the data
public static int Dim=0;
// number of raw
public static int NRow=0;
// dimention of the data
public static DataPoint Min;
// number of raw
public static DataPoint Max;
// XY title of the data
public static String[] XYtitle;
// cluster mode
public static int Mode;
// XY title of the data
public static int Style;
// selection on JComboBox
public static int JboxX=0;
public static int JboxY=1;
public static void SizeFrame( int X, int Y) {
SizeX=X;
SizeY=Y;
SizeB= (int)(0.2*SizeX); // size of the tool bar
}
public static void init() {
// send default local
LANGU="en";
locale = new Locale(LANGU);
Locale.setDefault(locale);
statusbar = new JLabel("JMinHEP initiated");
// initialise data holder
Mtitle="";
// initialize seeds
SEED = new DataHolder();
// centers of clusters
ClusCenter = new DataHolder();
// main plot
PLOT = new Plotter();
// style
Style=0;
Mode=0;
String OS = System.getProperty("os.name").toLowerCase();
if (OS.indexOf("windows") > -1 || OS.indexOf("nt") > -1) {
OSsys="windows";
INIFILE=System.getProperty("user.home")+File.separator+".jminhep"+File.separator+"jminhep.ini";
} else {
// linux/unix/BS-based/mac
OSsys="linux";
INIFILE=System.getProperty("user.home")+File.separator+".jminhep"+File.separator+"jminhep.ini";
}
FontBold= new Font("Lucida Sans", Font.BOLD, 14);
FontPlain= new Font("Lucida Sans", 0, 14);
}
/**
* Load data from a file
* @param filename file name
*/
public static void Load( String filename ) {
DATA = new DataHolder();
DATA.read( filename.trim() ); // read input
Mtitle=DATA.getRelation();
Dim= DATA.getDimention();
NRow=DATA.getSize();
Min=DATA.getMin();
Max=DATA.getMax();
XYtitle = new String[Dim];
for (int i = 0; i
Ads help maintain this website.