Skip to content
Snippets Groups Projects
Commit 32d62ca4 authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

about dialog and splitpane cursor reviewed (SCAN-961)

parent 85effd9c
No related branches found
No related tags found
No related merge requests found
package fr.soleil.flyscan.gui; package fr.soleil.flyscan.gui;
import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
...@@ -9,12 +10,14 @@ import java.awt.RenderingHints; ...@@ -9,12 +10,14 @@ import java.awt.RenderingHints;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Locale; import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JCheckBoxMenuItem; import javax.swing.JCheckBoxMenuItem;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import fr.soleil.comete.tango.data.service.helper.TangoDeviceHelper; import fr.soleil.comete.tango.data.service.helper.TangoDeviceHelper;
import fr.soleil.flyscan.gui.util.DeviceManager; import fr.soleil.flyscan.gui.util.DeviceManager;
...@@ -23,7 +26,10 @@ import fr.soleil.flyscan.gui.util.Utilities; ...@@ -23,7 +26,10 @@ import fr.soleil.flyscan.gui.util.Utilities;
import fr.soleil.flyscan.gui.view.tabbedpane.CloseSaveButtonTabbedPane; import fr.soleil.flyscan.gui.view.tabbedpane.CloseSaveButtonTabbedPane;
import fr.soleil.lib.project.ObjectUtils; import fr.soleil.lib.project.ObjectUtils;
import fr.soleil.lib.project.application.Application; import fr.soleil.lib.project.application.Application;
import fr.soleil.lib.project.date.DateUtil;
import fr.soleil.lib.project.date.IDateConstants;
import fr.soleil.lib.project.swing.Splash; import fr.soleil.lib.project.swing.Splash;
import fr.soleil.lib.project.swing.panel.ImagePanel;
import fr.soleil.lib.project.swing.text.JSmoothLabel; import fr.soleil.lib.project.swing.text.JSmoothLabel;
/** /**
...@@ -33,7 +39,9 @@ import fr.soleil.lib.project.swing.text.JSmoothLabel; ...@@ -33,7 +39,9 @@ import fr.soleil.lib.project.swing.text.JSmoothLabel;
*/ */
public class FlyScan extends Application implements IFlyScanConstants { public class FlyScan extends Application implements IFlyScanConstants {
private static final long serialVersionUID = -5111987521591073943L; private static final long serialVersionUID = -2775002328451870895L;
public static long startDate = 0;
protected static final String COPYRIGHT = "SOLEIL Synchrotron"; protected static final String COPYRIGHT = "SOLEIL Synchrotron";
protected static final String TITLE = "FlyScan GUI"; protected static final String TITLE = "FlyScan GUI";
...@@ -161,10 +169,21 @@ public class FlyScan extends Application implements IFlyScanConstants { ...@@ -161,10 +169,21 @@ public class FlyScan extends Application implements IFlyScanConstants {
@Override @Override
protected JDialog generateAboutDialog() { protected JDialog generateAboutDialog() {
ResourceBundle bundle = ResourceBundle.getBundle(FlyScan.class.getPackage().getName() + ".application");
JDialog aboutDialog = new JDialog(this, String.format(Utilities.getMessage("flyscan.about.title"), TITLE), JDialog aboutDialog = new JDialog(this, String.format(Utilities.getMessage("flyscan.about.title"), TITLE),
true); true);
JLabel label = new JSmoothLabel(Utilities.getMessage("flyscan.about.description"), JLabel.CENTER); ImagePanel panel = new ImagePanel(new BorderLayout());
aboutDialog.setContentPane(label); panel.setPreferredSize(
new Dimension(Utilities.SPLASH_ICON.getIconWidth(), Utilities.SPLASH_ICON.getIconHeight()));
panel.setBackgroundImage(Utilities.SPLASH_ICON);
panel.setImageAlpha(1);
JLabel label = new JSmoothLabel(
String.format(Utilities.getMessage("flyscan.about.description"), bundle.getString("project.version"),
DateUtil.milliToString(FlyScan.getStartDate(), IDateConstants.US_DATE_FORMAT)),
SwingConstants.LEFT);
label.setFont(Utilities.BASIC_FONT.deriveFont(14f));
panel.add(label, BorderLayout.SOUTH);
aboutDialog.setContentPane(panel);
aboutDialog.pack(); aboutDialog.pack();
aboutDialog.setResizable(false); aboutDialog.setResizable(false);
aboutDialog.setLocationRelativeTo(getHelpMenu()); aboutDialog.setLocationRelativeTo(getHelpMenu());
...@@ -202,13 +221,22 @@ public class FlyScan extends Application implements IFlyScanConstants { ...@@ -202,13 +221,22 @@ public class FlyScan extends Application implements IFlyScanConstants {
return COPYRIGHT; return COPYRIGHT;
} }
public static long getStartDate() {
if (startDate == 0) {
startDate = System.currentTimeMillis();
}
return startDate;
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("Starting flyscangui..."); System.out.println("Starting flyscangui...");
long date = System.currentTimeMillis();
Splash splash = new Splash(Utilities.SPLASH_ICON, false); Splash splash = new Splash(Utilities.SPLASH_ICON, false);
splash.setTitle(getTitle(false)); splash.setTitle(getTitle(false));
splash.initProgress(); splash.initProgress();
splash.setMaxProgress(5); splash.setMaxProgress(5);
splash.setCopyright(COPYRIGHT); splash.setCopyright(COPYRIGHT);
FlyScan.startDate = date;
splash.progress(0); splash.progress(0);
splash.setMessage( splash.setMessage(
FlyScan.getMessageManager(FlyScan.class.getClassLoader()).getMessage("Application.progressMessage0")); FlyScan.getMessageManager(FlyScan.class.getClassLoader()).getMessage("Application.progressMessage0"));
......
...@@ -767,11 +767,11 @@ public class ConfigurationGUI extends JPanel { ...@@ -767,11 +767,11 @@ public class ConfigurationGUI extends JPanel {
controlPanel.add(listScrollPane, BorderLayout.CENTER); controlPanel.add(listScrollPane, BorderLayout.CENTER);
controlPanel.add(buttonPanel, BorderLayout.SOUTH); controlPanel.add(buttonPanel, BorderLayout.SOUTH);
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, controlPanel, infoPanel); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, controlPanel, infoPanel);
splitPane.setUI(new ColoredSplitPaneUI());
splitPane.setOneTouchExpandable(true); splitPane.setOneTouchExpandable(true);
splitPane.setDividerSize(8); splitPane.setDividerSize(8);
splitPane.setResizeWeight(0); splitPane.setResizeWeight(0);
splitPane.setMinimumSize(SPLITPANE_MINIMUM_SIZE); splitPane.setMinimumSize(SPLITPANE_MINIMUM_SIZE);
splitPane.setUI(new ColoredSplitPaneUI());
TabLabel label = new TabLabel(tabTitle, tabIcon, JLabel.LEFT); TabLabel label = new TabLabel(tabTitle, tabIcon, JLabel.LEFT);
// RotatedLabel label = new RotatedLabel(tabTitle, tabIcon, JLabel.LEFT); // RotatedLabel label = new RotatedLabel(tabTitle, tabIcon, JLabel.LEFT);
// label.setDirection(Direction.VERTICAL_UP); // label.setDirection(Direction.VERTICAL_UP);
......
...@@ -107,7 +107,13 @@ flyscan.parameter.custom = Custom parameters ...@@ -107,7 +107,13 @@ flyscan.parameter.custom = Custom parameters
flyscan.parameter.master = Master parameters flyscan.parameter.master = Master parameters
flyscan.description = %s description flyscan.description = %s description
flyscan.about.title = About %s flyscan.about.title = About %s
flyscan.about.description = Basic application used to interact with FlyScan device flyscan.about.description = <html><body style="margin:5px">\
<h1 style="font-size:30px;margin-bottom:5px;color:#0000aa;">FlyScan GUI %s</h1>\
<h2 style="font-size:14px; font-style:italic;margin-bottom:5px;margin-top:0;color:#808080;">Started since %s</h2>\
FlyScan GUI is an application used to interact with FlyScanServer device.<br />\
It helps you to configure and run your flyscans.<br />\
Both FlyScan GUI and FlyScanServer device are developed at SOLEIL Synchrotron by ISAC group (DAI)\
</body></html>
flyscan.device = Flyscan device: flyscan.device = Flyscan device:
flyscan.device.monitored = Monitored Devices flyscan.device.monitored = Monitored Devices
flyscan.level.expert = %s - Expert level flyscan.level.expert = %s - Expert level
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment