X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fthreedee%2FLineDialog.java;fp=tim%2Fprune%2Fthreedee%2FLineDialog.java;h=0000000000000000000000000000000000000000;hb=7f5ed2be62905bd37717376dc22d09e5ea7edb4d;hp=e371bd0429105ac502d1d0a46f14a3d72e715f35;hpb=b361869e590bbca32664c16ac24d6296926594a5;p=GpsPrune.git diff --git a/tim/prune/threedee/LineDialog.java b/tim/prune/threedee/LineDialog.java deleted file mode 100644 index e371bd0..0000000 --- a/tim/prune/threedee/LineDialog.java +++ /dev/null @@ -1,113 +0,0 @@ -package tim.prune.threedee; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JEditorPane; -import javax.swing.JFrame; -import javax.swing.JPanel; - -import tim.prune.I18nManager; -import tim.prune.data.Latitude; -import tim.prune.data.Longitude; - -/** - * Class to show a dialog displaying the line coordinates - * for a 3d view (either java3d or povray) - */ -public class LineDialog -{ - private JDialog _dialog = null; - private JFrame _parent = null; - private double[] _latLines = null; - private double[] _lonLines = null; - - - /** - * Constructor giving parent frame, latitude and longitude lines - * @param inParent parent frame for dialog - * @param inLatLines latitude lines as doubles - * @param inLonLines longitude lines as doubles - */ - public LineDialog(JFrame inParent, double[] inLatLines, double[] inLonLines) - { - _parent = inParent; - _latLines = inLatLines; - _lonLines = inLonLines; - } - - - /** - * Show the dialog with the lines - */ - public void showDialog() - { - _dialog = new JDialog(_parent, I18nManager.getText("dialog.3dlines.title"), true); - _dialog.setLocationRelativeTo(_parent); - _dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - _dialog.getContentPane().add(makeDialogComponents()); - _dialog.pack(); - _dialog.setVisible(true); - } - - - /** - * @return dialog components - */ - private JPanel makeDialogComponents() - { - JPanel panel = new JPanel(); - panel.setLayout(new BorderLayout()); - StringBuffer descBuffer = new StringBuffer(); - final int numLatLines = (_latLines == null?0:_latLines.length); - final int numLonLines = (_lonLines == null?0:_lonLines.length); - if (numLatLines == 0 && numLonLines == 0) - { - descBuffer.append("

").append(I18nManager.getText("dialog.3dlines.empty")).append("

"); - } - else - { - descBuffer.append("

").append(I18nManager.getText("dialog.3dlines.intro")).append(":

"); - descBuffer.append("

").append(I18nManager.getText("fieldname.latitude")).append("

"); - descBuffer.append("

").append(I18nManager.getText("fieldname.longitude")).append("

"); - } - JEditorPane descPane = new JEditorPane("text/html", descBuffer.toString()); - descPane.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); - descPane.setEditable(false); - descPane.setOpaque(false); - panel.add(descPane, BorderLayout.CENTER); - // ok button - JPanel buttonPanel = new JPanel(); - buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); - JButton okButton = new JButton(I18nManager.getText("button.ok")); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) - { - _dialog.dispose(); - _dialog = null; - } - }); - buttonPanel.add(okButton); - panel.add(buttonPanel, BorderLayout.SOUTH); - return panel; - } -}