Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ETC42
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
etc42
ETC42
Commits
ee753674
Commit
ee753674
authored
May 04, 2017
by
SAPONE Alann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
help menu v1
parent
71a9cb3e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
252 additions
and
204 deletions
+252
-204
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/EtcFrame.java
...src/main/java/org/cnrs/lam/dis/etc/ui/swing/EtcFrame.java
+7
-28
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/AboutDialog.java
.../java/org/cnrs/lam/dis/etc/ui/swing/help/AboutDialog.java
+171
-40
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/ContactDialog.java
...ava/org/cnrs/lam/dis/etc/ui/swing/help/ContactDialog.java
+0
-23
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/ContributionDialog.java
...rg/cnrs/lam/dis/etc/ui/swing/help/ContributionDialog.java
+64
-28
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/HelpDialog.java
...n/java/org/cnrs/lam/dis/etc/ui/swing/help/HelpDialog.java
+2
-2
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/LicenseDialog.java
...ava/org/cnrs/lam/dis/etc/ui/swing/help/LicenseDialog.java
+0
-82
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/UtilsLoader.java
.../java/org/cnrs/lam/dis/etc/ui/swing/help/UtilsLoader.java
+8
-1
No files found.
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/EtcFrame.java
View file @
ee753674
...
...
@@ -96,9 +96,7 @@ import org.cnrs.lam.dis.etc.ui.swing.dataset.DatasetManagementTool;
import
org.cnrs.lam.dis.etc.ui.swing.generic.ClosableTabComponent
;
import
org.cnrs.lam.dis.etc.ui.swing.generic.MultiSelectDialog
;
import
org.cnrs.lam.dis.etc.ui.swing.help.AboutDialog
;
import
org.cnrs.lam.dis.etc.ui.swing.help.ContactDialog
;
import
org.cnrs.lam.dis.etc.ui.swing.help.ContributionDialog
;
import
org.cnrs.lam.dis.etc.ui.swing.help.LicenseDialog
;
import
org.cnrs.lam.dis.etc.ui.swing.importer.MultiImportTool
;
import
org.cnrs.lam.dis.etc.ui.swing.result.ChartsTabbedPane
;
import
org.cnrs.lam.dis.etc.ui.swing.result.ImagesTabbedPane
;
...
...
@@ -243,8 +241,6 @@ public class EtcFrame extends javax.swing.JFrame implements UIManager {
helpMenu
=
new
javax
.
swing
.
JMenu
();
helpMenuItem
=
new
javax
.
swing
.
JMenuItem
();
contributionMenuItem
=
new
javax
.
swing
.
JMenuItem
();
licenseMenuItem
=
new
javax
.
swing
.
JMenuItem
();
contactMenuItem
=
new
javax
.
swing
.
JMenuItem
();
aboutMenuItem
=
new
javax
.
swing
.
JMenuItem
();
fileChooser
.
setName
(
"fileChooser"
);
// NOI18N
...
...
@@ -258,6 +254,11 @@ public class EtcFrame extends javax.swing.JFrame implements UIManager {
setDefaultCloseOperation
(
javax
.
swing
.
WindowConstants
.
DO_NOTHING_ON_CLOSE
);
java
.
util
.
ResourceBundle
bundle
=
java
.
util
.
ResourceBundle
.
getBundle
(
"org/cnrs/lam/dis/etc/ui/swing/messages"
);
// NOI18N
setTitle
(
bundle
.
getString
(
"ETC_FRAME_TITLE"
));
// NOI18N
// MAC app name
System
.
setProperty
(
"apple.laf.useScreenMenuBar"
,
"true"
);
System
.
setProperty
(
"com.apple.mrj.application.apple.menu.about.name"
,
bundle
.
getString
(
"ETC_FRAME_TITLE"
));
setIconImage
(
Toolkit
.
getDefaultToolkit
().
getImage
(
getClass
().
getResource
(
"/org/cnrs/lam/dis/etc/ui/swing/images/Etc-small.png"
)));
setName
(
"etcFrame"
);
// NOI18N
addWindowListener
(
new
java
.
awt
.
event
.
WindowAdapter
()
{
...
...
@@ -566,8 +567,8 @@ public class EtcFrame extends javax.swing.JFrame implements UIManager {
});
helpMenu
.
add
(
helpMenuItem
);
contributionMenuItem
.
setText
(
"Contribut
ion
"
);
// NOI18N
contributionMenuItem
.
setName
(
"contribut
ion
MenuItem"
);
// NOI18N
contributionMenuItem
.
setText
(
"Contribut
e
"
);
// NOI18N
contributionMenuItem
.
setName
(
"contribut
e
MenuItem"
);
// NOI18N
contributionMenuItem
.
addActionListener
(
new
java
.
awt
.
event
.
ActionListener
()
{
@Override
public
void
actionPerformed
(
java
.
awt
.
event
.
ActionEvent
evt
)
{
...
...
@@ -576,26 +577,6 @@ public class EtcFrame extends javax.swing.JFrame implements UIManager {
});
helpMenu
.
add
(
contributionMenuItem
);
licenseMenuItem
.
setText
(
"License"
);
// NOI18N
licenseMenuItem
.
setName
(
"licenseMenuItem"
);
// NOI18N
licenseMenuItem
.
addActionListener
(
new
java
.
awt
.
event
.
ActionListener
()
{
@Override
public
void
actionPerformed
(
java
.
awt
.
event
.
ActionEvent
evt
)
{
LicenseDialog
.
show
(
EtcFrame
.
this
);
}
});
helpMenu
.
add
(
licenseMenuItem
);
contactMenuItem
.
setText
(
"Contact"
);
// NOI18N
contactMenuItem
.
setName
(
"contactMenuItem"
);
// NOI18N
contactMenuItem
.
addActionListener
(
new
java
.
awt
.
event
.
ActionListener
()
{
@Override
public
void
actionPerformed
(
java
.
awt
.
event
.
ActionEvent
evt
)
{
ContactDialog
.
show
(
EtcFrame
.
this
);
}
});
helpMenu
.
add
(
contactMenuItem
);
aboutMenuItem
.
setText
(
"About"
);
// NOI18N
aboutMenuItem
.
setName
(
"aboutMenuItem"
);
// NOI18N
aboutMenuItem
.
addActionListener
(
new
java
.
awt
.
event
.
ActionListener
()
{
...
...
@@ -933,8 +914,6 @@ private void OptionsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//G
private
javax
.
swing
.
JMenu
helpMenu
;
private
javax
.
swing
.
JMenuItem
helpMenuItem
;
private
javax
.
swing
.
JMenuItem
contributionMenuItem
;
private
javax
.
swing
.
JMenuItem
licenseMenuItem
;
private
javax
.
swing
.
JMenuItem
contactMenuItem
;
private
javax
.
swing
.
JMenuItem
aboutMenuItem
;
// End of variables declaration//GEN-END:variables
...
...
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/AboutDialog.java
View file @
ee753674
...
...
@@ -2,20 +2,18 @@ package org.cnrs.lam.dis.etc.ui.swing.help;
import
java.awt.Component
;
import
java.awt.Cursor
;
import
java.awt.Desktop
;
import
java.awt.Font
;
import
java.awt.Image
;
import
java.awt.Toolkit
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseEvent
;
import
java.net.MalformedURLException
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
javax.swing.Box
;
import
javax.swing.BoxLayout
;
import
javax.swing.ImageIcon
;
import
javax.swing.JButton
;
import
javax.swing.JFrame
;
import
javax.swing.JLabel
;
import
javax.swing.JPanel
;
...
...
@@ -24,88 +22,221 @@ import javax.swing.border.EmptyBorder;
import
org.cnrs.lam.dis.etc.configuration.ConfigFactory
;
public
class
AboutDialog
extends
HelpDialog
{
private
static
final
long
serialVersionUID
=
-
679981628077230532L
;
private
static
AboutDialog
instance
=
null
;
public
final
static
String
LICENSE_URL
=
"http://www.cecill.info/licences/Licence_CeCILL_V2.1-fr.html"
;
public
final
static
String
CONTACT_URL
=
"etc42@lam.fr"
;
private
final
static
String
[]
authors
=
{
"C. Surace"
,
"N. Apostolakos"
,
"P.Y. Chabaud"
,
"A. Gross"
,
"J. Penguen"
,
"A. Sapone"
};
private
final
static
String
[]
contributors
=
{
"J.G. Cuby"
,
"V. Le Brun"
,
"G. Leleu"
,
"J. Liu"
};
private
JLabel
logoLamLabel
;
private
JLabel
logoCesamLabel
;
private
String
formatList
(
String
[]
list
,
int
lineBreakIndex
)
{
String
listString
=
""
;
for
(
int
i
=
0
;
i
<
list
.
length
;
i
++)
{
String
item
=
list
[
i
];
listString
+=
item
;
if
(
i
<
list
.
length
-
1
)
{
listString
+=
", "
;
}
if
(
(
i
+
1
)
%
lineBreakIndex
==
0
)
{
listString
+=
"<br>"
;
}
}
return
listString
;
}
public
AboutDialog
(
JFrame
parent
)
{
super
(
parent
,
"About ETC-42"
);
JPanel
wrapper
=
new
JPanel
();
wrapper
.
setLayout
(
new
BoxLayout
(
wrapper
,
BoxLayout
.
PAGE_AXIS
));
getContentPane
().
remove
(
buttonPane
);
// LogoETC
Image
logoImage
=
Toolkit
.
getDefaultToolkit
().
getImage
(
getClass
().
getResource
(
"/org/cnrs/lam/dis/etc/ui/swing/images/Etc-big.png"
));
ImageIcon
logo
=
new
ImageIcon
(
logoImage
.
getScaledInstance
(
200
,
20
0
,
Image
.
SCALE_SMOOTH
));
ImageIcon
logo
=
new
ImageIcon
(
logoImage
.
getScaledInstance
(
120
,
12
0
,
Image
.
SCALE_SMOOTH
));
JLabel
logoLabel
=
new
JLabel
(
logo
);
logoLabel
.
setBorder
(
new
EmptyBorder
(
30
,
30
,
30
,
30
));
logoLabel
.
setAlignmentX
(
Component
.
CENTER_ALIGNMENT
);
wrapper
.
add
(
logoLabel
);
// Title
JLabel
title
=
new
JLabel
(
"ETC-42 Version: "
+
ConfigFactory
.
getConfig
().
getVersion
());
title
.
setAlignmentX
(
Component
.
CENTER_ALIGNMENT
);
Font
font
=
title
.
getFont
();
Font
boldFont
=
new
Font
(
font
.
getFontName
(),
Font
.
BOLD
,
font
.
getSize
());
title
.
setFont
(
boldFont
);
title
.
setBorder
(
new
EmptyBorder
(
0
,
30
,
30
,
30
));
wrapper
.
add
(
title
);
// Content
JLabel
content
=
new
JLabel
(
"Content"
);
content
.
setAlignmentX
(
Component
.
CENTER_ALIGNMENT
);
content
.
setBorder
(
new
EmptyBorder
(
15
,
30
,
15
,
30
));
// wrapper.add(content);
Box
horizontalLogoGroup
=
Box
.
createHorizontalBox
();
// LogoLAM
Image
logoLamImage
=
Toolkit
.
getDefaultToolkit
().
getImage
(
getClass
().
getResource
(
"/org/cnrs/lam/dis/etc/ui/swing/images/LAM.jpg"
));
ImageIcon
logoLam
=
new
ImageIcon
(
logoLamImage
.
getScaledInstance
(
110
,
35
,
Image
.
SCALE_SMOOTH
));
JLabel
logoLamLabel
=
new
JLabel
(
logoLam
);
logoLamLabel
=
new
JLabel
(
logoLam
);
logoLamLabel
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
logoLamLabel
.
setBorder
(
new
EmptyBorder
(
5
,
5
,
5
,
5
*
3
));
logoLamLabel
.
setCursor
(
Cursor
.
getPredefinedCursor
(
Cursor
.
HAND_CURSOR
));
logoLamLabel
.
setBorder
(
new
EmptyBorder
(
0
,
0
,
0
,
30
));
logoLamLabel
.
addMouseListener
(
new
MouseAdapter
()
{
public
void
mouseClicked
(
MouseEvent
e
)
{
try
{
Browser
Loader
.
openWebpage
(
new
URL
(
"https://www.lam.fr/"
));
Utils
Loader
.
openWebpage
(
new
URL
(
"https://www.lam.fr/"
));
}
catch
(
MalformedURLException
e1
)
{}
}
});
horizontalLogoGroup
.
add
(
logoLamLabel
);
// LogoCesam
Image
logoCesamImage
=
Toolkit
.
getDefaultToolkit
().
getImage
(
getClass
().
getResource
(
"/org/cnrs/lam/dis/etc/ui/swing/images/Cesam.png"
));
ImageIcon
logoCesam
=
new
ImageIcon
(
logoCesamImage
.
getScaledInstance
(
61
,
35
,
Image
.
SCALE_SMOOTH
));
logoCesamLabel
=
new
JLabel
(
logoCesam
);
logoCesamLabel
.
setAlignmentX
(
Component
.
RIGHT_ALIGNMENT
);
logoCesamLabel
.
setBorder
(
new
EmptyBorder
(
5
,
5
*
3
,
5
,
5
));
logoCesamLabel
.
setCursor
(
Cursor
.
getPredefinedCursor
(
Cursor
.
HAND_CURSOR
));
logoCesamLabel
.
setBorder
(
new
EmptyBorder
(
0
,
30
,
0
,
0
));
logoCesamLabel
.
addMouseListener
(
new
MouseAdapter
()
{
@Override
@Override
public
void
mouseClicked
(
MouseEvent
e
)
{
try
{
Browser
Loader
.
openWebpage
(
new
URL
(
"https://www.lam.fr/cesam/"
));
Utils
Loader
.
openWebpage
(
new
URL
(
"https://www.lam.fr/cesam/"
));
}
catch
(
MalformedURLException
e1
)
{}
}
});
// Title
JLabel
titleLabel
=
new
JLabel
(
"ETC-42 Version: "
+
ConfigFactory
.
getConfig
().
getVersion
());
Font
font
=
titleLabel
.
getFont
();
Font
boldFont
=
new
Font
(
font
.
getFontName
(),
Font
.
BOLD
,
font
.
getSize
());
titleLabel
.
setFont
(
boldFont
);
horizontalLogoGroup
.
add
(
logoCesamLabel
);
wrapper
.
add
(
horizontalLogoGroup
);
// Licence
JLabel
distributedLabel
=
new
JLabel
(
"Distributed under "
);
distributedLabel
.
setAlignmentX
(
LEFT_ALIGNMENT
);
String
htmlLicenceURL
=
"<html><a href=\""
+
LICENSE_URL
+
"\">CeCILL</a></html>"
;
JLabel
licenceURLLabel
=
new
JLabel
(
htmlLicenceURL
);
licenceURLLabel
.
setCursor
(
Cursor
.
getPredefinedCursor
(
Cursor
.
HAND_CURSOR
));
licenceURLLabel
.
addMouseListener
(
new
MouseAdapter
()
{
public
void
mouseClicked
(
MouseEvent
e
)
{
try
{
UtilsLoader
.
openWebpage
(
new
URL
(
LICENSE_URL
));
}
catch
(
MalformedURLException
e1
)
{}
}
});
// Authors
String
authorsString
=
formatList
(
authors
,
3
);
JLabel
authorsLabel
=
new
JLabel
(
"<html><b>Authors:</b> "
+
authorsString
+
"</html>"
);
authorsLabel
.
setAlignmentX
(
LEFT_ALIGNMENT
);
authorsLabel
.
setBorder
(
new
EmptyBorder
(
15
,
0
,
15
,
0
));
String
contributorsString
=
formatList
(
contributors
,
4
);
JLabel
contributorsLabel
=
new
JLabel
(
"<html><b>Contributors:</b> "
+
contributorsString
+
"</html>"
);
contributorsLabel
.
setAlignmentX
(
LEFT_ALIGNMENT
);
// contact
JLabel
contactLabel
=
new
JLabel
(
"Contact: "
);
contactLabel
.
setAlignmentX
(
LEFT_ALIGNMENT
);
Font
fontContact
=
contactLabel
.
getFont
();
Font
boldFontContact
=
new
Font
(
fontContact
.
getFontName
(),
Font
.
BOLD
,
fontContact
.
getSize
());
contactLabel
.
setFont
(
boldFontContact
);
String
contactURL
=
"<html><a href=\""
+
CONTACT_URL
+
"\">"
+
CONTACT_URL
+
"</a></html>"
;
JLabel
contactUrlLabel
=
new
JLabel
(
contactURL
);
contactUrlLabel
.
setAlignmentX
(
LEFT_ALIGNMENT
);
contactUrlLabel
.
setCursor
(
Cursor
.
getPredefinedCursor
(
Cursor
.
HAND_CURSOR
));
contactUrlLabel
.
addMouseListener
(
new
MouseAdapter
()
{
public
void
mouseClicked
(
MouseEvent
e
)
{
try
{
UtilsLoader
.
openMail
(
new
URL
(
CONTACT_URL
));
}
catch
(
MalformedURLException
e1
)
{}
}
});
// Panels
JPanel
wrapper
=
new
JPanel
();
BoxLayout
layout
=
new
BoxLayout
(
wrapper
,
BoxLayout
.
LINE_AXIS
);
wrapper
.
setLayout
(
layout
);
wrapper
.
setBorder
(
new
EmptyBorder
(
15
,
15
,
15
,
15
));
Box
logosPane
=
Box
.
createHorizontalBox
();
logosPane
.
add
(
logoLamLabel
);
logosPane
.
add
(
logoCesamLabel
);
logosPane
.
setBorder
(
new
EmptyBorder
(
30
,
30
,
0
,
30
));
JPanel
leftPane
=
new
JPanel
();
leftPane
.
setLayout
(
new
BoxLayout
(
leftPane
,
BoxLayout
.
Y_AXIS
));
leftPane
.
add
(
logoLabel
);
leftPane
.
add
(
logosPane
);
leftPane
.
setAlignmentY
(
CENTER_ALIGNMENT
);
JPanel
licensePane
=
new
JPanel
();
licensePane
.
setLayout
(
new
BoxLayout
(
licensePane
,
BoxLayout
.
LINE_AXIS
));
licensePane
.
add
(
distributedLabel
);
licensePane
.
add
(
licenceURLLabel
);
licensePane
.
setAlignmentX
(
LEFT_ALIGNMENT
);
JPanel
contactPane
=
new
JPanel
();
contactPane
.
setLayout
(
new
BoxLayout
(
contactPane
,
BoxLayout
.
LINE_AXIS
));
contactPane
.
setBorder
(
new
EmptyBorder
(
15
,
0
,
15
,
0
));
contactPane
.
add
(
contactLabel
);
contactPane
.
add
(
contactUrlLabel
);
contactPane
.
setAlignmentX
(
LEFT_ALIGNMENT
);
JPanel
contentPane
=
new
JPanel
();
contentPane
.
setLayout
(
new
BoxLayout
(
contentPane
,
BoxLayout
.
Y_AXIS
));
contentPane
.
setAlignmentY
(
CENTER_ALIGNMENT
);
contentPane
.
setAlignmentX
(
LEFT_ALIGNMENT
);
titleLabel
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
contentPane
.
add
(
titleLabel
);
licensePane
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
contentPane
.
add
(
licensePane
);
authorsLabel
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
contentPane
.
add
(
authorsLabel
);
contributorsLabel
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
contentPane
.
add
(
contributorsLabel
);
contactPane
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
contentPane
.
add
(
contactPane
);
wrapper
.
add
(
leftPane
);
wrapper
.
add
(
contentPane
);
getContentPane
().
add
(
wrapper
);
// Contribute link from about
JButton
contributeButton
=
new
JButton
(
"Contribute"
);
final
JFrame
dialogOwner
=
new
JFrame
();
dialogOwner
.
setLocationRelativeTo
(
this
);
contributeButton
.
addActionListener
(
new
java
.
awt
.
event
.
ActionListener
()
{
@Override
public
void
actionPerformed
(
java
.
awt
.
event
.
ActionEvent
evt
)
{
ContributionDialog
.
show
(
dialogOwner
);
}
});
this
.
buttonPane
.
add
(
contributeButton
);
JPanel
buttonPaneWrapper
=
new
JPanel
();
buttonPaneWrapper
.
add
(
buttonPane
);
buttonPaneWrapper
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
contentPane
.
add
(
buttonPaneWrapper
);
pack
();
}
public
static
void
show
(
JFrame
parent
)
{
instance
=
new
AboutDialog
(
parent
);
if
(
instance
==
null
)
{
...
...
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/ContactDialog.java
deleted
100644 → 0
View file @
71a9cb3e
package
org.cnrs.lam.dis.etc.ui.swing.help
;
import
javax.swing.JFrame
;
public
class
ContactDialog
extends
HelpDialog
{
private
static
final
long
serialVersionUID
=
-
3651195093944644615L
;
private
static
ContactDialog
instance
=
null
;
public
ContactDialog
(
JFrame
parent
)
{
super
(
parent
,
"Contact"
,
"<b>Contact:</b><br>"
+
"etc42@lam.fr"
);
}
public
static
void
show
(
JFrame
parent
)
{
instance
=
new
ContactDialog
(
parent
);
if
(
instance
==
null
)
{
}
instance
.
setVisible
(
true
);
}
}
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/ContributionDialog.java
View file @
ee753674
package
org.cnrs.lam.dis.etc.ui.swing.help
;
import
java.awt.Cursor
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseEvent
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
javax.swing.BorderFactory
;
import
javax.swing.BoxLayout
;
import
javax.swing.JFrame
;
import
javax.swing.JLabel
;
import
javax.swing.JPanel
;
import
javax.swing.SwingConstants
;
import
javax.swing.border.EmptyBorder
;
public
class
ContributionDialog
extends
HelpDialog
{
private
static
final
long
serialVersionUID
=
3773082265462219174L
;
private
static
ContributionDialog
instance
=
null
;
private
final
static
String
[]
authors
=
{
"C. Surace"
,
"N. Apostolakos"
,
"P.Y. Chabaud"
,
"A. Gross"
,
"J. Penguen"
,
"A. Sapone"
};
private
final
static
String
[]
contributors
=
{
"J.G. Cuby"
,
"V. Le Brun"
,
"G. Leleu"
,
"J. Liu"
};
private
final
static
String
intro
=
"We are always looking for contributors.<br>"
+
"Do not hesitate to contact us !<br><br>"
;
private
final
static
String
SOURCE_URL
=
"https://gitlab.lam.fr/etc42/ETC42"
;
public
ContributionDialog
(
JFrame
parent
)
{
super
(
parent
,
"Contribution"
,
"<div style='text-align: center;'>"
+
intro
+
"<b>Authors:</b><br>"
+
String
.
join
(
", <br>"
,
authors
)
+
"<br><br>"
+
"<b>Contributors:</b><br>"
+
String
.
join
(
", <br>"
,
contributors
)
+
"<br>"
+
"</div>"
);
super
(
parent
,
"Contribute"
);
JPanel
wrapper
=
new
JPanel
();
wrapper
.
setLayout
(
new
BoxLayout
(
wrapper
,
BoxLayout
.
PAGE_AXIS
));
wrapper
.
setBorder
(
new
EmptyBorder
(
15
,
15
,
15
,
15
));
JPanel
important
=
new
JPanel
();
important
.
setLayout
(
new
BoxLayout
(
important
,
BoxLayout
.
Y_AXIS
));
important
.
setBorder
(
BorderFactory
.
createTitledBorder
(
"Important"
));
String
intro
=
"<html><div style='text-align: center;'>We are looking for contributors.<br> Please, do not hesitate to contact us at:</div><br></html>"
;
JLabel
introLabel
=
new
JLabel
(
intro
,
SwingConstants
.
CENTER
);
important
.
add
(
introLabel
);
String
htmlContactURL
=
"<html><div style='text-align: center;'><a href=''>"
+
AboutDialog
.
CONTACT_URL
+
"</a></div></html>"
;
JLabel
contactUrlLabel
=
new
JLabel
(
htmlContactURL
,
SwingConstants
.
CENTER
);
contactUrlLabel
.
setCursor
(
Cursor
.
getPredefinedCursor
(
Cursor
.
HAND_CURSOR
));
contactUrlLabel
.
addMouseListener
(
new
MouseAdapter
()
{
public
void
mouseClicked
(
MouseEvent
e
)
{
try
{
UtilsLoader
.
openMail
(
new
URL
(
AboutDialog
.
CONTACT_URL
));
}
catch
(
MalformedURLException
e1
)
{}
}
});
important
.
add
(
contactUrlLabel
);
important
.
setAlignmentX
(
LEFT_ALIGNMENT
);
wrapper
.
add
(
important
);
// Code source linking
String
source
=
"<html><div style='text-align: center;'><br>You can download and contribute to the ETC-42 codebase<br>by accessing the project repository:</div><br></html>"
;
JLabel
sourceLabel
=
new
JLabel
(
source
,
SwingConstants
.
CENTER
);
sourceLabel
.
setBorder
(
new
EmptyBorder
(
10
,
0
,
0
,
0
));
wrapper
.
add
(
sourceLabel
);
String
htmlSourceURL
=
"<html><div style='text-align: center;'><a href=''>"
+
SOURCE_URL
+
"</a></div></html>"
;
JLabel
sourceURLLabel
=
new
JLabel
(
htmlSourceURL
,
SwingConstants
.
CENTER
);
sourceURLLabel
.
setCursor
(
Cursor
.
getPredefinedCursor
(
Cursor
.
HAND_CURSOR
));
sourceURLLabel
.
addMouseListener
(
new
MouseAdapter
()
{
public
void
mouseClicked
(
MouseEvent
e
)
{
try
{
UtilsLoader
.
openWebpage
(
new
URL
(
SOURCE_URL
));
}
catch
(
MalformedURLException
e1
)
{}
}
});
wrapper
.
add
(
sourceURLLabel
);
getContentPane
().
add
(
wrapper
);
pack
();
}
public
static
void
show
(
JFrame
parent
)
{
...
...
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/HelpDialog.java
View file @
ee753674
...
...
@@ -6,7 +6,6 @@ import java.awt.Component;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
javax.swing.Box
;
import
javax.swing.JButton
;
import
javax.swing.JDialog
;
import
javax.swing.JFrame
;
...
...
@@ -17,11 +16,12 @@ import javax.swing.SwingConstants;
public
class
HelpDialog
extends
JDialog
implements
ActionListener
{
private
static
final
long
serialVersionUID
=
690722433853815375L
;
protected
JPanel
buttonPane
=
new
JPanel
();
public
HelpDialog
(
JFrame
parent
,
String
title
)
{
super
(
parent
,
title
,
true
);
JPanel
buttonPane
=
new
JPanel
();
JButton
okButton
=
new
JButton
(
"OK"
);
buttonPane
.
add
(
okButton
);
getContentPane
().
add
(
buttonPane
,
BorderLayout
.
SOUTH
);
...
...
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/LicenseDialog.java
deleted
100644 → 0
View file @
71a9cb3e
package
org.cnrs.lam.dis.etc.ui.swing.help
;
import
java.awt.Component
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseEvent
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
javax.swing.BoxLayout
;
import
javax.swing.JFrame
;
import
javax.swing.JLabel
;
import
javax.swing.JPanel
;
import
javax.swing.border.EmptyBorder
;
public
class
LicenseDialog
extends
HelpDialog
{
private
static
final
long
serialVersionUID
=
-
2828109863960281086L
;
private
static
LicenseDialog
instance
=
null
;
private
final
static
String
LICENSE_URL
=
"http://www.cecill.info/licences/Licence_CeCILL_V2.1-fr.html"
;
private
final
static
String
SOURCE_URL
=
"https://gitlab.lam.fr/etc42/ETC42"
;
public
LicenseDialog
(
JFrame
parent
)
{
super
(
parent
,
"License"
);
JPanel
wrapper
=
new
JPanel
();
wrapper
.
setLayout
(
new
BoxLayout
(
wrapper
,
BoxLayout
.
PAGE_AXIS
));
wrapper
.
setBorder
(
new
EmptyBorder
(
5
,
5
,
5
,
5
));
// Distribution linking
String
distributed
=
"Distributed under CeCILL:"
;
JLabel
distributedLabel
=
new
JLabel
(
distributed
);
distributedLabel
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
wrapper
.
add
(
distributedLabel
);
String
htmlLicenceURL
=
"<html><a href=\""
+
LICENSE_URL
+
"\">"
+
LICENSE_URL
+
"</a></html>"
;
JLabel
licenceURLLabel
=
new
JLabel
(
htmlLicenceURL
);
licenceURLLabel
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
licenceURLLabel
.
addMouseListener
(
new
MouseAdapter
()
{
public
void
mouseClicked
(
MouseEvent
e
)
{
try
{
BrowserLoader
.
openWebpage
(
new
URL
(
LICENSE_URL
));
}
catch
(
MalformedURLException
e1
)
{}
}
});
wrapper
.
add
(
licenceURLLabel
);
// Code source linking
String
source
=
"Code source is avaliable here:"
;
JLabel
sourceLabel
=
new
JLabel
(
source
);
sourceLabel
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
sourceLabel
.
setBorder
(
new
EmptyBorder
(
10
,
0
,
0
,
0
));
wrapper
.
add
(
sourceLabel
);
String
htmlSourceURL
=
"<html><a href=\""
+
SOURCE_URL
+
"\">"
+
SOURCE_URL
+
"</a></html>"
;
JLabel
sourceURLLabel
=
new
JLabel
(
htmlSourceURL
);
sourceURLLabel
.
setAlignmentX
(
Component
.
LEFT_ALIGNMENT
);
sourceURLLabel
.
addMouseListener
(
new
MouseAdapter
()
{
public
void
mouseClicked
(
MouseEvent
e
)
{
try
{
BrowserLoader
.
openWebpage
(
new
URL
(
SOURCE_URL
));
}
catch
(
MalformedURLException
e1
)
{}
}
});
wrapper
.
add
(
sourceURLLabel
);
getContentPane
().
add
(
wrapper
);
pack
();
}
public
static
void
show
(
JFrame
parent
)
{
instance
=
new
LicenseDialog
(
parent
);
if
(
instance
==
null
)
{
}
instance
.
setVisible
(
true
);
}
}
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/
Browser
Loader.java
→
ETC-UI/src/main/java/org/cnrs/lam/dis/etc/ui/swing/help/
Utils
Loader.java
View file @
ee753674
package
org.cnrs.lam.dis.etc.ui.swing.help
;