[JavaFX API Review] RT-29696, FX 8 3D: Change mesh arrays to observable arrays

Richard Bair richard.bair at oracle.com
Mon Apr 22 16:20:36 PDT 2013


+1

On Apr 22, 2013, at 3:26 PM, Alexander Kouznetsov <alexander.kouznetsov at oracle.com> wrote:

> Hi All,
> 
> JIRA: https://javafx-jira.kenai.com/browse/RT-29696
> 
> Current proposal introduces new observable data category:
> 
>    ObservableArray
> 
> with two implementations: ObservableIntegerArray and ObservableFloatArray.
> 
> They have their own ArrayChangeListener interface:
>> /**
>> * Interface that receives notifications of changes to an ObservableArray.
>> */
>> public interface ArrayChangeListener<T extends ObservableArray> {
>> 
>>    /**
>>     * Called after a change has been made to an ObservableArray.
>>     *
>>     * @param sizeChanged indicates size of array changed
>>     * @param from A beginning (inclusive) of an interval related to the change
>>     * @param to An end (exclusive) of an interval related to the change.
>>     */
>>    public void onChanged(T observableArray, boolean sizeChanged, int from, int to);
>> }
> 
> TriangleMesh API simplifies to just four methods:
> 
> public ObservableFloatArray getPoints();
> public ObservableFloatArray getTexCoords();
> public ObservableIntegerArray getFaces();
> public ObservableIntegerArray getFaceSmoothingGroups();
> 
> This change improves the API while preserving the performance as internal data storage is primitive array and there are methods to do bulk operations on them.
> 
> -- 
> Best regards,
> Alexander Kouznetsov
> (408) 276-0387
> 
> <ArrayChangeListener.html><TriangleMesh.html><ObservableArray.html><ObservableFloatArray.html><ObservableIntegerArray.html>



More information about the openjfx-dev mailing list