mirror of
https://github.com/processing/processing4.git
synced 2026-02-16 20:05:36 +01:00
removing cross-platform export
This commit is contained in:
@@ -257,27 +257,19 @@ public class JavaEditor extends Editor {
|
||||
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
|
||||
panel.add(Box.createVerticalStrut(6));
|
||||
|
||||
//Box panel = Box.createVerticalBox();
|
||||
|
||||
//Box labelBox = Box.createHorizontalBox();
|
||||
// String msg = "<html>Click Export to Application to create a standalone, " +
|
||||
// "double-clickable application for the selected plaforms.";
|
||||
|
||||
// String msg = "Export to Application creates a standalone, \n" +
|
||||
// "double-clickable application for the selected plaforms.";
|
||||
String line1 = "Export to Application creates double-clickable,";
|
||||
String line2 = "standalone applications for the selected plaforms.";
|
||||
//String line2 = "standalone applications for the selected plaforms.";
|
||||
String line2 = "standalone application for the current plaform.";
|
||||
JLabel label1 = new JLabel(line1, SwingConstants.CENTER);
|
||||
JLabel label2 = new JLabel(line2, SwingConstants.CENTER);
|
||||
label1.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
label2.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
// label1.setAlignmentX();
|
||||
// label2.setAlignmentX(0);
|
||||
panel.add(label1);
|
||||
panel.add(label2);
|
||||
int wide = label2.getPreferredSize().width;
|
||||
int wide = label1.getPreferredSize().width;
|
||||
panel.add(Box.createVerticalStrut(12));
|
||||
|
||||
/*
|
||||
final JCheckBox windowsButton = new JCheckBox("Windows");
|
||||
//windowsButton.setMnemonic(KeyEvent.VK_W);
|
||||
windowsButton.setSelected(Preferences.getBoolean("export.application.platform.windows"));
|
||||
@@ -318,11 +310,9 @@ public class JavaEditor extends Editor {
|
||||
wide = Math.max(wide, platformPanel.getPreferredSize().width);
|
||||
platformPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
panel.add(platformPanel);
|
||||
*/
|
||||
|
||||
// Box indentPanel = Box.createHorizontalBox();
|
||||
// indentPanel.add(Box.createHorizontalStrut(new JCheckBox().getPreferredSize().width));
|
||||
final JCheckBox showStopButton = new JCheckBox("Show a Stop button");
|
||||
//showStopButton.setMnemonic(KeyEvent.VK_S);
|
||||
showStopButton.setSelected(Preferences.getBoolean("export.application.stop"));
|
||||
showStopButton.addItemListener(new ItemListener() {
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
@@ -331,11 +321,8 @@ public class JavaEditor extends Editor {
|
||||
});
|
||||
showStopButton.setEnabled(Preferences.getBoolean("export.application.fullscreen"));
|
||||
showStopButton.setBorder(new EmptyBorder(3, 13, 6, 13));
|
||||
// indentPanel.add(showStopButton);
|
||||
// indentPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
|
||||
final JCheckBox fullScreenButton = new JCheckBox("Full Screen (Present mode)");
|
||||
//fullscreenButton.setMnemonic(KeyEvent.VK_F);
|
||||
fullScreenButton.setSelected(Preferences.getBoolean("export.application.fullscreen"));
|
||||
fullScreenButton.addItemListener(new ItemListener() {
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
@@ -350,12 +337,9 @@ public class JavaEditor extends Editor {
|
||||
optionPanel.setLayout(new BoxLayout(optionPanel, BoxLayout.Y_AXIS));
|
||||
optionPanel.add(fullScreenButton);
|
||||
optionPanel.add(showStopButton);
|
||||
// optionPanel.add(indentPanel);
|
||||
optionPanel.setBorder(new TitledBorder("Options"));
|
||||
wide = Math.max(wide, platformPanel.getPreferredSize().width);
|
||||
//goodIdea = new Dimension(wide, optionPanel.getPreferredSize().height);
|
||||
// wide = Math.max(wide, platformPanel.getPreferredSize().width);
|
||||
optionPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
//optionPanel.setMaximumSize(goodIdea);
|
||||
panel.add(optionPanel);
|
||||
|
||||
Dimension good;
|
||||
@@ -364,43 +348,20 @@ public class JavaEditor extends Editor {
|
||||
label1.setMaximumSize(good);
|
||||
good = new Dimension(wide, label2.getPreferredSize().height);
|
||||
label2.setMaximumSize(good);
|
||||
good = new Dimension(wide, platformPanel.getPreferredSize().height);
|
||||
platformPanel.setMaximumSize(good);
|
||||
// good = new Dimension(wide, platformPanel.getPreferredSize().height);
|
||||
// platformPanel.setMaximumSize(good);
|
||||
good = new Dimension(wide, optionPanel.getPreferredSize().height);
|
||||
optionPanel.setMaximumSize(good);
|
||||
|
||||
// JPanel actionPanel = new JPanel();
|
||||
// optionPanel.setLayout(new BoxLayout(optionPanel, BoxLayout.X_AXIS));
|
||||
// optionPanel.add(Box.createHorizontalGlue());
|
||||
|
||||
// final JDialog frame = new JDialog(editor, "Export to Application");
|
||||
|
||||
// JButton cancelButton = new JButton("Cancel");
|
||||
// cancelButton.addActionListener(new ActionListener() {
|
||||
// public void actionPerformed(ActionEvent e) {
|
||||
// frame.dispose();
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
// Add the buttons in platform-specific order
|
||||
// if (PApplet.platform == PConstants.MACOSX) {
|
||||
// optionPanel.add(cancelButton);
|
||||
// optionPanel.add(exportButton);
|
||||
// } else {
|
||||
// optionPanel.add(exportButton);
|
||||
// optionPanel.add(cancelButton);
|
||||
// }
|
||||
String[] options = { "Export", "Cancel" };
|
||||
final JOptionPane optionPane = new JOptionPane(panel,
|
||||
JOptionPane.PLAIN_MESSAGE,
|
||||
//JOptionPane.QUESTION_MESSAGE,
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
null,
|
||||
options,
|
||||
options[0]);
|
||||
|
||||
final JDialog dialog = new JDialog(this, "Export Options", true);
|
||||
final JDialog dialog = new JDialog(this, "Export Application", true);
|
||||
dialog.setContentPane(optionPane);
|
||||
|
||||
optionPane.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
@@ -410,9 +371,8 @@ public class JavaEditor extends Editor {
|
||||
if (dialog.isVisible() &&
|
||||
(e.getSource() == optionPane) &&
|
||||
(prop.equals(JOptionPane.VALUE_PROPERTY))) {
|
||||
//If you were going to check something
|
||||
//before closing the window, you'd do
|
||||
//it here.
|
||||
// If you were going to check something before
|
||||
// closing the window, you'd do it here.
|
||||
dialog.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user