Issue#36 Improved AboutDialog

This commit is contained in:
Didier Clermonté 2016-07-04 16:02:01 +02:00
parent efc45c07ea
commit f4aedd64cc
9 changed files with 97 additions and 9 deletions

View File

@ -29,6 +29,9 @@ public class SibaException extends Exception
{
private static final long serialVersionUID = 2909630770291570845L;
/**
*
*/
public SibaException()
{
super();

View File

@ -22,11 +22,17 @@ package org.dclermonte.siba.gui;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ResourceBundle;
import javax.swing.ImageIcon;
import javax.swing.JButton;
@ -46,13 +52,18 @@ import org.slf4j.LoggerFactory;
public class AboutDialog extends JDialog
{
private static final long serialVersionUID = 8868109575782482455L;
private static ResourceBundle BUNDLE = ResourceBundle.getBundle("org.dclermonte.siba.gui.messages"); //$NON-NLS-1$
public static final Logger logger = LoggerFactory.getLogger(AboutDialog.class);
/**
* This is the constructor for the dialog.
*
* @throws IOException
*/
public AboutDialog()
public AboutDialog() throws IOException
{
setMinimumSize(new Dimension(600, 350));
setMaximumSize(new Dimension(600, 500));
setIconImage(Toolkit.getDefaultToolkit()
.getImage(AboutDialog.class.getResource("/org/dclermonte/siba/gui/SibaLogo.png")));
setBackground(Color.GREEN);
@ -84,18 +95,36 @@ public class AboutDialog extends JDialog
JPanel panel = new JPanel();
panel.setBackground(Color.GREEN);
getContentPane().add(panel, BorderLayout.CENTER);
{
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setIcon(new ImageIcon(AboutDialog.class.getResource("/org/dclermonte/siba/gui/SibaLogo.png")));
panel.add(lblNewLabel);
}
panel.setLayout(new BorderLayout(0, 0));
JTextPane txtpnSimpleBackupDveloppeur = new JTextPane();
txtpnSimpleBackupDveloppeur.setBackground(Color.GREEN);
txtpnSimpleBackupDveloppeur.setFont(new Font("Dialog", Font.BOLD, 14));
txtpnSimpleBackupDveloppeur.setText(
"Simple Backup\n\nDéveloppeur Christian Pierre Momon et Didier Clermonté\n\nLicence GNU Affero General Public License 2016");
txtpnSimpleBackupDveloppeur.setContentType("text/html");
String path = System.getProperty("user.dir");
String about = BUNDLE.getString("AboutDialog");
File aboutFile = new File(path + "/src/org/dclermonte/siba/gui/" + about);
FileReader in = new FileReader(aboutFile);
BufferedReader bufferedReader = new BufferedReader(in);
StringBuilder stringBuilder = new StringBuilder();
String lines;
String line;
while ((line = bufferedReader.readLine()) != null)
{
stringBuilder.append(line);
}
lines = stringBuilder.toString();
txtpnSimpleBackupDveloppeur.setText(lines);
System.out.println("texte = " + lines);
// "Simple Backup\n\nDéveloppeur Christian Pierre Momon et Didier
// Clermonté\n\nLicence GNU Affero General Public License 2016");
panel.add(txtpnSimpleBackupDveloppeur);
{
JLabel lblNewLabel = new JLabel("");
lblNewLabel
.setIcon(new ImageIcon(AboutDialog.class.getResource("/org/dclermonte/siba/gui/SibaLogo_256.png")));
panel.add(lblNewLabel, BorderLayout.WEST);
}
}
/**

View File

@ -60,6 +60,9 @@ public class CheckPanel extends JPanel
public static final Logger logger = LoggerFactory.getLogger(CheckPanel.class);
private JTextField fileToCheckField;
/**
*
*/
public CheckPanel()
{
setLayout(new BorderLayout(0, 0));

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,21 @@
<html>
<body lang="fr-FR" dir="ltr">
<p style="margin-bottom: 0cm; font-weight: normal; line-height: 100%">
<font color="#000000"><font face="Monospace" size="5" style="font-size: 16pt"><span ><b><u>SimpleBackup</u></b></span></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><br/>
</p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000" face="Monospace" size="3" style="font-size: 12pt"><b>Create Archive tar of a directory and calculate the MD5 hash</b></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><br/><br/>
</p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000" face="Monospace" size="3" style="font-size: 12pt"><b><u>Developpers&nbsp;:</u><br />
Christian Pierre Momon et Didier Clermonté</b></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><br/>
</p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000" face="Monospace" size="3" style="font-size: 12pt"><b>Licence
GNU Affero General Public License 2016</b></font></p>
<p><br/>
<br/>
</p>
</body>
</html>

View File

@ -0,0 +1,22 @@
<html>
<body lang="fr-FR" dir="ltr">
<p style="margin-bottom: 0cm; font-weight: normal; line-height: 100%">
<font color="#000000"><font face="Monospace" size="5" style="font-size: 16pt"><span ><b><u>SimpleBackup</u></b></span></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><br/>
</p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000" face="Monospace" size="3" style="font-size: 12pt"><b>Crée une archive .tar d'un répertoire
et calcule son hash MD5</b></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><br/><br/>
</p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000" face="Monospace" size="3" style="font-size: 12pt"><b><u>Développeurs&nbsp;:</u><br />
Christian Pierre Momon et Didier Clermonté</b></font></p>
<p style="margin-bottom: 0cm; line-height: 100%"><br/>
</p>
<p style="margin-bottom: 0cm; line-height: 100%"><font color="#000000" face="Monospace" size="3" style="font-size: 12pt"><b>Licence
GNU Affero General Public License 2016</b></font></p>
<p><br/>
<br/>
</p>
</body>
</html>

View File

@ -32,3 +32,4 @@ SibaGUI.mntmNewMenuItem_2.text=About
SibaGUI.mntmQuit.text=Quit
SourceDirectorySelector.this.dialogTitle=Directory to backup
TargetDirectorySelector.this.dialogTitle=Directory for the backup
AboutDialog = about_en.html

View File

@ -29,4 +29,5 @@ BackupPanel.TitleWarning.text = Attention
SibaGUI.mnFile.text=Fichier
SibaGUI.mntmBackup.text=Sauvegarder\u2026
SibaGUI.mntmQuit.text=Quitter
SibaGUI.mntmCheck.text=Vérifier\u2026
SibaGUI.mntmCheck.text=Vérifier\u2026
AboutDialog= about_fr.html

View File

@ -62,6 +62,14 @@ public class SibaUtils
return result;
}
/**
*
* @param md5
* @param fileName
* @param target
* @return
* @throws IOException
*/
public static File createMD5File(final String md5, final String fileName, final String target) throws IOException
{
File result;