Opened 8 years ago
Last modified 7 years ago
#13309 closed enhancement
[Patch] Caching and notifying preferences — at Initial Version
Reported by: | michael2402 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 17.04 |
Component: | Core | Version: | |
Keywords: | gsoc-core | Cc: | Don-vip, bastiK, stoecker |
Description
Currently, there are many MapFrame.repaint() calls whenever properties change.
Part of this is because colors and other values are cached by each component seperately.
I added a new infrastructure that allows you to get a property and easily cache that result.
To get a property use:
{{
#!java
new IntegerProperty("my.property", "123").get()
}}
To cache the result, use:
{{
#!java
prop = new IntegerProperty("my.property", "123"); registers 123 as default value
prop.get(); lazy get and convert to int
prop.get(); get cached integer object
}}
I added a new preference listener that listens to changes of one specific key to make this efficient.