Browse Source

REPORT-3734 [9.0一轮回归]设计器控件管理打不开

master
kerry 7 years ago
parent
commit
d19c63157c
  1. 6
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  2. 11
      designer/src/com/fr/design/widget/ValueWidgetPane.java
  3. 4
      designer/src/com/fr/design/widget/WidgetEventPane.java
  4. 25
      designer/src/com/fr/design/widget/WidgetEventPaneNoPop.java
  5. 17
      designer/src/com/fr/design/widget/WidgetManageCardPane.java
  6. 6
      designer/src/com/fr/design/widget/WidgetPane.java
  7. 1
      designer_base/src/com/fr/design/constants/UIConstants.java
  8. 22
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  9. 4
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  10. 7
      designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java

6
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -77,7 +77,7 @@ public class CellWidgetCardPane extends BasicPane {
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
initPaneList();
eventPane = new WidgetEventPane(pane);
eventPane = initWidgetEventPane(pane);
eventTabPane.add(eventPane, BorderLayout.CENTER);
//k
center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute"));
@ -111,6 +111,10 @@ public class CellWidgetCardPane extends BasicPane {
paneList.add(eventPane);
}
protected WidgetEventPane initWidgetEventPane(ElementCasePane pane){
return new WidgetEventPane(pane);
}
@Override
protected String title4PopupWindow() {
return "Widget";

11
designer/src/com/fr/design/widget/ValueWidgetPane.java

@ -42,6 +42,17 @@ public class ValueWidgetPane extends WidgetPane {
return jPanel;
}
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane){
return new WidgetManageCardPane(pane);
}
/**
* 初始化所有事件.
*/
public void initAllListeners() {
}
@Override
public void populate(Widget widget) {
super.populate(widget);

4
designer/src/com/fr/design/widget/WidgetEventPane.java

@ -67,6 +67,10 @@ public class WidgetEventPane extends ObjectUIControlPane {
public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane {
private ElementCasePane epane;
// 反射会用到
public WidgetEventListenerUpdatePane() {
this(null);
}
public WidgetEventListenerUpdatePane(ElementCasePane epane){
this.epane = epane;
super.initComponents();

25
designer/src/com/fr/design/widget/WidgetEventPaneNoPop.java

@ -0,0 +1,25 @@
package com.fr.design.widget;
import com.fr.design.mainframe.ElementCasePane;
import java.awt.*;
/**
* 没有悬浮弹窗的控件事件编辑面板
* Created by plough on 2017/8/28.
*/
public class WidgetEventPaneNoPop extends WidgetEventPane {
public WidgetEventPaneNoPop(ElementCasePane ePane) {
super(ePane);
}
@Override
protected boolean isNewStyle() {
return false;
}
@Override
protected void popupEditDialog(Point mousePos) {
// no pop, do nothing
}
}

17
designer/src/com/fr/design/widget/WidgetManageCardPane.java

@ -0,0 +1,17 @@
package com.fr.design.widget;
import com.fr.design.mainframe.ElementCasePane;
/**
* Created by kerry on 2017/8/29.
*/
public class WidgetManageCardPane extends CellWidgetCardPane{
public WidgetManageCardPane(ElementCasePane pane) {
super(pane);
}
protected WidgetEventPane initWidgetEventPane(ElementCasePane pane){
return new WidgetEventPaneNoPop(pane);
}
}

6
designer/src/com/fr/design/widget/WidgetPane.java

@ -61,7 +61,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
editorTypeComboBox.addItemListener(this);
cellEditorCardPane = new CellWidgetCardPane(pane);
cellEditorCardPane = initWidgetCardPane(pane);
this.add(cellEditorCardPane, BorderLayout.CENTER);
this.addAttributeChangeListener(listener);
}
@ -81,6 +81,10 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
return jPanel;
}
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane){
return new CellWidgetCardPane(pane);
}
protected JPanel createContentPane() {
return new JPanel();
}

1
designer_base/src/com/fr/design/constants/UIConstants.java

@ -17,6 +17,7 @@ import java.awt.image.BufferedImage;
*/
public interface UIConstants {
public static final Icon CPT_ICON = BaseUtils.readIcon("/com/fr/base/images/oem/cpt.png");
public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);

22
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -12,6 +12,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
@ -104,6 +105,11 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
public abstract void saveSettings();
// 是否使用新样式
protected boolean isNewStyle() {
return true;
}
protected void initComponentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.creators = this.createNameableCreators();
@ -117,15 +123,19 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
UILabel selectLabel = new UILabel();
cardPane.add(selectLabel, "SELECT");
cardPane.add(controlUpdatePane, "EDIT");
if (isNewStyle()) {
popupEditDialog = new PopupEditDialog(cardPane);
// SplitPane
// JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane);
// mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
// mainSplitPane.setOneTouchExpandable(true);
this.add(getLeftPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 15, 15));
// mainSplitPane.setDividerLocation(getLeftPreferredSize());
} else {
// SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane);
mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
mainSplitPane.setOneTouchExpandable(true);
this.add(mainSplitPane, BorderLayout.CENTER);
mainSplitPane.setDividerLocation(getLeftPreferredSize());
}
this.checkButtonEnabled();
}

4
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -106,6 +106,7 @@ public abstract class UIListControlPane extends UIControlPane {
}
}
});
if (isNewStyle()) {
nameableList.getModel().addListDataListener(new ListDataListener() {
@Override
public void intervalAdded(ListDataEvent e) {
@ -123,6 +124,7 @@ public abstract class UIListControlPane extends UIControlPane {
}
});
}
}
public UINameEdList createJNameList() {
UINameEdList nameEdList = new UINameEdList(new DefaultListModel()) {
@ -388,7 +390,7 @@ public abstract class UIListControlPane extends UIControlPane {
}
}
private void popupEditDialog(Point mousePos) {
protected void popupEditDialog(Point mousePos) {
Rectangle currentCellBounds = nameableList.getCellBounds(editingIndex, editingIndex);
if (editingIndex < 0 || !currentCellBounds.contains(mousePos)) {
return;

7
designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java

@ -24,6 +24,7 @@ import java.awt.event.ActionListener;
public class UINameableListCellRenderer extends
JPanel implements ListCellRenderer {
private static final Border SAFE_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
private static final Border DEFAULT_NO_FOCUS_BORDER = new EmptyBorder(1, 1, 1, 1);
private static final Color BORDER_COLOR = new Color(201, 198, 184);
@ -49,7 +50,7 @@ public class UINameableListCellRenderer extends
return new Dimension(BUTTON_WIDTH, BUTTON_WIDTH);
}
};
editButton.setIcon(UIConstants.LIST_EDIT_ICON);
editButton.setIcon(listControlPane.isNewStyle() ? UIConstants.LIST_EDIT_ICON : UIConstants.CPT_ICON);
editButton.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR));
editButton.setHorizontalAlignment(SwingConstants.CENTER);
label = new UILabel();
@ -91,14 +92,18 @@ public class UINameableListCellRenderer extends
setBackground(bg == null ? list.getSelectionBackground() : bg);
setForeground(fg == null ? list.getSelectionForeground() : fg);
label.setForeground(Color.WHITE);
if (listControlPane.isNewStyle()) {
editButton.setIcon(UIConstants.LIST_EDIT_WHITE_ICON);
}
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
label.setForeground(initialLabelForeground);
if (listControlPane.isNewStyle()) {
editButton.setIcon(UIConstants.LIST_EDIT_ICON);
}
}
setText((value == null) ? "" : value.toString());

Loading…
Cancel
Save