|
|
@ -89,6 +89,7 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
public StartupPageWorkspacePanel(StartupPageModel pageModel) { |
|
|
|
public StartupPageWorkspacePanel(StartupPageModel pageModel) { |
|
|
|
|
|
|
|
|
|
|
|
this.setLayout(new BorderLayout(0, 0)); |
|
|
|
this.setLayout(new BorderLayout(0, 0)); |
|
|
|
|
|
|
|
this.setBorder(new EmptyBorder(15, 0, 20, 0)); |
|
|
|
|
|
|
|
|
|
|
|
this.pageModel = pageModel; |
|
|
|
this.pageModel = pageModel; |
|
|
|
|
|
|
|
|
|
|
@ -129,10 +130,10 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
|
|
|
|
|
|
|
|
JPanel workspaceDescWrapper = new JPanel(); |
|
|
|
JPanel workspaceDescWrapper = new JPanel(); |
|
|
|
workspaceDescWrapper.setLayout(new BorderLayout(0, 0)); |
|
|
|
workspaceDescWrapper.setLayout(new BorderLayout(0, 0)); |
|
|
|
workspaceDescWrapper.setBorder(new EmptyBorder(20, 0, 0, 0)); |
|
|
|
workspaceDescWrapper.setBorder(new EmptyBorder(0, 0, 0, 0)); |
|
|
|
|
|
|
|
|
|
|
|
JPanel workspaceDescPanel = new JPanel(); |
|
|
|
JPanel workspaceDescPanel = new JPanel(); |
|
|
|
workspaceDescPanel.setLayout(new GridLayout(partitions.size(), 1, 0, ITEM_VERTICAL_GAP)); |
|
|
|
workspaceDescPanel.setLayout(new GridLayout(partitions.size(), 1, 0, 0)); |
|
|
|
for (List<StartupWorkspaceBean> partition : partitions) { |
|
|
|
for (List<StartupWorkspaceBean> partition : partitions) { |
|
|
|
JPanel partitionPanel = generatePartitionPanel(partition); |
|
|
|
JPanel partitionPanel = generatePartitionPanel(partition); |
|
|
|
workspaceDescPanel.add(partitionPanel); |
|
|
|
workspaceDescPanel.add(partitionPanel); |
|
|
@ -144,15 +145,17 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
scrollPane.setBorder(new EmptyBorder(10, 0, 0, 0)); |
|
|
|
scrollPane.setBorder(new EmptyBorder(10, 0, 0, 0)); |
|
|
|
scrollPane.setPreferredSize(new Dimension(CONTENT_WIDTH, SCROLL_HEIGHT)); |
|
|
|
scrollPane.setPreferredSize(new Dimension(CONTENT_WIDTH, SCROLL_HEIGHT)); |
|
|
|
workspaceDescWrapper.add(scrollPane, BorderLayout.CENTER); |
|
|
|
workspaceDescWrapper.add(scrollPane, BorderLayout.CENTER); |
|
|
|
return scrollPane; |
|
|
|
return workspaceDescWrapper; |
|
|
|
} |
|
|
|
} |
|
|
|
workspaceDescWrapper.add(workspaceDescPanel, BorderLayout.CENTER); |
|
|
|
workspaceDescWrapper.add(workspaceDescPanel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ColorUtils.transparentBackground(workspaceDescWrapper); |
|
|
|
return workspaceDescWrapper; |
|
|
|
return workspaceDescWrapper; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel generateLimitContentPanel(List<List<StartupWorkspaceBean>> partitions) { |
|
|
|
private JPanel generateLimitContentPanel(List<List<StartupWorkspaceBean>> partitions) { |
|
|
|
|
|
|
|
|
|
|
|
JPanel workspaceDescPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEFT, 0, ITEM_VERTICAL_GAP); |
|
|
|
JPanel workspaceDescPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEFT, 0, 0); |
|
|
|
int limit = 2; |
|
|
|
int limit = 2; |
|
|
|
for (int i = 0; i < partitions.size(); i++) { |
|
|
|
for (int i = 0; i < partitions.size(); i++) { |
|
|
|
if (i >= limit) { |
|
|
|
if (i >= limit) { |
|
|
@ -163,22 +166,38 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
JPanel partitionPanel = generatePartitionPanel(partition); |
|
|
|
JPanel partitionPanel = generatePartitionPanel(partition); |
|
|
|
workspaceDescPanel.add(partitionPanel); |
|
|
|
workspaceDescPanel.add(partitionPanel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ColorUtils.transparentBackground(workspaceDescPanel); |
|
|
|
|
|
|
|
|
|
|
|
return workspaceDescPanel; |
|
|
|
return workspaceDescPanel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@NotNull |
|
|
|
@NotNull |
|
|
|
private JPanel generateTailPanel() { |
|
|
|
private JPanel generateTailPanel() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AtomicReference<Color> hoverBackColorRef = new AtomicReference<>(); |
|
|
|
|
|
|
|
|
|
|
|
JPanel tailPanel = new JPanel(); |
|
|
|
JPanel tailPanel = new JPanel(); |
|
|
|
{ |
|
|
|
{ |
|
|
|
tailPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); |
|
|
|
tailPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); |
|
|
|
tailPanel.setBorder(new EmptyBorder(0, 0, 0, 20)); |
|
|
|
tailPanel.setBorder(new EmptyBorder(0, 0, 0, 20)); |
|
|
|
JPanel showAllPanel = new JPanel(); |
|
|
|
JPanel showAllPanel = new JPanel() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected void paintComponent(Graphics g) { |
|
|
|
|
|
|
|
super.paintComponent(g); |
|
|
|
|
|
|
|
if (hoverBackColorRef.get() != null) { |
|
|
|
|
|
|
|
g.setColor(hoverBackColorRef.get()); |
|
|
|
|
|
|
|
Dimension preferredSize = getPreferredSize(); |
|
|
|
|
|
|
|
g.fillRoundRect(0, 0, preferredSize.width, preferredSize.height, 5, 5); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
showAllPanel.setLayout(new BorderLayout(5, 0)); |
|
|
|
showAllPanel.setLayout(new BorderLayout(5, 0)); |
|
|
|
showAllPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); |
|
|
|
showAllPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); |
|
|
|
|
|
|
|
|
|
|
|
UILabel fontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Expand_All")); |
|
|
|
UILabel fontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Expand_All")); |
|
|
|
fontLabel.setForeground(HOVER_COLOR); |
|
|
|
fontLabel.setForeground(HOVER_COLOR); |
|
|
|
|
|
|
|
showAllPanel.setBackground(new Color(0, 0, 0, 0)); |
|
|
|
showAllPanel.add(fontLabel, BorderLayout.WEST); |
|
|
|
showAllPanel.add(fontLabel, BorderLayout.WEST); |
|
|
|
|
|
|
|
|
|
|
|
UILabel iconLabel = new UILabel(IconUtils.readIcon("/com/fr/design/startup/show_more.svg")); |
|
|
|
UILabel iconLabel = new UILabel(IconUtils.readIcon("/com/fr/design/startup/show_more.svg")); |
|
|
@ -189,13 +208,16 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
showAllPanel.addMouseListener(new MouseAdapter() { |
|
|
|
showAllPanel.addMouseListener(new MouseAdapter() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
Color hoverColor = new Color(217, 235, 254); |
|
|
|
Color hoverBackColor = new Color(217, 235, 254); |
|
|
|
showAllPanel.setBackground(hoverColor); |
|
|
|
hoverBackColorRef.set(hoverBackColor); |
|
|
|
|
|
|
|
repaintAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
|
|
|
hoverBackColorRef.set(null); |
|
|
|
ColorUtils.syncBackground(showAllPanel, showAllBackground); |
|
|
|
ColorUtils.syncBackground(showAllPanel, showAllBackground); |
|
|
|
|
|
|
|
repaintAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -213,7 +235,11 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
@NotNull |
|
|
|
@NotNull |
|
|
|
private JPanel generatePartitionPanel(List<StartupWorkspaceBean> partition) { |
|
|
|
private JPanel generatePartitionPanel(List<StartupWorkspaceBean> partition) { |
|
|
|
|
|
|
|
|
|
|
|
JPanel partitionPanel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(0, 20, 0);; |
|
|
|
JPanel partitionPanelWrapper = new JPanel(); |
|
|
|
|
|
|
|
partitionPanelWrapper.setBorder(new EmptyBorder(10,0,10,0)); |
|
|
|
|
|
|
|
partitionPanelWrapper.setLayout(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel partitionPanel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(0, 20, 0); |
|
|
|
partitionPanel.setName("partitionPanel"); |
|
|
|
partitionPanel.setName("partitionPanel"); |
|
|
|
|
|
|
|
|
|
|
|
for (StartupWorkspaceBean workspaceInfo : partition) { |
|
|
|
for (StartupWorkspaceBean workspaceInfo : partition) { |
|
|
@ -229,7 +255,9 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
Dimension preferredSize = partitionPanel.getPreferredSize(); |
|
|
|
Dimension preferredSize = partitionPanel.getPreferredSize(); |
|
|
|
partitionPanel.setPreferredSize(new Dimension(CONTENT_WIDTH, (int) preferredSize.getHeight())); |
|
|
|
partitionPanel.setPreferredSize(new Dimension(CONTENT_WIDTH, (int) preferredSize.getHeight())); |
|
|
|
} |
|
|
|
} |
|
|
|
return partitionPanel; |
|
|
|
|
|
|
|
|
|
|
|
partitionPanelWrapper.add(partitionPanel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
return partitionPanelWrapper; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void layoutSelectWorkspacePanel(StartupWorkspaceBean workspaceInfo, JPanel workspaceItemDesc) { |
|
|
|
private void layoutSelectWorkspacePanel(StartupWorkspaceBean workspaceInfo, JPanel workspaceItemDesc) { |
|
|
@ -294,8 +322,8 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
int roundOffset = 15; |
|
|
|
int roundOffset = 15; |
|
|
|
// 画一个圆角
|
|
|
|
// 画一个圆角
|
|
|
|
int fixRoundWidth = getWidth() - rectOffset; |
|
|
|
int fixRoundWidth = getWidth() - rectOffset; |
|
|
|
int fixRoundHeight = getHeight() - BORDER_THIN * 2; |
|
|
|
int fixRoundHeight = getHeight() - BORDER_THIN; |
|
|
|
g2d.drawRoundRect(BORDER_THIN, BORDER_THIN, fixRoundWidth, fixRoundHeight, ARC_DIAMETER, ARC_DIAMETER); |
|
|
|
g2d.drawRoundRect(strokeOffset, strokeOffset, fixRoundWidth, fixRoundHeight, ARC_DIAMETER, ARC_DIAMETER); |
|
|
|
|
|
|
|
|
|
|
|
g2d.setColor(backColor); |
|
|
|
g2d.setColor(backColor); |
|
|
|
|
|
|
|
|
|
|
@ -309,9 +337,9 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
g2d.fillRect(fixedX, BORDER_THIN, coverWidth, coverHeight); |
|
|
|
g2d.fillRect(fixedX, BORDER_THIN, coverWidth, coverHeight); |
|
|
|
|
|
|
|
|
|
|
|
g2d.setColor(borderColor); |
|
|
|
g2d.setColor(borderColor); |
|
|
|
g2d.drawLine(getWidth() / 2, BORDER_THIN, getWidth(), BORDER_THIN); |
|
|
|
g2d.drawLine(getWidth() / 2, strokeOffset, getWidth(), strokeOffset); |
|
|
|
g2d.drawLine(getWidth() / 2, getHeight() - BORDER_THIN, getWidth(), getHeight() - BORDER_THIN); |
|
|
|
g2d.drawLine(getWidth() / 2, getHeight() - strokeOffset, getWidth(), getHeight() - strokeOffset); |
|
|
|
g2d.drawLine(getWidth() - strokeOffset, BORDER_THIN, getWidth() - strokeOffset, getHeight() - BORDER_THIN); |
|
|
|
g2d.drawLine(getWidth() - strokeOffset, strokeOffset, getWidth() - strokeOffset, getHeight() - strokeOffset); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -362,7 +390,7 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
borderColorRef.set(hoverColor); |
|
|
|
borderColorRef.set(hoverColor); |
|
|
|
nameLabel.setForeground(hoverColor); |
|
|
|
nameLabel.setForeground(hoverColor); |
|
|
|
pathLabel.setForeground(hoverColor ); |
|
|
|
pathLabel.setForeground(hoverColor ); |
|
|
|
selectWorkspacePanel.getParent().repaint(); |
|
|
|
repaintAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -370,7 +398,7 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
borderColorRef.set(Color.WHITE); |
|
|
|
borderColorRef.set(Color.WHITE); |
|
|
|
nameLabel.setForeground(nameForeground); |
|
|
|
nameLabel.setForeground(nameForeground); |
|
|
|
pathLabel.setForeground(pathColor); |
|
|
|
pathLabel.setForeground(pathColor); |
|
|
|
selectWorkspacePanel.getParent().repaint(); |
|
|
|
repaintAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -455,16 +483,15 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
|
|
|
|
|
|
|
|
int borderOffset = BORDER_THIN * 2; |
|
|
|
int borderOffset = BORDER_THIN * 2; |
|
|
|
// 画画的笔触需要调整一下
|
|
|
|
// 画画的笔触需要调整一下
|
|
|
|
//g2d.drawRoundRect(strokeOffset, strokeOffset, getWidth() - rectOffset, getHeight() - BORDER_THIN, 0, 0);
|
|
|
|
g2d.drawRoundRect(strokeOffset, strokeOffset, getWidth() - borderOffset, getHeight() - BORDER_THIN, ARC_DIAMETER, ARC_DIAMETER); |
|
|
|
g2d.drawRoundRect(BORDER_THIN, BORDER_THIN, getWidth() - borderOffset, getHeight() - borderOffset, ARC_DIAMETER, ARC_DIAMETER); |
|
|
|
|
|
|
|
g2d.setColor(backColor); |
|
|
|
g2d.setColor(backColor); |
|
|
|
int fillWidth = 15; |
|
|
|
int fillWidth = 15; |
|
|
|
g2d.fillRect(0, 0, fillWidth, getHeight()); |
|
|
|
g2d.fillRect(0, 0, fillWidth, getHeight()); |
|
|
|
|
|
|
|
|
|
|
|
g2d.setColor(borderColor); |
|
|
|
g2d.setColor(borderColor); |
|
|
|
g2d.drawLine(BORDER_THIN, BORDER_THIN, fillWidth, BORDER_THIN); |
|
|
|
g2d.drawLine(strokeOffset, strokeOffset, fillWidth, strokeOffset); |
|
|
|
g2d.drawLine(BORDER_THIN, getHeight() - BORDER_THIN, fillWidth, getHeight() - BORDER_THIN); |
|
|
|
g2d.drawLine(strokeOffset, getHeight() - strokeOffset, fillWidth, getHeight() - strokeOffset); |
|
|
|
g2d.drawLine(BORDER_THIN, BORDER_THIN, BORDER_THIN, getHeight() - BORDER_THIN); |
|
|
|
g2d.drawLine(strokeOffset, strokeOffset, strokeOffset, getHeight() - strokeOffset); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -481,15 +508,15 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
borderColorRef.set(HOVER_COLOR); |
|
|
|
borderColorRef.set(HOVER_COLOR); |
|
|
|
selectAndCreatePanel.getParent().repaint(); |
|
|
|
|
|
|
|
label.setIcon(IconUtils.readIcon("/com/fr/design/standard/system/add_hover.svg")); |
|
|
|
label.setIcon(IconUtils.readIcon("/com/fr/design/standard/system/add_hover.svg")); |
|
|
|
|
|
|
|
repaintAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
borderColorRef.set(null); |
|
|
|
borderColorRef.set(null); |
|
|
|
selectAndCreatePanel.getParent().repaint(); |
|
|
|
|
|
|
|
label.setIcon(IconUtils.readIcon("/com/fr/design/standard/system/add.svg")); |
|
|
|
label.setIcon(IconUtils.readIcon("/com/fr/design/standard/system/add.svg")); |
|
|
|
|
|
|
|
repaintAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
@ -533,5 +560,11 @@ public class StartupPageWorkspacePanel extends JPanel { |
|
|
|
showLessContent(); |
|
|
|
showLessContent(); |
|
|
|
showMore = !showMore; |
|
|
|
showMore = !showMore; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
repaintAll(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void repaintAll() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getRootPane().repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|