拖动 SOUTH 容器会错误地传播到 CENTER 容器中的底层元素
Dragging a SOUTH container is incorrectly propagated to an underlying element in the CENTER container
我有一个 BorderLayout contentPane。在 CENTER 中有一个元素列表,这些元素都是 SwipeableContainer,在 SOUTH 中,还有另一个 SwipeableContainer。 SOUTH 容器当然是 'on top of' CENTER 列表,但即便如此,当我滑动 SOUTH Swipeable 时,底层(半隐藏)Swipeable 也会被滑动。所以,似乎拖动事件被传播到下面的列表,即使不应该。
下例说明:运行代码,将"SOUTH CONTAINER"向左拖动,其下方的"ListElement"容器也会向左滑动。
为了确保看到问题,请在 SOUTH CONTAINER 的 top 处滑动(因此指针也在最低的可见 ListElement 上方),否则它可能完全滑动的隐藏 ListElement。
我想这是一个错误(我认为拖动不应该影响部分位于视觉拖动元素下方 'hidden' 的元素),但如果不是,我将不胜感激避免它,因为它在视觉上非常令人不安。
//TEST: SWIPEABLE CONTAINER ALSO SWIPES UNDERLYING CONTAINER AS WELL
Form hi = new Form("Welcome", new BorderLayout());
Container list = new Container(BoxLayout.y());
for (int i = 0; i < 20; i++) {
SwipeableContainer swip = new SwipeableContainer(null, new Label("SWIPE"), new SpanLabel("ListElement " + i + " + a lot of fill text to make the element span over several lines so the dragging of the underlying Swipeable is normally noticeable"));
list.add(swip);
}
list.setScrollableY(true);
Container cont = hi.getContentPane();
cont.add(BorderLayout.CENTER, list);
SwipeableContainer swip = new SwipeableContainer(null, new Label("SOUTHSWIPE"), new Label("SOUTH CONTAINER"));
cont.add(BorderLayout.SOUTH, swip);
hi.show();
这是一个错误,但查看代码时我很难确定如何修复它,因为代码没有预见到这种布局。我们可能需要创建一个特殊案例来处理这种类型的布局。我建议使用测试用例代码在问题跟踪器中提交问题。
我有一个 BorderLayout contentPane。在 CENTER 中有一个元素列表,这些元素都是 SwipeableContainer,在 SOUTH 中,还有另一个 SwipeableContainer。 SOUTH 容器当然是 'on top of' CENTER 列表,但即便如此,当我滑动 SOUTH Swipeable 时,底层(半隐藏)Swipeable 也会被滑动。所以,似乎拖动事件被传播到下面的列表,即使不应该。
下例说明:运行代码,将"SOUTH CONTAINER"向左拖动,其下方的"ListElement"容器也会向左滑动。
为了确保看到问题,请在 SOUTH CONTAINER 的 top 处滑动(因此指针也在最低的可见 ListElement 上方),否则它可能完全滑动的隐藏 ListElement。
我想这是一个错误(我认为拖动不应该影响部分位于视觉拖动元素下方 'hidden' 的元素),但如果不是,我将不胜感激避免它,因为它在视觉上非常令人不安。
//TEST: SWIPEABLE CONTAINER ALSO SWIPES UNDERLYING CONTAINER AS WELL
Form hi = new Form("Welcome", new BorderLayout());
Container list = new Container(BoxLayout.y());
for (int i = 0; i < 20; i++) {
SwipeableContainer swip = new SwipeableContainer(null, new Label("SWIPE"), new SpanLabel("ListElement " + i + " + a lot of fill text to make the element span over several lines so the dragging of the underlying Swipeable is normally noticeable"));
list.add(swip);
}
list.setScrollableY(true);
Container cont = hi.getContentPane();
cont.add(BorderLayout.CENTER, list);
SwipeableContainer swip = new SwipeableContainer(null, new Label("SOUTHSWIPE"), new Label("SOUTH CONTAINER"));
cont.add(BorderLayout.SOUTH, swip);
hi.show();
这是一个错误,但查看代码时我很难确定如何修复它,因为代码没有预见到这种布局。我们可能需要创建一个特殊案例来处理这种类型的布局。我建议使用测试用例代码在问题跟踪器中提交问题。