Git Product home page Git Product logo

_undergrad-uis-java-swing-mandelbrot's People

Contributors

dliv avatar

Watchers

 avatar

_undergrad-uis-java-swing-mandelbrot's Issues

Pseudocode

not finished yet; shouldn't take too long.

Screenshot gallery

It would be nice if someone saved sample images with the program and made a gallery/album at a free webhost (imgur, min.us) that we could link to from the about page.

Requirement Comments

The program is based on the requirements, but doesn't have source comments linking various parts of the code back to specific requirements. I believe this is required in the final deliverable.

Broken: save/open state-files

last commit broke feature, will fix very soon

class java.io.WriteAbortedException: unmarshalling file
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.awt.image.BufferedImage
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1332)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at MandelCanvas.unmarshall(MandelCanvas.java:244)
at MenuBar.openState(MenuBar.java:196)
at MenuBar.actionPerformed(MenuBar.java:132)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.io.NotSerializableException: java.awt.image.BufferedImage
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at MenuBar.saveState(MenuBar.java:238)
at MenuBar.actionPerformed(MenuBar.java:128)
... 27 more

webstart

some menu options (e.g. save picture) fail in webstart (the dialogs don't appear) for no apparent reason; if i can't figure out why, webstart may have to be scrapped and just recommend downloading jar and running normally

Home Image - Bottom of Mandelbrot Set cut off

just need to find acceptable initial coordinates for the home object made by MandelCanvasFactory (tricky b/c the coordinates will be adjusted to match the aspect ratio of the logical image)

Occasionally misrendered columns

Example: http://i.imgur.com/kVbhJ.jpg

Possible Causes:

  1. Threading
  2. Native Floating Point Limitations

There are no conditions which always cause the bug to manifest, but when it does happen, it is usually in a very deep zoom, only a few zooms before the picture becomes completely pixelated (suggesting cause #2). Factors suggesting cause #1: each thread is assigned a group of columns (e.g. every fourth column) and if the bug was a result of floating point problems it should be more easily reproduced and apply to all pixels.

Save Prompt Before Closing

Anuradha noted that most apps will prompt you to save when exiting if there is unsaved work. Ours has a save feature but doesn't care if you close w/o saving...

Heap Exhaustion

NavigationHistory is keeping a reference to every instance of MandelCanvas and after zooming a few times this exhausts the heap; catching the exception & immediately clearing the navigation history only works intermittently. Possible to start JVM with larger heap -- poor solution -- look into using weak references or having NavigationHistory track a lightweight description of MandelCanvas rather than caching the entire object (will make rerendering images necessary when user uses navigation though).

Feature: more color schemes

We initially wanted to provide an interface for users to define their own color schemes; there doesn't appear to be time for that, but users should at least be given more than one choice of color scheme.

Busy Cursor - failure to activate - 'Increase Iteration Max' option

When the user selects the menu option 'Increase Iteration Max' the busy cursor doesn't activate the way it does for inputting a new iteration max and for zooming. If the user clicks on the render window to restore focus to it then the busy cursor will activate. I've tried to programatically restore focus to the window but it fails (or I'm doing it wrong). The code to 'Increase Iteration Max' is almost identical to 'Input Iteration Max' - which works w/ the cursor - the latter apparently works because focus is returned to the render window after the input dialog is dismissed.

Responsiveness

Whenever the program is rendering an image (after zooming or opening a state file), the GUI becomes non-responsive until it is complete. When multithreading is added this should be fixed - it would also be nice if the user could see the image as it was being generated instead of having to wait until the render was complete to see any change. Also lots of performance improvements could be made to the program.

Tight Memory

Oracle's JRE usually launches with something close to 256MB of max memory, which is surprisingly close to how much memory this application uses. Normally okay, sometimes I get a heap space exception when opening a state file. Launching JVM with larger max memory (e.g. -Xmx512M) should take care of this. Needs to be documented...

Mouse Zoom Box - unexpected movement

Imagining the first mouse click (which initiates zooming) as the origin, moving the mouse into Quadrant I (upper right) causes the zoom box to begin sliding rather than keeping anchored at the origin -- in debug mode throws an assertion error (Pixel created with negative coordinates).

Weird AWT exception

Pops up occasionally, appears non-fatal (I don't think I'm catching it & printing the stack trace). Stack trace doesn't list any of my methods, I must be doing something funny w/ the layout code that occasionally annoys it.

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException
at javax.swing.LayoutComparator.compare(LayoutComparator.java:61)
at java.util.Arrays.mergeSort(Arrays.java:1286)
at java.util.Arrays.sort(Arrays.java:1210)
at java.util.Collections.sort(Collections.java:159)
at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(SortingFocusTraversalPolicy.java:119)
at javax.swing.SortingFocusTraversalPolicy.getFirstComponent(SortingFocusTraversalPolicy.java:434)
at javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(LayoutFocusTraversalPolicy.java:148)
at javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(SortingFocusTraversalPolicy.java:511)
at java.awt.FocusTraversalPolicy.getInitialComponent(FocusTraversalPolicy.java:152)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:340)
at java.awt.Component.dispatchEventImpl(Component.java:4502)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.SequencedEvent.dispatch(SequencedEvent.java:101)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Render Statistics Table

  • too wide
  • attributes need formatting (commas for integers, reasonable # of digits for floats)
  • more attributes (render time & % pts escaping at various iteration maxes would be helpful)
  • headers not showing
  • cell spacing & text alignment
  • extra white space at bottom
  • some attributes no longer needed (redundant to have logical x/y ratio & display x/y ratio since they are locked at same aspect ratio now)

GUI size and layout

Hardcoded, doesn't check the resolution of user's monitor to ensure their screen is large enough. Would be better to start maximized and then figure out acceptable sizes for all interior windows based on that size. The layout code is also a mess.

Feature: arbitrary precision math

Calculations are currently done with doubles. If the picture is zoomed into too deeply, the image will become pixelated (like this: http://i.imgur.com/riWgD.jpg) as the distance between numbers is too small to do math on. This is why support for BigDecimals needs to be added and code to check whether it is necessary to switch to that mode. Will entail big performance hit.

Deliverable Package

  • shooting for May 13th
  • have all group members double check contents to ensure we're not leaving anything out (esp. documentation wise)
  • sent Adam updated requirements, I still don't have the final document (my copy has notes, e.g. section 1.2 Scope has a note to reuse the text from the first scope document we turned in).

Quick save image / state files

Alternative for when the user doesn't want to bother selecting a folder/name different than the default (now possible b/c the saving feature already constructs a name prepended w/ sequential numbers to avoid overwriting previous saves). If the user changes folder from default save (Desktop) - need to remember that and set it as the quicksave location (two versions, one for pics & one for state files?).

Saving Files - Not User Friendly

Saving files works but could be more user friendly. It doesn't warn users when a file exists with the same name so will be overwritten. The default naming scheme is simple so will lead to the same file name problem if the user chooses a folder more than once. Custom file filters are set for images (PNG) and the custom save file (MMV), it doesn't make sense to also have the "All files" option in the file filter dropdown for each of these.

Shortcut Keys

Missing Feature:

  • Ctrl + S for Save [Image/State] As ... (maybe user configurable)
  • Ctrl + O for Open State File

Other Logical Image Resolutions

Currently the image is calculated internally (and saved) as HD 1080p (1920 x 1080), which is coincidentally the resolution most high end widescreen monitors are now. Doesn't make sense to offer 720p b/c it's the same aspect ratio, but some really high end monitors for graphic designers are higher resolution than 1080p - would be nice to be able to render at those resolutions so they could have perfect background images too.

E.g. this dell is 2560 x 1600: http://www.dell.com/content/topics/topic.aspx/global/products/monitors/topics/en/monitor_3007wfp

Frozen Bug List

So prof has a concise list of known issues applicable to the version we submit for a grade.

Resizing render window

Should resize the image displayed in render window. Since the displayed image is already decouple from the native resolution initially used to draw the image (and to save the image), this shouldn't logically be difficult just requires registering an event listener for window resizes and a little extra code.

Slow Startup

  • App is slow to start (multithreading helped)
  • If user doesn't think app is starting & tries to restart, could exacerbate the problem

Possible Workarounds:

  • Splash screen
  • Make app run as singleton instance (Anuradha asked about this)
  • Precompute the initial state, or at least picture, so it doesn't need to be calculated on startup (figure out how to package this as a jar asset - still trying to avoid any kind of installer or system changes)
  • Figure out how to show the entire GUI before beginning to render the initial image

Zooming not user friendly

  • Zoom code assumes user selects upper left corner with mouse click and then lower right corner with mouse click. Need to check if points are reversed and adjust (currently if the points are reversed the correct region will still be zoomed in upon but the code that draws a zoom box around the selection region will act flaky).
  • Dragging mouse may be more intuitive than the two clicks.
  • Zoom box stays on screen even if that region loses focus.
  • Zoom box should probably only be activated with left clicks (current code doesn't check which mouse button is pressed). The style of the zoom box is okay but making the interior a different (but translucent) color would be an improvement.
  • Might also be better to lock the aspect ratio of the box selected so the region the user selects better reflects where the program will actually zoom.

User's Manual

  • recency: Program has new features since the last version of the manual was made (sorry adam)
  • filetype: PDF might be more friendly to non-Windows users (currently *.docx)

About / Help pages need content

Program is set to open the pages but they have no content. Adam's written a user's guide. Need to:

  • Help page can link to issues tracker @ github
  • About page can have short intro, couple of screen shots
  • User's guide should probably be linked to by one or both

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.