Greg Brown wrote: >> - I'm unsure how best to calculate a baseline for TextAreaSkin > > How do components report their baseline? Is it an offset from the > bottom of the component, or from the top? I think I would expect the > bottom - if so, I would expect TextArea's baseline to be 0. > It's an offset from the top of the component, where -1 indicates no baseline.
>> - TablePaneSkin still needs a getBaseline() implementation > > Could this also be 0? It seems like many components might want to > report 0 - how do some other components (besides Label) define their > baselines? > The default implementation in ComponentSkin returns -1, which indicates "no baseline". In a ideal world, TablePaneSkin would return the max(baseline) over the child components in the first row. Besides Label, FlowPane, CardPane, StackPane, Checkbox, Form, LinkButton, ListButton, ListView, PushButton, RadioButton, Sheet, Spinner, TextInput return valid baseline values. >> - FlowPaneSkin - It is possible to end up with illegal combinations e.g. >> verticalAlignment==BASELINE && orientation==VERTICAL. But how to flag >> these kinds of errors? > > If a caller tries to set an incompatible alignment style, we could > throw. If the caller changed the FlowPane's orientation after the > style had been set, we could just revert it to the default value > (rather than throwing). I'm actually considering eliminating support > for HorizontalAlignment.JUSTIFY when Orientation is HORIZONTAL and > VerticalAlignment.JUSTIFY when Orientation is VERTICAL*, and we would > probably want to handle this case the same way. > The problem with throwing is that the caller may be transitioning from one valid state to another via an invalid state, but because we set the properties using 2 different methods, it is impossible to know if this is the case. > * In retrospect, the use cases for these combinations seem somewhat > artificial, and the code to support it is non-trivial; I need to make > some optimizations to this class anyways, so I was thinking of bagging > it while I was in there. >
