Browse Source

Pull request #5976: REPORT-59905&REPORT-59952 若干bug

Merge in DESIGN/design from ~FANGLEI/design10.0:feature/x to feature/x

* commit 'c971e997fb1e2d2dff3367a435b1aa19faac0321':
  REPORT-59952 还原代码
  REPORT-59952&无JIRA任务 还原代码&click事件感觉用起来不舒服,鼠标点下释放位置偏离一点点就失灵了,改成press事件
  REPORT-59905&REPORT-59952 若干bug
research/11.0
fanglei 3 years ago
parent
commit
82ecbcabb5
  1. 19
      designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java

19
designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java

@ -32,6 +32,7 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -84,6 +85,7 @@ public class NewFormPane extends BasicPane {
}); });
dialog.setSize(new Dimension(900, 600)); dialog.setSize(new Dimension(900, 600));
GUICoreUtils.centerWindow(dialog); GUICoreUtils.centerWindow(dialog);
dialog.setTitle(this.title4PopupWindow());
dialog.setResizable(false); dialog.setResizable(false);
dialog.setVisible(true); dialog.setVisible(true);
} }
@ -93,7 +95,14 @@ public class NewFormPane extends BasicPane {
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.setModel(initListModel()); list.setModel(initListModel());
list.setSelectedIndex(0); list.setSelectedIndex(0);
list.setCellRenderer(new DefaultListCellRenderer()); list.setCellRenderer(new DefaultListCellRenderer() {
@Override
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
return this;
}
});
list.addListSelectionListener(new ListSelectionListener() { list.addListSelectionListener(new ListSelectionListener() {
@Override @Override
public void valueChanged(ListSelectionEvent e) { public void valueChanged(ListSelectionEvent e) {
@ -142,9 +151,9 @@ public class NewFormPane extends BasicPane {
private JPanel createNewTemplatePane() { private JPanel createNewTemplatePane() {
EmptyLayoutPane jPanel = new EmptyLayoutPane(); EmptyLayoutPane jPanel = new EmptyLayoutPane();
jPanel.addClickListener(new MouseAdapter() { jPanel.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mousePressed(MouseEvent e) {
setSelectedLayoutPane(jPanel); setSelectedLayoutPane(jPanel);
dialog.setButtonEnabled(true); dialog.setButtonEnabled(true);
} }
@ -229,9 +238,9 @@ public class NewFormPane extends BasicPane {
layoutPaneMap.put(moduleName, module); layoutPaneMap.put(moduleName, module);
for (PredefinedLayout layout : layouts) { for (PredefinedLayout layout : layouts) {
PredefinedLayoutPane predefinedLayoutPane = new PredefinedLayoutPane(layout); PredefinedLayoutPane predefinedLayoutPane = new PredefinedLayoutPane(layout);
predefinedLayoutPane.addClickListener(new MouseAdapter() { predefinedLayoutPane.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mousePressed(MouseEvent e) {
setSelectedLayoutPane(predefinedLayoutPane); setSelectedLayoutPane(predefinedLayoutPane);
dialog.setButtonEnabled(true); dialog.setButtonEnabled(true);
} }

Loading…
Cancel
Save