From b20be922e0647f01a7cb8f54da8c35899d8a629c Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 6 Jun 2015 21:28:57 -0400 Subject: [PATCH] other removals, clean up todo items --- core/todo.txt | 14 +- java/.classpath | 2 +- .../mode/java/pdex/ErrorWindow.java | 370 ------------------ todo.txt | 7 + 4 files changed, 17 insertions(+), 376 deletions(-) delete mode 100644 java/src/processing/mode/java/pdex/ErrorWindow.java diff --git a/core/todo.txt b/core/todo.txt index 8106f297f..927018e33 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -43,8 +43,10 @@ X Errors in glsl code are only caught when set() is used X https://github.com/processing/processing/issues/2268 X move glsl entries to their own subdirectory + beta X fix up handling of fullScreen() +X https://github.com/processing/processing-docs/issues/250 X https://github.com/processing/processing/issues/3296 X right now using a (display ignoring) hack to displayWidth/Height X maybe we use the AWT screen sizes first, then match the others w/ em? @@ -59,20 +61,22 @@ X split 'present' and 'full screen'? X --full-screen causes considerable flicker at this point X or split them when sketchWidth/Height are implemented? _ smooth() and noSmooth() -_ can only be called inside setup(), show warning elsewhere -_ is lifted out of setup() and into settings() -_ goes before the first beginDraw() with createGraphics() -_ sketchQuality() needs to be rooted out _ https://github.com/processing/processing/issues/3357 _ https://github.com/processing/processing-docs/issues/251 +_ can only be called inside setup(), show warning elsewhere +_ is lifted out of setup() and into settings() +X goes before the first beginDraw() with createGraphics() +X sketchQuality() needs to be rooted out _ replace sketchXxxx() methods with another mechanism? _ and an internal dictionary that stores them all? _ intParam(), stringParam() and setParam()? _ or sketchInt() or settingsInt()? _ surface.size(), surface.noSmooth()... just like PGraphics methods? -X sketchXxxx() methods are final, need to move folks away from these +X sketchXxxx() methods +_ make final to move folks away from these? _ or is this a bad move until we've sorted out Android? + critical _ draw() executes twice when noLoop() called in setup() _ https://github.com/processing/processing/issues/3310 diff --git a/java/.classpath b/java/.classpath index c54fe36e4..839265b88 100644 --- a/java/.classpath +++ b/java/.classpath @@ -1,7 +1,7 @@ - + diff --git a/java/src/processing/mode/java/pdex/ErrorWindow.java b/java/src/processing/mode/java/pdex/ErrorWindow.java deleted file mode 100644 index a7656e1b6..000000000 --- a/java/src/processing/mode/java/pdex/ErrorWindow.java +++ /dev/null @@ -1,370 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* -Part of the Processing project - http://processing.org -Copyright (c) 2012-15 The Processing Foundation - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -package processing.mode.java.pdex; - -import java.awt.BorderLayout; -import java.awt.Frame; -import java.awt.event.ComponentEvent; -import java.awt.event.ComponentListener; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.WindowConstants; -import javax.swing.border.EmptyBorder; -import javax.swing.table.TableModel; - -import processing.app.Toolkit; -import processing.mode.java.JavaEditor; - - -/** - * Error Window that displays a tablular list of errors. Clicking on an error - * scrolls to its location in the code. - * - * @author Manindra Moharana <me@mkmoharana.com> - * - */ -public class ErrorWindow extends JFrame { - - private JPanel contentPane; - /** - * The table displaying the errors - */ - protected XQErrorTable errorTable; - /** - * Scroll pane that contains the Error Table - */ - protected JScrollPane scrollPane; - - //protected JavaEditor thisEditor; - protected JavaEditor editor; - private JFrame thisErrorWindow; - - /** - * Handles the sticky Problem window - */ - private DockTool2Base Docker; - - protected ErrorCheckerService errorCheckerService; - - /** - * Preps up ErrorWindow - * - * @param editor - * - Editor - * @param ecs - ErrorCheckerService - */ - public ErrorWindow(JavaEditor editor, ErrorCheckerService ecs) { - thisErrorWindow = this; - errorCheckerService = ecs; - this.editor = editor; - setTitle("Problems"); - prepareFrame(); - } - - - /** - * Sets up ErrorWindow - */ - protected void prepareFrame() { - Toolkit.setIcon(this); - setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); - // Default size: setBounds(100, 100, 458, 160); - setBounds(100, 100, 458, 160); // Yeah, I hardcode such things sometimes. Hate me. - - contentPane = new JPanel(); - contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); - setContentPane(contentPane); - contentPane.setLayout(new BorderLayout(0, 0)); - - scrollPane = new JScrollPane(); - contentPane.add(scrollPane); - - errorTable = new XQErrorTable(editor); - scrollPane.setViewportView(errorTable); - - try { - Docker = new DockTool2Base(); - addListeners(); - } catch (Exception e) { - System.out.println("addListeners() acted silly."); - e.printStackTrace(); - } - - if (editor != null) { - setLocation(editor.getLocation().x + editor.getWidth(), - editor.getLocation().y); - } - } - - - /** - * Updates the error table with new data(Table Model). Called from Error - * Checker Service. - * - * @param tableModel - * - Table Model - * @return True - If error table was updated successfully. - */ - synchronized public boolean updateTable(final TableModel tableModel) { - // XQErrorTable handles evrything now - return errorTable.updateTable(tableModel); - } - - /** - * Adds various listeners to components of EditorWindow and to the Editor - * window - */ - protected void addListeners() { - - if (thisErrorWindow == null) - System.out.println("ERW null"); - - thisErrorWindow.addComponentListener(new ComponentListener() { - - @Override - public void componentShown(ComponentEvent e) { - - } - - @Override - public void componentResized(ComponentEvent e) { - Docker.tryDocking(); - } - - @Override - public void componentMoved(ComponentEvent e) { - Docker.tryDocking(); - } - - @Override - public void componentHidden(ComponentEvent e) { - - } - }); - - thisErrorWindow.addWindowListener(new WindowAdapter() { - - @Override - public void windowClosing(WindowEvent e) { - // removing b/c this was the only use of problemWindowMenuCB [fry 150125] -// thisEditor.problemWindowMenuCB.setSelected(false); - } - - @Override - public void windowDeiconified(WindowEvent e) { - editor.setExtendedState(Frame.NORMAL); - } - - }); - - if (editor == null) { - System.out.println("Editor null"); - return; - } - - /*thisEditor.addWindowListener(new WindowAdapter() { - - @Override - public void windowClosing(WindowEvent e) { - - } - - @Override - public void windowClosed(WindowEvent e) { - errorCheckerService.pauseThread(); - errorCheckerService.stopThread(); // Bye bye thread. - thisErrorWindow.dispose(); - } - - @Override - public void windowIconified(WindowEvent e) { - thisErrorWindow.setExtendedState(Frame.ICONIFIED); - } - - @Override - public void windowDeiconified(WindowEvent e) { - thisErrorWindow.setExtendedState(Frame.NORMAL); - } - - });*/ - - editor.addComponentListener(new ComponentListener() { - - @Override - public void componentShown(ComponentEvent e) { - - } - - @Override - public void componentResized(ComponentEvent e) { - if (Docker.isDocked()) { - Docker.dock(); - } else { - Docker.tryDocking(); - } - } - - @Override - public void componentMoved(ComponentEvent e) { - - if (Docker.isDocked()) { - Docker.dock(); - } else { - Docker.tryDocking(); - } - - } - - @Override - public void componentHidden(ComponentEvent e) { - // System.out.println("ed hidden"); - } - }); - - } - - - /** - * Implements the docking feature of the tool - The frame sticks to the - * editor and once docked, moves along with it as the editor is resized, - * moved, or closed. - * - * This class has been borrowed from Tab Manager tool by Thomas Diewald. It - * has been slightly modified and used here. - * - * @author Thomas Diewald , http://thomasdiewald.com - */ - private class DockTool2Base { - - private int docking_border = 0; - private int dock_on_editor_y_offset_ = 0; - private int dock_on_editor_x_offset_ = 0; - - // /////////////////////////////// - // ____2____ - // | | - // | | - // 0 | editor | 1 - // | | - // |_________| - // 3 - // /////////////////////////////// - - // public void reset() { - // dock_on_editor_y_offset_ = 0; - // dock_on_editor_x_offset_ = 0; - // docking_border = 0; - // } - - public boolean isDocked() { - return (docking_border >= 0); - } - - private final int MAX_GAP_ = 20; - - // - public void tryDocking() { - if (editor == null) return; - Frame frame = thisErrorWindow; - - int ex = editor.getX(); - int ey = editor.getY(); - int ew = editor.getWidth(); - int eh = editor.getHeight(); - - int fx = frame.getX(); - int fy = frame.getY(); - int fw = frame.getWidth(); - int fh = frame.getHeight(); - - if (((fy > ey) && (fy < ey + eh)) - || ((fy + fh > ey) && (fy + fh < ey + eh))) { - int dis_border_left = Math.abs(ex - (fx + fw)); - int dis_border_right = Math.abs((ex + ew) - (fx)); - - if (dis_border_left < MAX_GAP_ || dis_border_right < MAX_GAP_) { - docking_border = (dis_border_left < dis_border_right) ? 0 - : 1; - dock_on_editor_y_offset_ = fy - ey; - dock(); - return; - } - } - - if (((fx > ex) && (fx < ex + ew)) - || ((fx + fw > ey) && (fx + fw < ex + ew))) { - int dis_border_top = Math.abs(ey - (fy + fh)); - int dis_border_bot = Math.abs((ey + eh) - (fy)); - - if (dis_border_top < MAX_GAP_ || dis_border_bot < MAX_GAP_) { - docking_border = (dis_border_top < dis_border_bot) ? 2 : 3; - dock_on_editor_x_offset_ = fx - ex; - dock(); - return; - } - } - docking_border = -1; - } - - public void dock() { - if (editor == null) return; - Frame frame = thisErrorWindow; - - int ex = editor.getX(); - int ey = editor.getY(); - int ew = editor.getWidth(); - int eh = editor.getHeight(); - - // int fx = frame.getX(); - // int fy = frame.getY(); - int fw = frame.getWidth(); - int fh = frame.getHeight(); - - int x = 0, y = 0; - if (docking_border == -1) { - return; - } - - if (docking_border == 0) { - x = ex - fw; - y = ey + dock_on_editor_y_offset_; - } - if (docking_border == 1) { - x = ex + ew; - y = ey + dock_on_editor_y_offset_; - } - - if (docking_border == 2) { - x = ex + dock_on_editor_x_offset_; - y = ey - fh; - } - if (docking_border == 3) { - x = ex + dock_on_editor_x_offset_; - y = ey + eh; - } - frame.setLocation(x, y); - } - } -} diff --git a/todo.txt b/todo.txt index 588fe28da..fcb0bd607 100644 --- a/todo.txt +++ b/todo.txt @@ -39,6 +39,13 @@ X https://github.com/processing/processing/pull/3319 gui +_ implement 'welcome' screen +_ https://github.com/processing/processing/issues/3358 +_ a summary of what's new, plus a link to GitHub wiki page with details +_ a warning that some Processing 2 sketches may not be compatible +_ if a v2 sketchbook already exists, show a prompt to choose either creating a new Processing 3 sketch folder or use the existing v2 one, plus a link to GitHub wiki page with details +_ a checkbox for "show this welcome each time" (default to checked) +- a button to dismiss the welcome screen (e.g., "get started") _ add new lower console/errors icons _ show hover text with 'debug' _ inquire about updated document icon