# HG changeset patch # User nolith # Date 1181917335 -7200 # Branch trunk # Node ID 4581103ec2ba103796c10c7decff5c92e9062207 # Parent 5f24ee46836c925571045892bd9958b2310c8bd6 [svn] Added windows deployment (does not work :( ) Now you can generate fatjar that works on each platform Platform L&F Added About windows Some general L&F improvement You can use keyboard for confirm end escape in DialogPassword Menu->check file now works Preferences->browse enabled Ant file has now a customization file for environmnet specific settings diff -r 5f24ee46836c925571045892bd9958b2310c8bd6 -r 4581103ec2ba103796c10c7decff5c92e9062207 ant/launch4j.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ant/launch4j.xml Fri Jun 15 16:22:15 2007 +0200 @@ -0,0 +1,17 @@ + + 0 + PortableNotary + + + true + false + + + + 1.5.0 + + 0 + 0 + + + \ No newline at end of file diff -r 5f24ee46836c925571045892bd9958b2310c8bd6 -r 4581103ec2ba103796c10c7decff5c92e9062207 ant/one-jar-ant-task.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ant/one-jar-ant-task.xml Fri Jun 15 16:22:15 2007 +0200 @@ -0,0 +1,19 @@ + + + + +
+ + +
+ + + +
+ + Now you can run the Hello One-JAR example using + $ java -jar hello.jar + + +
+
\ No newline at end of file diff -r 5f24ee46836c925571045892bd9958b2310c8bd6 -r 4581103ec2ba103796c10c7decff5c92e9062207 ant/user_pref.xml.template --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ant/user_pref.xml.template Fri Jun 15 16:22:15 2007 +0200 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 5f24ee46836c925571045892bd9958b2310c8bd6 -r 4581103ec2ba103796c10c7decff5c92e9062207 build.xml --- a/build.xml Fri Jun 15 09:37:18 2007 +0200 +++ b/build.xml Fri Jun 15 16:22:15 2007 +0200 @@ -3,16 +3,17 @@ - - - - - - - - - - + + + + @@ -22,12 +23,12 @@ - + - + - + @@ -98,7 +99,7 @@ @@ -115,7 +116,7 @@ - + @@ -133,13 +134,18 @@ - - - - - - - + + + + + + + + + + + + + + + + diff -r 5f24ee46836c925571045892bd9958b2310c8bd6 -r 4581103ec2ba103796c10c7decff5c92e9062207 src/org/abisso/PortableNotary/GUI/About.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/abisso/PortableNotary/GUI/About.java Fri Jun 15 16:22:15 2007 +0200 @@ -0,0 +1,112 @@ +/** + PortableNotary - About.java + Copyright 2007 Alessio Caiazza + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ +package org.abisso.PortableNotary.GUI; + +import java.awt.BorderLayout; +import javax.swing.JPanel; +import javax.swing.JFrame; +import javax.swing.JTextPane; +import javax.swing.JLabel; + +import org.abisso.PortableNotary.Messages; +import org.abisso.PortableNotary.PortableNotary; +import javax.swing.WindowConstants; + +/** + * @author nolith + * + */ +public class About extends JFrame { + + private static final long serialVersionUID = 1L; + + private JPanel jContentPane = null; + + private JTextPane body = null; + + private JLabel copyright = null; + + /** + * This is the default constructor + */ + public About() { + super(); + initialize(); + } + + /** + * This method initializes this + * + * @return void + */ + private void initialize() { + this.setSize(481, 292); + this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + this.setContentPane(getJContentPane()); + this.setTitle("About"); + } + + /** + * This method initializes jContentPane + * + * @return javax.swing.JPanel + */ + private JPanel getJContentPane() { + if (jContentPane == null) { + copyright = new JLabel(); + copyright.setText("(c) Alessio Caiazza "); + jContentPane = new JPanel(); + jContentPane.setLayout(new BorderLayout()); + jContentPane.add(getBody(), BorderLayout.CENTER); + jContentPane.add(copyright, BorderLayout.SOUTH); + } + return jContentPane; + } + + /** + * This method initializes body + * + * @return javax.swing.JTextPane + */ + private JTextPane getBody() { + if (body == null) { + body = new JTextPane(); + body.setContentType("text/html"); + body.setEditable(false); + String out = "\n

"; + out += "PortableNotary " + Messages.getString("PortableNotary.Version") + + " " + PortableNotary.VERSION + + " © Alessio Caiazza " + + "nolith@abisso.org
" ; + out+= Messages.getString("PortableNotary.MyLicense") + "
"; //$NON-NLS-1$ + out+= Messages.getString("PortableNotary.LibraryList"); //$NON-NLS-1$ + out += "

\nsee you space cowboy..."; //$NON-NLS-1$ + body.setText(out + "\n"); + } + return body; + } + +} // @jve:decl-index=0:visual-constraint="10,10" diff -r 5f24ee46836c925571045892bd9958b2310c8bd6 -r 4581103ec2ba103796c10c7decff5c92e9062207 src/org/abisso/PortableNotary/GUI/ImagePanel.java --- a/src/org/abisso/PortableNotary/GUI/ImagePanel.java Fri Jun 15 09:37:18 2007 +0200 +++ b/src/org/abisso/PortableNotary/GUI/ImagePanel.java Fri Jun 15 16:22:15 2007 +0200 @@ -20,8 +20,9 @@ import java.awt.Graphics; import java.awt.Image; import java.awt.MediaTracker; -import java.awt.Toolkit; +import java.net.URL; +import javax.swing.ImageIcon; import javax.swing.JPanel; public class ImagePanel extends JPanel @@ -33,7 +34,10 @@ public ImagePanel(String path) { - image = Toolkit.getDefaultToolkit().getImage(path); + URL imgURL = ImagePanel.class.getResource(path); + + image = new ImageIcon(imgURL).getImage(); + //image = Toolkit.getDefaultToolkit().getImage(path); MediaTracker tracker = new MediaTracker(this); tracker.addImage(image, 0); try diff -r 5f24ee46836c925571045892bd9958b2310c8bd6 -r 4581103ec2ba103796c10c7decff5c92e9062207 src/org/abisso/PortableNotary/GUI/MainFrame.java --- a/src/org/abisso/PortableNotary/GUI/MainFrame.java Fri Jun 15 09:37:18 2007 +0200 +++ b/src/org/abisso/PortableNotary/GUI/MainFrame.java Fri Jun 15 16:22:15 2007 +0200 @@ -20,12 +20,14 @@ import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.File; +import javax.swing.JFileChooser; import javax.swing.JFrame; +import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; -import javax.swing.JOptionPane; import javax.swing.JPanel; import net.iharder.dnd.FileDrop; @@ -43,6 +45,7 @@ private JMenu file = null; private JMenuItem checkFile = null; private JMenuItem exit = null; + private JMenuItem about = null; private JMenu option = null; private JMenuItem preferences = null; @@ -78,25 +81,7 @@ new FileDrop( getImage(), new FileDrop.Listener(){ public void filesDropped( java.io.File[] files ) { - MyFrameWithConsole sign; - - //check if password is stored - String password = pref.getKeystore_pass(); - System.out.println(password); - if ( password.equals("") ) { - password = PasswordDialog.askPassword(null); - } - System.out.println(password); - for( int i=0; i

Development Mode

" + + "

Drag file HERE

"+"")); + } } return Image; } + /** + * @param files + */ + private void check(java.io.File[] files) { + MyFrameWithConsole sign; + + //check if password is stored + String password = pref.getKeystore_pass(); + if ( password.equals("") ) { + password = PasswordDialog.askPassword(MainFrame.this); + } + for( int i=0; i" + "WARNING:" + + " " + "Password are stored in unsafe way" + ""); + warning.setFont(new Font("Dialog", Font.PLAIN, 14)); jContentPane = new JPanel(); jContentPane.setLayout(new GridBagLayout()); jContentPane.add(warning, gridBagConstraints); @@ -162,8 +168,18 @@ private JButton getBrowse() { if (browse == null) { browse = new JButton("Browse"); - //TODO: implement keystore browsing - browse.setEnabled(false); + browse.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent e) { + JFileChooser fc = new JFileChooser(); + fc.setDialogType(JFileChooser.OPEN_DIALOG); + int returnVal = fc.showOpenDialog(PreferencesDialog.this); + + if (returnVal == JFileChooser.APPROVE_OPTION) { + File file = fc.getSelectedFile(); + getTextPath().setText(file.getAbsolutePath()); + } + } + }); } return browse; } @@ -203,4 +219,4 @@ } return cancel; } -} +} // @jve:decl-index=0:visual-constraint="10,10" diff -r 5f24ee46836c925571045892bd9958b2310c8bd6 -r 4581103ec2ba103796c10c7decff5c92e9062207 src/org/abisso/PortableNotary/PortableNotary.java --- a/src/org/abisso/PortableNotary/PortableNotary.java Fri Jun 15 09:37:18 2007 +0200 +++ b/src/org/abisso/PortableNotary/PortableNotary.java Fri Jun 15 16:22:15 2007 +0200 @@ -16,6 +16,9 @@ package org.abisso.PortableNotary; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + import org.abisso.PortableNotary.GUI.MainFrame; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; @@ -120,6 +123,24 @@ } if (!line.hasOption("t")) { + try { + // Set System L&F + UIManager.setLookAndFeel( + UIManager.getSystemLookAndFeelClassName()); + } + catch (UnsupportedLookAndFeelException e) { + // handle exception + } + catch (ClassNotFoundException e) { + // handle exception + } + catch (InstantiationException e) { + // handle exception + } + catch (IllegalAccessException e) { + // handle exception + } + MainFrame win = new MainFrame(); win.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); win.setDefaultLookAndFeelDecorated(true); @@ -164,4 +185,5 @@ usage.printHelp("PortableNotary [opts] filename",options); //$NON-NLS-1$ } + }