20
www.devoxx.com XenonDataGrid: An OpenSource JavaFX™ Component Peter Pilgrim Java Champion, Tech Lead, e-Business Lloyds Banking Group

XenonDataGrid: An OpenSource JavaFX™ Component

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: XenonDataGrid: An OpenSource JavaFX™ Component

ww

w.d

evo

xx.c

om

XenonDataGrid: An OpenSource JavaFX™ Component

Peter PilgrimJava Champion,

Tech Lead, e-BusinessLloyds Banking Group

Page 2: XenonDataGrid: An OpenSource JavaFX™ Component

ww

w.d

evo

xx.c

om

My View of the World

Java Champion #91, SCEA 5

Java User Group Leader

JavaFX Blog Writer

http://jroller.com/peter_pilgrim

Page 3: XenonDataGrid: An OpenSource JavaFX™ Component

ww

w.d

evo

xx.c

om

Overview Xenon Data Grid

Find and solve a known issue that causes others pain and grief or a certain grade of “Goodness,

gracious me”

Page 4: XenonDataGrid: An OpenSource JavaFX™ Component

ww

w.d

evo

xx.c

om

• NATTABLE.organ huge influence on XDG with an excellent concept of dividing render space into regions and layers: corner, row headers, column headers and body ;-)

Page 5: XenonDataGrid: An OpenSource JavaFX™ Component

ww

w.d

evo

xx.c

om

• Swing JTablean incredibly successful table component from 1999 with limitations based on direct-mode API graphic. No easy scene graph support possible.

Page 6: XenonDataGrid: An OpenSource JavaFX™ Component

ww

w.d

evo

xx.c

om

DEMO

Xenon Data Grid Examples

Page 7: XenonDataGrid: An OpenSource JavaFX™ Component

Seven Essential Recommendations

1. Location aware to the developer

We must be able to

determine Parent (x,y)?

(Cell X , Cell Y), (Parent X, Parent Y)

Page 8: XenonDataGrid: An OpenSource JavaFX™ Component

Seven Essential Recommendations (contd)

18 Nov 2009 Devoxx 2009 8

2. Row Headers

3. Column Headers

Page 9: XenonDataGrid: An OpenSource JavaFX™ Component

Seven Essential Recommendations (contd)

18 Nov 2009 Devoxx 2009 9

4. Reorder-able

5. Scrollable

Page 10: XenonDataGrid: An OpenSource JavaFX™ Component

Seven Essential Recommendations (contd)

18 Nov 2009 Devoxx 2009 10

6. Mapping model data to render cells:

Given a table model with (Dx, Dy) on the table UI component T, we should be able to find a Renderable Cell UI component R with (Rx, Ry)

Page 11: XenonDataGrid: An OpenSource JavaFX™ Component

Seven Essential Recommendations (contd)

18 Nov 2009 Devoxx 2009 11

7. Bidirectional

Users tend to enter bulk data with a table and then submit or save. A good design allows the underlying data model to reflect the Renderer model.

3.141596527

Page 12: XenonDataGrid: An OpenSource JavaFX™ Component

ww

w.d

evo

xx.c

om

DEMOFinal Xenon Data Grid Examples

Page 13: XenonDataGrid: An OpenSource JavaFX™ Component

The Strategy Pattern is “King”

• Plug-in layout strategy allow new forms of grid cell physically

• Plug-in cell selection strategy for mouse driven event

• Plug-in keyboard navigation strategy

• (Soon) plug-in type conversion strategy

Page 14: XenonDataGrid: An OpenSource JavaFX™ Component

MultiLayer, Layers and Renderer Cells

• MultiLayer contains named Layers

• Layers control “regions” of cells

• “Renderer cells” name given to JavaFX type that wrap a scene graph node

• “Painter cells” name given to cell that render to an javafx.reflect.FXType (e.g. String, Integer or Float)

Page 15: XenonDataGrid: An OpenSource JavaFX™ Component

Table Model

• GetData( row, column ): Object

• SetData( row, column, value: Object )

• IsEditable( row, column ): Boolean

• getType( row, column): FXType

• Extended Table Model available for storing data cells that include extra attributes

Page 16: XenonDataGrid: An OpenSource JavaFX™ Component

Code 1

XenonDataGrid {

masterLayer: MultiGridLayer {

cornerLayer: GridLayer { /*..*/}

rowHeaderLayer: GridLayer { /*..*/ }

columnHeaderLayer: GridLayer { /*..*/ }

bodyLayer: GridLayer { /*..*/ }

}

}

Page 17: XenonDataGrid: An OpenSource JavaFX™ Component

Code 2

XenonDataGrid {

masterLayer: MultiGridLayer {

/* ...*/

bodyLayer: GridLayer {

cellFactory: function(row,column): GridCellRenderer { XenonGridCellRenderer{

backgroundFill: Color.LIGHTGREEN } }

tableModel: TableModel {

rows: 100 column 10 data: data }

}

}

}

Page 18: XenonDataGrid: An OpenSource JavaFX™ Component

Xenon Data Grid Summary #1

• Designed for flexibility and efficiency

• Table Model

• Layout, Selection, Navigation plug-in strategies

• Layers, Regions and Multi-Layer (Corner, Column Headers, Row Header and Body)

• Just added Cell Factory in GridLayer.fx

Page 19: XenonDataGrid: An OpenSource JavaFX™ Component

Xenon Data Grid Summary #2

• Open source part of the Nelson FX

• XDG is an upper Alpha-ware state

• Expect a Nelson FX M4 release soon

• Expect more Strategies and Adaptor classes to make your programming lives easier

• Opine, Contribute and Accelerate

Page 20: XenonDataGrid: An OpenSource JavaFX™ Component

ww

w.d

evo

xx.c

om

Thanks For Your Attention!

Search Vimeo for Screencast on the XDG

Audioboo http://audioboo.fm/profile/peter_pilgrim

Missing JavaFX table component

http://jroller.com/peter_pilgrim