|
|
|
@ -153,25 +153,31 @@ public class StartupPageWorkspacePanel extends JPanel {
|
|
|
|
|
} |
|
|
|
|
boolean needScroll = partitions.size() > 4; |
|
|
|
|
if (needScroll) { |
|
|
|
|
// 滚动条
|
|
|
|
|
UIScrollPane scrollPane = new UIScrollPane(workspaceDescPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
|
|
|
|
JViewport viewport = scrollPane.getViewport(); |
|
|
|
|
JViewport scrollViewport = new TransparentScrollViewPort(); |
|
|
|
|
// 动态画图
|
|
|
|
|
scrollViewport.addChangeListener(e -> repaintAll()); |
|
|
|
|
scrollViewport.setView(viewport.getView()); |
|
|
|
|
scrollPane.setViewport(scrollViewport); |
|
|
|
|
scrollPane.setBorder(new EmptyBorder(10, 0, 0, 0)); |
|
|
|
|
scrollPane.setPreferredSize(new Dimension(CONTENT_WIDTH, SCROLL_HEIGHT)); |
|
|
|
|
workspaceDescWrapper.add(scrollPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
return workspaceDescWrapper; |
|
|
|
|
return generateScrollUnLimitContentPanel(workspaceDescWrapper, workspaceDescPanel); |
|
|
|
|
} |
|
|
|
|
workspaceDescWrapper.add(workspaceDescPanel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
return workspaceDescWrapper; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@NotNull |
|
|
|
|
private JPanel generateScrollUnLimitContentPanel(JPanel workspaceDescWrapper, JPanel workspaceDescPanel) { |
|
|
|
|
|
|
|
|
|
// 滚动条
|
|
|
|
|
UIScrollPane scrollPane = new UIScrollPane(workspaceDescPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
|
|
|
|
JViewport viewport = scrollPane.getViewport(); |
|
|
|
|
JViewport scrollViewport = new TransparentScrollViewPort(); |
|
|
|
|
// 动态画图
|
|
|
|
|
scrollViewport.addChangeListener(e -> repaintAll()); |
|
|
|
|
scrollViewport.setView(viewport.getView()); |
|
|
|
|
scrollPane.setViewport(scrollViewport); |
|
|
|
|
scrollPane.setBorder(new EmptyBorder(10, 0, 0, 0)); |
|
|
|
|
scrollPane.setPreferredSize(new Dimension(CONTENT_WIDTH, SCROLL_HEIGHT)); |
|
|
|
|
workspaceDescWrapper.add(scrollPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
return workspaceDescWrapper; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel generateLimitContentPanel(List<List<StartupWorkspaceBean>> partitions) { |
|
|
|
|
|
|
|
|
|
JPanel workspaceDescPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEFT, 0, 0); |
|
|
|
|