Showing posts with label etrading. Show all posts
Showing posts with label etrading. Show all posts

Tuesday, 24 June 2008

E-Trading User Interface

Hello,

I have been working on my spare time (now full-time) on an Electronic Trading User Interface entirely developed in Java Swing:




I will make a web-started version available soon.

The UI has the notion of grids (via xml config), plugins (Java interface), etc. It is quite performant (low cpu and memory usage).
If you are interested in this UI, please get in touch.

Thursday, 12 June 2008

Swing Table Flashing Cell

Another feature of an Electronic Trading User Interface is the notion of flashing cells on data update. The way I have decided to implement this feature is by using a custom renderer (TableCellRenderer) and what I call a DelayedCellOff class. Each cell in the grid is implemented as a Cell object. This Cell object has a flag that says if the cell should be flashed or not (if the cell value is for example different than the previous one).
When a cell is updated, fireTableCellUpdated is called on the model (DefaultTableModel), and if its flash status is true, a DelayedCellOff object referencing the cell object is added to a DelayQueue with a timeout.
Initially the cell is rendered with its flash foreground and background colours, and when the timeout expires, the cell flash state is reset; another fireTableCellUpdated is called, the renderer redraws the cell with its default background and foreground colours.

This implementation has two good qualities in my view: simplicity and efficiency.

Swing Table with frozen columns part I

I have long wanted to have the feature of frozen columns in a Swing grid. I have been working on my spare time on an electronic trading user interface lately, and from my experience in the investment banking industry, I have noticed the simple following points:


  • If the user interface sucks, the user (trader) usually thinks that the whole system sucks

  • People (managers, developers) always under-estimate the user interface

  • The user interface is the most complex part of the system: it has to perform, look good and be flexible



In this series, I will show you my personal interpretation of what an E-Trading User Interface should look like.

Whether you go for NetBeans Modules, or Eclipse RCP, or write your own small framework that meets your needs, keep in mind the word “simplicity”.

Now… Collin Fagan gave us the code to hack Swing in order to display a JTable with frozen columns. You can find his code for the NonScrollingColumnsDemo here

I have used the ideas from his demo and the JXTable component from SwingX to use the column control (top-right hand corner of the table) to add the ability to add, remove frozen columns and visible columns to a grid. I call this new grid a SuperGrid because it is composed of two JXTables, the left one being the frozen grid, the right one being the normal grid where the horizontal scroll is displayed.

Follows a snapshot of the super grid (note the button on the top-right hand corner, the one with the question-mark as an icon):



There is nothing exciting here, but now if you click on the button, you should see something like:



There are two menus, a “Visibility” menu and a “Frozen” menu.
By selecting a column in the menus, you can make a column visible or not, frozen or not (moved to the left or to the right).

This is really useful as you can decide at runtime which columns to display. Each column is backed up by a config that is persisted with the column state: visible, frozen, width so that next time you start the application, the previous layout is restored.

The code is available on demand. A Web-started version will be there for you soon. The most interesting part will be the trading application!

Blog Archive