Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imagepanel improvements #689

Closed
wants to merge 69 commits into from

Conversation

pnichols04
Copy link
Collaborator

@pnichols04 pnichols04 commented Sep 15, 2019

Improvements to ImagePanel
181f174

  • Previously, ImagePanel requested every image in its model from
    ImageManager. Now it requests only those images that are actually
    inside the viewport. This improves rendering time in proportion with
    the number of items outside the viewport; improvements are substantial
    with more than a few dozen off-screen items, such as for large asset
    folders.

  • Previously, a call to setGridSize(n), where n was the existing value
    of getGridSize(), would raise a PaintEvent, even though the visible
    surface of the Component had not changed. This has been modified
    so that a PaintEvent will only be raised if the new property is
    unequal to the existing value. Similar changes are made to
    SetSelecionMode(...), SetShowCaptions(...), setShowBorders(...)
    and setModel(...).

  • Spacing was increased, particularly around captions. Previously,
    captions ran very close to each other and to any image below them,
    creating a cluttered appearance.

  • Images are now rendered with bilinear interpolation when they are
    being scaled down and bicubic interpolation when they are being scaled
    up, to eliminate the artifacts and muddiness associated with the nearest-neighbor
    interpolation used previously. No interpolation is applied if the image
    is rendered at its natural size.

  • Text is now rendered with antialiasing, using the label font specified
    by the theme.

  • Mouse event bounds now include the caption, so that captions will
    trigger tooltips and click handlers, consistent with similar controls
    (such as file browsers) on all three target platforms.

  • Truncated item names are now determined heuristically. Previously,
    truncation used an iterative brute-force approach that allocated a
    number of strings on the heap and then discarded them.

KNOWN ISSUES.

  • Tooltips are not triggered until the Component, or
    sometimes the application, loses and regains focus. This is a
    pre-existing issue that was not reprodicible with sufficient reliability
    to diagnose and correct.

  • The ImagePanel used by LookupTablePanel does not refresh its
    scrollbar visibility when the model changes (i.e., when a campaign is
    loaded). This is a side-effect of the way that LookupTablePanel
    creates its JScrollPanel, which does not preserve the Component
    hierarchy from within the scope of the ImagePanel, and as such, leaves
    no parent to be notified when the ImagePanel revalidates. This is a
    pre-existing issue.


This change is Reviewable

Merudo and others added 30 commits August 26, 2019 08:43
- Fix so that token ids stay the same after server start
- Add javadocs info for Zone & Campaign constructors
- Close RPTools#619
Fix token ids being reset on server start
- Fix so that Cut & paste doesn't change token id
- Subsequent pastes will result in different token ids
- Close RPTools#624
Fix cut & paste changes token id
- Fix "Paste" menu not getting updated after performing the Copy/Cut action from popup menu
- Close RPTools#621
- Change how the measurer tool cursor updates, now based on attach/detach instead on paintOverlay
- Fix cursor not updating right away when switching from measurer to pointer
- Fix cursor not updating right away when switching to measurer from label, fog or VBL tool
- Close RPTools#601
Fix "paste" option remaining grayed out after Copy/Cut token
Fix switching from/to the measure tool not updating cursor right away
- Fix token having duplicated ids if a cut was followed by dragging token to map then a paste (induced by RPTools#625)
- Fix dragging token from library to map not ungraying the "Paste" option (fully completes RPTools#630)
Fix bug created by dragging token from library to map
- New message: Second argument to "assert": "{second parameter}" must be of type String
- Close RPTools#637
- New class FunctionUtil to handle checks and type conversions for macro functions
- New internal methods checkNumberParam, getTokenFromParam, paramAsBigDecimal, paramAsBoolean, paramAsInteger, paramAsDouble, paramAsFloat, paramAsJson, paramAsJsonObject and paramAsJsonArray
- Change TokenLightFunctions hasLightSource, clearLights, setLight, and getLights to use these new methods
- Methods tested: checkNumberParam, getTokenFromParam, and paramAsBigDecimal
- First step to solve RPTools#613
Translate a few UI elements to french
Fix incorrect message for assert() when the second parameter is number
Consolidate utility methods for macro functions in FunctionUtil
- Add parameter allowString: if set to false, raises exception when parameter is a string that could be converted to number( ex: "0", "5", etc).
- Functions getZoom, setZoom, getViewArea, setViewArea, and getViewCenter now use FunctionUtil
- Fix functions getZoom and setViewArea not displaying errors when given too many parameters
- Fix javadocs errors
- Remove extra delimiter at the end of getViewCenter
Change ZoomFunction macro functions to use FunctionUtil parameter methods.
- Select Map button (top right of screen) is now properly translated
- Tested for English and French
Add French translation support for "Select Map" button
- Change wrong number of parameters error messages to always display name of function
- Builds on RPTools/parser#3 to work
- Close RPTools#629
Change wrong number of parameters error messages to display the name of the macro function that was used.
Change parser implementation to 1.5.4
- Function takes a "json" and a "path" argument
- Path should be defined according to https://github.com/json-path/JsonPath
- Support inline predicates
- Errors are printed to chat but not according to our standards
- Progress on RPTools#612
Phergus and others added 23 commits September 6, 2019 21:53
Add new Server Option for GM to Reveal FoW for Unowned Tokens.  Add option plus hosting status to output of getInfo("server").
- Add playStream(uri, cycleCount, volume) to play audio from url or local file.
- cycleCount: number of times to play the resource. -1 for infinite loop. Default: 1.
- volume: volume value from 0-1. Default: 1.
- Add stopStream(uri, remove) to stop a stream. If remove is set to 1, unload the stream from memory. Default: 1. If no uri specified, stop all sounds.
- Add editStream(uri, cycleCount, volume) to change the cycleCount or volume of stream.
- Add AppPreference playStreams to enable/disable playing streams
- Ex:

[playStream("https://www.fesliyanstudios.com/musicfiles/2019-05-01_-_Undercover_Spy_Agent_-_David_Fesliyan.mp3", -1, 0.8)]
- Fix access HashMap to be thread safe (now accessed solely from the JavaFX app single thread)
- Fix so that disabling streams in settings also stops all streams
Add playStream, stopStream, and editStream macro functions for playing/streaming audio.
- Move streaming methods to class MediaPlayerAdapter, as discussed in RPTools#668
- Add new parameters: startTime and stopTime to playStream & editStream
- playStream with cycleCount 0 preloads the stream but does not play it
- Add function getStreamProperties as suggested in RPTools#667
- Add support for volume slider through setGlobalVolume, but the slider needs to be created
Add features to playStream functions
- Fix getStreamProperties to return status "STOPPED" after song finished playing
- Change parameters startTime and stopTime to take seconds instead of ms
Fix streams that had finished returning "PLAYING" in getStreamProperties() , change input in ms for start/stop time to secs.
- Icons provided by @JamzTheMan

Co-Authored-By: Jamz <jamz@nerps.net>
- Add optional fadeout (in seconds) before closing a stream
- 0: no fadeout (default)
- Stream will stop once the fadeout period is over
- Suggested by @dorpond in RPTools#615
Add optional fadeout to stopStream().
- Add back,forward,next,pause,play,previous,record,record_on,repeat,shuffle,shuffle_on, and stop icons
- Move mute & volume icons to correct directory
- Icons will be used for RPTools#615
- Icons provided by @JamzTheMan

Co-Authored-By: Jamz <jamz@nerps.net>
Add sound icons to the github directory
- Add conversion of string to uri, replacing space into %20
- Add "FILE/:" at the start of uri if it is missing
- Fix issues raised in RPTools#667
- Change to using jitpack for clientserver
- Fix RPTools#679
Change to using jitpack for clientserver.  Should fix PR's failing in Travis test.
Now supports Windows file paths (and should support Mac & Linux as well) through URLDecoder class.
…PTools#682)

- Add special case so that "*" isn't modified
- Fix regression created by RPTools#678
- Fix RPTools#681
…#677)

- Add new option "propertyType" to conditions in getTokens()
- Value can be a single type as string, or an array of types
- Simplify getTokens() code by removing the second loop. Now include/exclude is a filter property ("match")
- Improve performance of getTokens() by trimming the list continuously instead of constantly filtering the list of all tokens
- Close RPTools#676
- Add conversion of string to uri, replacing space into %20
- Add "FILE/:" at the start of uri if it is missing
- Fix issues raised in RPTools#667
@pnichols04 pnichols04 closed this Sep 15, 2019
@Azhrei
Copy link
Member

Azhrei commented Sep 15, 2019

Wow, this modifiers 45 source files! Um, silly question, but can we break something like this up into separate issues/PRs next time!! (I understand some things will require updates to a lot of files, such as changing params to a method in an interface, but this seems to be multiple unrelated issues.)

Thanks for the updates, though. Looking forward to trying this out.

@pnichols04
Copy link
Collaborator Author

Um, silly question, but can we break something like this up into separate issues/PRs next time!!

I think next time I'll just try to PR into the right branch, the first time, instead.

See #691, #694, #695

@Phergus
Copy link
Contributor

Phergus commented Sep 16, 2019

And PRs should always reference an open issue for tracking purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants