1 | // layouter: voidfunc(Container) or func(Container) -> Dimension |
2 | // (return value is preferred size) |
3 | static JPanel customLayoutPanel_trackWidth(fO layouter) { |
4 | class P extends JPanel implements Scrollable { |
5 | *() { super(layoutManagerFromFunction(layouter)); } |
6 | |
7 | @Override |
8 | public Dimension getPreferredScrollableViewportSize() { ret getPreferredSize(); } |
9 | @Override |
10 | public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { return 20; } |
11 | |
12 | @Override |
13 | public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { |
14 | ret (direction == SwingConstants.HORIZONTAL ? visibleRect.width : visibleRect.height)*5/6; |
15 | } |
16 | |
17 | @Override |
18 | public bool getScrollableTracksViewportWidth() { true; } |
19 | |
20 | @Override |
21 | public boolean getScrollableTracksViewportHeight() { false; } |
22 | } |
23 | ret new P; |
24 | } |
Began life as a copy of #1008604
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1008609 |
Snippet name: | customLayoutPanel_trackWidth - customLayoutPanel with width = enclosing width |
Eternal ID of this version: | #1008609/5 |
Text MD5: | 65d28eb2b7a325f928f04777d3480fba |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-05-25 19:14:43 |
Source code size: | 911 bytes / 24 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 547 / 554 |
Version history: | 4 change(s) |
Referenced in: | [show references] |