📄 uniquestartscreen.java
字号:
/**
* Copyright (C) 2006, Laboratorio di Valutazione delle Prestazioni - Politecnico di Milano
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package jmt.gui.common.startScreen;
import jmt.gui.common.resources.ImageLoader;
import jmt.gui.common.startScreen.sampleAnimation.SampleQNAnimation;
import jmt.gui.exact.ExactWizard;
import jmt.gui.jmodel.mainGui.MainWindow;
import jmt.gui.jsim.JSIMMain;
import jmt.jmarkov.MMQueues;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.border.EtchedBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URL;
import java.util.HashMap;
/**
* Created by IntelliJ IDEA.
* User: Federico Dall'Orso
* Date: 6-dic-2004
* Time: 12.47.03
* This window shows the jmt's start screen. It contains links to the jmt's main programs and
* a short description of their purpose.
*/
public class UniqueStartScreen extends JFrame{
/*Data structure that must contain all of the images shown in this window. Will be initialized by
*loadImages() method*/
HashMap imageIcons = new HashMap();
/*symbolic names for the images represented as string constants initialized with relative path
*of the images themselves*/
private static final int FONT_SIZE = 5;
private static final String IMG_LOGOPOLI = "logo",
IMG_JMODELICON = "JMODELIcon",
IMG_JMVAICON = "JMVAIcon",
IMG_JSIMICON = "JSIMIcon",
IMG_JABAICON = "JABAIcon",
IMG_JMCHICON = "JMCHIcon",
IMG_JWATICON = "JWATIcon",
IMG_SUITEICON = "JMTIcon",
//names for main messages to be displayed in this window.
MSG_JMVA_DESCR_ITA = "Risolutore tramite algoritmo MVA e definizione alfanumerica del modello",
MSG_JMVA_DESCR_ENG = "MVA algorithm solver with alphanumeric description of the model",
MSG_JSIM_DESCR_ITA = "Simulatore con definizione alfanumerica del modello",
MSG_JSIM_DESCR_ENG = "Simulator with alphanumeric model definition",
MSG_JMCH_DESCR_ITA = "Simulatore di catene di Markov",
MSG_JMCH_DESCR_ENG = "Markov chain simulator",
MSG_JWAT_DESCR_ITA = "Analisi statistica di file di log (tecniche di clustering)",
MSG_JWAT_DESCR_ENG = "Workload Analyzer Tool (Clustering Techniques)",
MSG_JABA_DESCR_ITA = "Risolutore tramite metodi di analisi asintotica",
MSG_JABA_DESCR_ENG = "Asyntotic bound analysis methods solver",
MSG_JMODEL_DESCR_ITA = "Simulatore e risolutore MVA tramite definizione grafica del modello",
MSG_JMODEL_DESCR_ENG = "Simulator and MVA solver with graphical definition of the model",
//names for URLS of documents to be shown as description of main applications
URL_JMT_INTRO_ITA = "IntroIta.html",
URL_JMT_INTRO_ENG = "IntroEng.html",
//content for logo panel
FONT_TYPE = "Arial",
HTML_CONTENT_TITLE = "<html><body align=\"center\"><b>" +
"<font face=\""+FONT_TYPE+"\" size=\""+FONT_SIZE+"\">JMT - Java Modelling Tools v.0.3</font><br>" +
"<font face=\""+FONT_TYPE+"\" size=\""+(FONT_SIZE-1)+"\">Laboratorio di Valutazione delle prestazioni</font><br>" +
"<font face=\""+FONT_TYPE+"\" size=\""+(FONT_SIZE-2)+"\">Performance Evaluation Laboratory</font><br>" +
"<font face=\""+FONT_TYPE+"\" size=\""+(FONT_SIZE-1)+"\">Dipartimento di Elettronica e Informazione<br>" +
"Politecnico di Milano - Italy</font><b>" +
"</font></body></html>";
private AbstractAction startJMVA = new AbstractAction("Starts JMVA") {
{
putValue(Action.SHORT_DESCRIPTION, "Starts Alphanumeric MVA solver");
putValue(Action.SMALL_ICON, resizeButtonIcon(ImageLoader.loadImage(IMG_JMVAICON)));
}
public void actionPerformed(ActionEvent e) {
new ExactWizard();
}
};
private AbstractAction startJMCH = new AbstractAction("Starts JMCH") {
{
putValue(Action.SHORT_DESCRIPTION, "Starts graphic markov chain solver");
putValue(Action.SMALL_ICON, resizeButtonIcon(ImageLoader.loadImage(IMG_JMCHICON)));
}
public void actionPerformed(ActionEvent e) {
MMQueues.main(null);
}
};
private AbstractAction startJWAT = new AbstractAction("Starts JWAT") {
{
putValue(Action.SHORT_DESCRIPTION, "Starts Workload Analyaer Tool");
putValue(Action.SMALL_ICON, resizeButtonIcon(ImageLoader.loadImage(IMG_JWATICON)));
setEnabled(false);
}
public void actionPerformed(ActionEvent e) {
//TODO: to be activated once this tool is ready
}
};
private AbstractAction startJSIM = new AbstractAction("Starts JSIM") {
{
putValue(Action.SHORT_DESCRIPTION, "Starts alphanumeric simulator");
putValue(Action.SMALL_ICON, resizeButtonIcon(ImageLoader.loadImage(IMG_JSIMICON)));
}
public void actionPerformed(ActionEvent e) {
JSIMMain.main(null);
}
};
private AbstractAction startJMODEL = new AbstractAction("Starts JMODEL") {
{
putValue(Action.SHORT_DESCRIPTION, "Starts graphic simulation and MVA solver");
putValue(Action.SMALL_ICON, resizeButtonIcon(ImageLoader.loadImage(IMG_JMODELICON)));
}
public void actionPerformed(ActionEvent e) {
MainWindow.main(null);
UniqueStartScreen.this.dispose();
}
};
private AbstractAction startJABA = new AbstractAction("Starts JABA") {
{
putValue(Action.SHORT_DESCRIPTION, "Starts asyntotic bound analysis solver");
putValue(Action.SMALL_ICON, resizeButtonIcon(ImageLoader.loadImage(IMG_JABAICON)));
//TODO:mettere il collegamento quando
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -