/**
*
*/
package com.tilusnet.josm.plugins.alignways;
import static org.openstreetmap.josm.tools.I18n.tr;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
* @author tilusnet <tilusnet@gmail.com>
*
*/
public class AlignWaysWhatsNewPanel extends JPanel {
private static final long serialVersionUID = 3691600157957492583L;
public AlignWaysWhatsNewPanel() {
initComponents();
}
/*** WARNING: The following code section is generated by/for Matisse. Do not modify! ***/
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
lblWhatsNew = new javax.swing.JLabel();
icnLogo = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
newItem1 = new javax.swing.JLabel();
btnHelpItem1 = new javax.swing.JButton();
newItem2 = new javax.swing.JLabel();
lblWhatsNew.setText("<html><div style=\"font-family: sans-serif; font-weight: bold; font-style: italic;\"><span style=\"font-size: large;\"><span style=\"font-size: x-large;\">"
+ tr("What''s new...")
+ "</span></div></html>");
icnLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/wndialog/alignways64.png"))); // NOI18N
newItem1.setText("<html><div style=\"font-family: sans-serif;\"><ul style=\"margin-left: 20px;\"><li>"
+ tr("Added <b>angle preserving</b> aligning mode")
+ "</li></ul></div></html>");
btnHelpItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/wndialog/extlink10.png"))); // NOI18N
btnHelpItem1.setText("More Info");
btnHelpItem1.setToolTipText("Preserving angle aligning");
btnHelpItem1.setBorder(null);
btnHelpItem1.setBorderPainted(false);
btnHelpItem1.setFocusPainted(false);
btnHelpItem1.setFocusable(false);
btnHelpItem1.setIconTextGap(6);
btnHelpItem1.setOpaque(false);
btnHelpItem1.setPreferredSize(new java.awt.Dimension(69, 25));
btnHelpItem1.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnHelpItem1ActionPerformed(evt);
}
});
newItem2.setText("<html><div style=\"font-family: sans-serif;\"><ul style=\"margin-left: 20px;\"><li>"
+ tr("Various improvements and bugfixes")
+ "</li></ul></div></html>");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(lblWhatsNew, javax.swing.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(icnLogo))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(newItem2, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(newItem1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btnHelpItem1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(icnLogo)
.addComponent(lblWhatsNew, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(20, 20, 20)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(newItem1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnHelpItem1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(newItem2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(23, Short.MAX_VALUE))
);
}// </editor-fold>
private void btnHelpItem1ActionPerformed(java.awt.event.ActionEvent evt) {
openURI();
}
// Variables declaration - do not modify
private javax.swing.JButton btnHelpItem1;
private javax.swing.JLabel icnLogo;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JLabel lblWhatsNew;
private javax.swing.JLabel newItem1;
private javax.swing.JLabel newItem2;
// End of variables declaration
private void openURI() {
if (Desktop.isDesktopSupported()) {
try {
URI uri = new URI("http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AlignWayS#Preserving_angles");
Desktop.getDesktop().browse(uri);
} catch (URISyntaxException ex) {
Logger.getLogger(AlignWaysWhatsNewPanel.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException e) {
JOptionPane.showMessageDialog(this, e, tr("Errr..."), JOptionPane.WARNING_MESSAGE);
}
} else {
JOptionPane.showMessageDialog(this, tr("Browser not supported."), tr("Errr..."), JOptionPane.WARNING_MESSAGE);
}
}
/*** End of Matisse generated code section ***/
}