Imported from previous forum
One area I have had difficulty deciding how to implement is a strategy panel that is layed out horizontally. There is nothing in the spec that defines the alignment and resize behavior of the conrols or nested panels within the parent panel. For example, do I align everything left, right, center or fill the panel. If the components are to fill the panel row, are they stretched to fit horizonatlly or is space applied in between?
Currently this is what I do. If the parent panel contains nested panels I stretch to fill the row. If the panel contains controls, the controls are rendered in their preferred size and place left in the row with small spacing in between. In this case all extra space is to the right.
One area I have had difficulty deciding how to implement is a strategy panel that is layed out horizontally. There is nothing in the spec that defines the alignment and resize behavior of the conrols or nested panels within the parent panel. For example, do I align everything left, right, center or fill the panel. If the components are to fill the panel row, are they stretched to fit horizonatlly or is space applied in between?
Currently this is what I do. If the parent panel contains nested panels I stretch to fill the row. If the panel contains controls, the controls are rendered in their preferred size and place left in the row with small spacing in between. In this case all extra space is to the right.
atdl4j uses SWT’s GridLayout for the controls (or nested panels) with column count representing the number of entries to lay out.
Also, another area that may create a challenge… With FIXatdl 1.1 it is permissible to have a mixture of Controls and StrategyPanel entries within a given StrategyPanel. atdl4j ‘handles’ this by automatically generating a StrategyPanel wrapper around each of those Controls such that the StrategyPanel ends up containing all StrategyPanels or all Controls. There is one issue with that in that atdl4j uses JAXB bindings for the XML parse and by the time the data comes to the app, there is simply a list of Controls and a list of Panels without any way to know the sequence of the mixture of the two that was originally in the XML file(so atdl4j simply adds the Controls wrapped with StrategyPanels at the end).
atdl4j uses SWT’s GridLayout for the controls (or nested panels) with column count representing the number of entries to lay out.
So does the GridLayout break up the region into equal width parts?
If so, what happens if you had a left panel that was fairly narrow and a right panel that was wide. Something similar to this ( aaa and bbb are in one panel, and ccc/ddd is the other). Is there a large whitespace after the aaaa/bbbb panel?
[ aaaaa: ____ ] [ ccccc: @ option1 @ option2 @ option3 @ option 4 ]
[ bbbbb: ____ ] [ ddddd: ______
Also, another area that may create a challenge… With FIXatdl 1.1 it is permissible to have a mixture of Controls and StrategyPanel entries within a given StrategyPanel. atdl4j ‘handles’ this by automatically generating a StrategyPanel wrapper around each of those Controls such that the StrategyPanel ends up containing all StrategyPanels or all Controls. There is one issue with that in that atdl4j uses JAXB bindings for the XML parse and by the time the data comes to the app, there is simply a list of Controls and a list of Panels without any way to know the sequence of the mixture of the two that was originally in the XML file(so atdl4j simply adds the Controls wrapped with StrategyPanels at the end).
I ended up modifying the generated classes as follows to support combined panels and controls:
@XmlElements(
{
@XmlElement(name=“StrategyPanel”, type=StrategyPanelT.class, namespace = “http://www.fixprotocol.org/FIXatdl-1-1/Layout”),
@XmlElement(name=“Control”, type=ControlT.class, namespace = “http://www.fixprotocol.org/FIXatdl-1-1/Layout”)
})
protected List contents = new ArrayList();