| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -792,7 +792,7 @@ protected boolean exportApplication() throws IOException, SketchException { | |||
| 792 | 792 | boolean embedJava = (platform == PApplet.platform) && | |
| 793 | 793 | Preferences.getBoolean("export.application.embed_java"); | |
| 794 | 794 | ||
| 795 | - if (Preferences.getBoolean("export.application.platform." + platformName)) { | ||
| 795 | + if (Preferences.getBoolean(JavaEditor.EXPORT_PREFIX + platformName)) { | ||
| 796 | 796 | if (Library.hasMultipleArch(platform, importedLibraries)) { | |
| 797 | 797 | // export the 32-bit version | |
| 798 | 798 | folder = new File(sketch.getFolder(), "application." + platformName + "32"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -676,8 +676,26 @@ public void handleExportApplication() { | |||
| 676 | 676 | } | |
| 677 | 677 | ||
| 678 | 678 | ||
| 679 | - // JPanel presentColorPanel; | ||
| 680 | - // JTextField presentColorPanel; | ||
| 679 | + // Can't be .windows because that'll be stripped off as a per-platform pref | ||
| 680 | + static final String EXPORT_PREFIX = "export.application.platform_"; | ||
| 681 | + static final String EXPORT_MACOSX = EXPORT_PREFIX + "macosx"; | ||
| 682 | + static final String EXPORT_WINDOWS = EXPORT_PREFIX + "windows"; | ||
| 683 | + static final String EXPORT_LINUX = EXPORT_PREFIX + "linux"; | ||
| 684 | + | ||
| 685 | + final JButton exportButton = new JButton(Language.text("prompt.export")); | ||
| 686 | + final JButton cancelButton = new JButton(Language.text("prompt.cancel")); | ||
| 687 | + | ||
| 688 | + final JCheckBox windowsButton = new JCheckBox("Windows"); | ||
| 689 | + final JCheckBox macosxButton = new JCheckBox("Mac OS X"); | ||
| 690 | + final JCheckBox linuxButton = new JCheckBox("Linux"); | ||
| 691 | + | ||
| 692 | + | ||
| 693 | + protected void updateExportButton() { | ||
| 694 | + exportButton.setEnabled(windowsButton.isSelected() || | ||
| 695 | + macosxButton.isSelected() || | ||
| 696 | + linuxButton.isSelected()); | ||
| 697 | + } | ||
| 698 | + | ||
| 681 | 699 | ||
| 682 | 700 | protected boolean exportApplicationPrompt() throws IOException, SketchException { | |
| 683 | 701 | JPanel panel = new JPanel(); | |
@@ -704,41 +722,45 @@ protected boolean exportApplicationPrompt() throws IOException, SketchException | |||
| 704 | 722 | // label2.getPreferredSize().width); | |
| 705 | 723 | panel.add(Box.createVerticalStrut(12)); | |
| 706 | 724 | ||
| 707 | - final JCheckBox windowsButton = new JCheckBox("Windows"); | ||
| 708 | - //windowsButton.setMnemonic(KeyEvent.VK_W); | ||
| 709 | - windowsButton.setSelected(Preferences.getBoolean("export.application.platform.windows")); | ||
| 725 | + // final JCheckBox windowsButton = new JCheckBox("Windows"); | ||
| 726 | + // final JCheckBox macosxButton = new JCheckBox("Mac OS X"); | ||
| 727 | + // final JCheckBox linuxButton = new JCheckBox("Linux"); | ||
| 728 | + | ||
| 729 | + windowsButton.setSelected(Preferences.getBoolean(EXPORT_WINDOWS)); | ||
| 710 | 730 | windowsButton.addItemListener(new ItemListener() { | |
| 711 | 731 | public void itemStateChanged(ItemEvent e) { | |
| 712 | - Preferences.setBoolean("export.application.platform.windows", windowsButton.isSelected()); | ||
| 732 | + Preferences.setBoolean(EXPORT_WINDOWS, windowsButton.isSelected()); | ||
| 733 | + updateExportButton(); | ||
| 713 | 734 | } | |
| 714 | 735 | }); | |
| 715 | 736 | ||
| 716 | 737 | // Only possible to export OS X applications on OS X | |
| 717 | 738 | if (!Base.isMacOS()) { | |
| 718 | 739 | // Make sure they don't have a previous 'true' setting for this | |
| 719 | - Preferences.setBoolean("export.application.platform.macosx", false); | ||
| 740 | + Preferences.setBoolean(EXPORT_MACOSX, false); | ||
| 720 | 741 | } | |
| 721 | - final JCheckBox macosxButton = new JCheckBox("Mac OS X"); | ||
| 722 | - macosxButton.setSelected(Preferences.getBoolean("export.application.platform.macosx")); | ||
| 742 | + macosxButton.setSelected(Preferences.getBoolean(EXPORT_MACOSX)); | ||
| 723 | 743 | macosxButton.addItemListener(new ItemListener() { | |
| 724 | 744 | public void itemStateChanged(ItemEvent e) { | |
| 725 | - Preferences.setBoolean("export.application.platform.macosx", macosxButton.isSelected()); | ||
| 745 | + Preferences.setBoolean(EXPORT_MACOSX, macosxButton.isSelected()); | ||
| 746 | + updateExportButton(); | ||
| 726 | 747 | } | |
| 727 | 748 | }); | |
| 728 | 749 | if (!Base.isMacOS()) { | |
| 729 | 750 | macosxButton.setEnabled(false); | |
| 730 | 751 | macosxButton.setToolTipText(Language.text("export.tooltip.macosx")); | |
| 731 | 752 | } | |
| 732 | 753 | ||
| 733 | - final JCheckBox linuxButton = new JCheckBox("Linux"); | ||
| 734 | - //linuxButton.setMnemonic(KeyEvent.VK_L); | ||
| 735 | - linuxButton.setSelected(Preferences.getBoolean("export.application.platform.linux")); | ||
| 754 | + linuxButton.setSelected(Preferences.getBoolean(EXPORT_LINUX)); | ||
| 736 | 755 | linuxButton.addItemListener(new ItemListener() { | |
| 737 | 756 | public void itemStateChanged(ItemEvent e) { | |
| 738 | - Preferences.setBoolean("export.application.platform.linux", linuxButton.isSelected()); | ||
| 757 | + Preferences.setBoolean(EXPORT_LINUX, linuxButton.isSelected()); | ||
| 758 | + updateExportButton(); | ||
| 739 | 759 | } | |
| 740 | 760 | }); | |
| 741 | 761 | ||
| 762 | + updateExportButton(); // do the initial enable/disable based on prefs.txt | ||
| 763 | + | ||
| 742 | 764 | JPanel platformPanel = new JPanel(); | |
| 743 | 765 | //platformPanel.setLayout(new BoxLayout(platformPanel, BoxLayout.X_AXIS)); | |
| 744 | 766 | platformPanel.add(windowsButton); | |
@@ -953,26 +975,34 @@ public void mousePressed(MouseEvent event) { | |||
| 953 | 975 | ||
| 954 | 976 | panel.add(signPanel); | |
| 955 | 977 | } | |
| 956 | - //System.out.println(panel.getPreferredSize()); | ||
| 957 | - // panel.setMinimumSize(new Dimension(316, 461)); | ||
| 958 | - // panel.setPreferredSize(new Dimension(316, 461)); | ||
| 959 | - // panel.setMaximumSize(new Dimension(316, 461)); | ||
| 960 | 978 | ||
| 961 | 979 | // | |
| 962 | 980 | ||
| 963 | - String[] options = { Language.text("prompt.export"), Language.text("prompt.cancel") }; | ||
| 981 | + //String[] options = { Language.text("prompt.export"), Language.text("prompt.cancel") }; | ||
| 982 | + final JButton[] options = { exportButton, cancelButton }; | ||
| 964 | 983 | ||
| 965 | 984 | final JOptionPane optionPane = new JOptionPane(panel, | |
| 966 | 985 | JOptionPane.PLAIN_MESSAGE, | |
| 967 | 986 | JOptionPane.YES_NO_OPTION, | |
| 968 | 987 | null, | |
| 969 | 988 | options, | |
| 970 | - options[0]); | ||
| 989 | + exportButton); //options[0]); | ||
| 971 | 990 | ||
| 972 | 991 | ||
| 973 | 992 | final JDialog dialog = new JDialog(this, Language.text("export"), true); | |
| 974 | 993 | dialog.setContentPane(optionPane); | |
| 975 | - // System.out.println(optionPane.getLayout()); | ||
| 994 | + | ||
| 995 | + exportButton.addActionListener(new ActionListener() { | ||
| 996 | + public void actionPerformed(ActionEvent e) { | ||
| 997 | + optionPane.setValue(exportButton); | ||
| 998 | + } | ||
| 999 | + }); | ||
| 1000 | + | ||
| 1001 | + cancelButton.addActionListener(new ActionListener() { | ||
| 1002 | + public void actionPerformed(ActionEvent e) { | ||
| 1003 | + optionPane.setValue(cancelButton); | ||
| 1004 | + } | ||
| 1005 | + }); | ||
| 976 | 1006 | ||
| 977 | 1007 | optionPane.addPropertyChangeListener(new PropertyChangeListener() { | |
| 978 | 1008 | public void propertyChange(PropertyChangeEvent e) { | |
@@ -998,52 +1028,16 @@ public void propertyChange(PropertyChangeEvent e) { | |||
| 998 | 1028 | bounds.y + (bounds.height - dialog.getSize().height) / 2); | |
| 999 | 1029 | dialog.setVisible(true); | |
| 1000 | 1030 | ||
| 1001 | - //System.out.println(panel.getSize()); | ||
| 1002 | - | ||
| 1003 | 1031 | Object value = optionPane.getValue(); | |
| 1004 | - if (value.equals(options[0])) { | ||
| 1032 | + if (value.equals(exportButton)) { | ||
| 1005 | 1033 | return jmode.handleExportApplication(sketch); | |
| 1006 | - } else if (value.equals(options[1]) || value.equals(Integer.valueOf(-1))) { | ||
| 1034 | + } else if (value.equals(cancelButton) || value.equals(Integer.valueOf(-1))) { | ||
| 1007 | 1035 | // closed window by hitting Cancel or ESC | |
| 1008 | 1036 | statusNotice(Language.text("export.notice.exporting.cancel")); | |
| 1009 | 1037 | } | |
| 1010 | 1038 | return false; | |
| 1011 | 1039 | } | |
| 1012 | 1040 | ||
| 1013 | - /* | ||
| 1014 | - Color bgcolor = Preferences.getColor("run.present.bgcolor"); | ||
| 1015 | - final ColorChooser c = new ColorChooser(JavaEditor.this, true, bgcolor, | ||
| 1016 | - "Select", new ActionListener() { | ||
| 1017 | - | ||
| 1018 | - @Override | ||
| 1019 | - public void actionPerformed(ActionEvent e) { | ||
| 1020 | - Preferences.setColor("run.present.bgcolor", c.getColor()); | ||
| 1021 | - } | ||
| 1022 | - }); | ||
| 1023 | - */ | ||
| 1024 | - | ||
| 1025 | - /* | ||
| 1026 | - class ColorListener implements ActionListener { | ||
| 1027 | - ColorChooser chooser; | ||
| 1028 | - String prefName; | ||
| 1029 | - | ||
| 1030 | - public ColorListener(String prefName) { | ||
| 1031 | - this.prefName = prefName; | ||
| 1032 | - Color color = Preferences.getColor(prefName); | ||
| 1033 | - chooser = new ColorChooser(JavaEditor.this, true, color, "Select", this); | ||
| 1034 | - chooser.show(); | ||
| 1035 | - } | ||
| 1036 | - | ||
| 1037 | - @Override | ||
| 1038 | - public void actionPerformed(ActionEvent e) { | ||
| 1039 | - Color color = chooser.getColor(); | ||
| 1040 | - Preferences.setColor(prefName, color); | ||
| 1041 | - // presentColorPanel.setBackground(color); | ||
| 1042 | - presentColorPanel.repaint(); | ||
| 1043 | - chooser.hide(); | ||
| 1044 | - } | ||
| 1045 | - } | ||
| 1046 | - */ | ||
| 1047 | 1041 | ||
| 1048 | 1042 | class ColorPreference extends JPanel implements ActionListener { | |
| 1049 | 1043 | ColorChooser chooser; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,22 +3,34 @@ X make download-jdk-macosx target work properly | |||
| 3 | 3 | X remove "pair is" debug messages | |
| 4 | 4 | X create sketchbook subfolders on startup | |
| 5 | 5 | X https://github.com/processing/processing/issues/3548 | |
| 6 | + X save export settings to preferences | ||
| 7 | + X disable Export button when no platforms selected | ||
| 8 | + _ export allowed with untitled sketches | ||
| 9 | + _ also with examples? | ||
| 6 | 10 | ||
| 7 | 11 | ||
| 8 | - _ if no platforms selected in export, will still say "done exporting!" | ||
| 9 | - _ maybe if none selected, should default select the current platform | ||
| 10 | - _ why are none selected in the first place? not getting saved? | ||
| 12 | + earlier/cleaning | ||
| 13 | + X CM ongoing notes and questions | ||
| 14 | + X https://github.com/processing/processing/issues/3440 | ||
| 15 | + X Contribution Manager design is really rough | ||
| 16 | + X https://github.com/processing/processing/issues/3464 | ||
| 11 | 17 | ||
| 12 | 18 | ||
| 13 | - 3.0 final | ||
| 19 | + known issues | ||
| 14 | 20 | _ launch4j doesn't work from folders with non-native charsets | |
| 15 | 21 | _ anything in CP1252 on an English Windows system is fine | |
| 16 | 22 | _ but anything else reports "font sadness" b/c it's using the system JRE | |
| 17 | 23 | _ https://github.com/processing/processing/issues/3543 | |
| 18 | - _ CM ongoing notes and questions | ||
| 19 | - _ https://github.com/processing/processing/issues/3440 | ||
| 20 | - _ Contribution Manager design is really rough | ||
| 21 | - _ https://github.com/processing/processing/issues/3464 | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + _ if no platforms selected in export, will still say "done exporting!" | ||
| 27 | + _ maybe if none selected, should default select the current platform | ||
| 28 | + _ why are none selected in the first place? not getting saved? | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + 3.0 final | ||
| 32 | + _ Contributions Manager UI design | ||
| 33 | + _ https://github.com/processing/processing/issues/3482 | ||
| 22 | 34 | _ Ready to add contributed example packages? | |
| 23 | 35 | _ https://github.com/processing/processing/issues/2953 | |
| 24 | 36 | _ processing-java isn't working in OSX 10.11 El Capitan | |
| Back | FazBrowse Home | New Git URL |
0 commit comments