From 5ebadf7e294068d0f464f55e412c5cc44dd1dce0 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Tue, 14 Jun 2016 09:50:10 +0800 Subject: [PATCH] dev->master --- .../src/com/fr/design/dialog/BasicScrollPane.java | 10 ++++++++-- .../fr/design/editor/editor/ColumnSelectedEditor.java | 4 ++++ .../src/com/fr/design/gui/ibutton/UIButtonGroup.java | 10 ++-------- .../src/com/fr/design/gui/ibutton/UITabGroup.java | 7 ++----- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/designer_base/src/com/fr/design/dialog/BasicScrollPane.java b/designer_base/src/com/fr/design/dialog/BasicScrollPane.java index 7ff1bab92a..bdb5a012f1 100644 --- a/designer_base/src/com/fr/design/dialog/BasicScrollPane.java +++ b/designer_base/src/com/fr/design/dialog/BasicScrollPane.java @@ -153,8 +153,9 @@ public abstract class BasicScrollPane extends BasicBeanPane{ scrollBar.setEnabled(false); scrollBar.setVisible(false); } else { - scrollBar.setEnabled(true); - scrollBar.setVisible(true); + boolean show = isShowScrollBar(); + scrollBar.setEnabled(show); + scrollBar.setVisible(show); } maxheight = getHeight() - DET_HEIGHT; if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { @@ -179,8 +180,13 @@ public abstract class BasicScrollPane extends BasicBeanPane{ } leftcontentPane.validate(); } + } + protected boolean isShowScrollBar() { + return true; + } + @Override public T updateBean() { return null; diff --git a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java index b3997c1b19..0f1c50a5fd 100644 --- a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -13,6 +13,7 @@ import com.fr.stable.StringUtils; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.List; import java.util.regex.Pattern; /** @@ -35,6 +36,9 @@ public class ColumnSelectedEditor extends Editor { @Override public void itemStateChanged(ItemEvent e) { + //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 + List nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); + columnNames = new String[nameList.size()]; columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); columnNameComboBox.removeAllItems(); for (int i = 0; i < columnNames.length; i++) { diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java index f12eec0cb2..8a266a2a1e 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -1,12 +1,6 @@ package com.fr.design.gui.ibutton; -import java.awt.BorderLayout; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.GridLayout; -import java.awt.Insets; -import java.awt.RenderingHints; -import java.awt.Shape; +import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -174,7 +168,7 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver { return BorderFactory.createEmptyBorder(1, 1, 1, 1); } - protected GridLayout getGridLayout(int number) { + protected LayoutManager getGridLayout(int number) { return new GridLayout(0, number, 1, 0); } diff --git a/designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java b/designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java index 7f6ec850a2..406dc8bff7 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java @@ -1,9 +1,6 @@ package com.fr.design.gui.ibutton; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.GridLayout; -import java.awt.RenderingHints; +import java.awt.*; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -38,7 +35,7 @@ public class UITabGroup extends UIButtonGroup { } @Override - protected GridLayout getGridLayout(int number) { + protected LayoutManager getGridLayout(int number) { if (number < BUTTON_NUMBER || isOneLineTab) { return super.getGridLayout(number); } else if (number == BUTTON_NUMBER || number == SEVEN_NUMBER) {