Browse Source

Merge pull request #1033 in BA/design from ~PLOUGH/design:9.0 to 9.0

* commit '6fdbd438e5c28ec9d51ff6a98be5055560e9936b':
  REPORT-3163 合作开发9.0设计器=>外框架=》增加‘该元素不支持权限控制’页面
  REPORT-3163 合作开发9.0设计器=>外框架=》列表面板视觉修改
  REPORT-3163 合作开发9.0设计器=>外框架=》视觉修改
master
superman 7 years ago
parent
commit
f6a20a70da
  1. 5
      designer_base/src/com/fr/design/constants/UIConstants.java
  2. 13
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  3. 39
      designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java
  4. 7
      designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  5. BIN
      designer_base/src/com/fr/design/images/buttonicon/popdownarrow.png
  6. BIN
      designer_base/src/com/fr/design/images/buttonicon/popuparrow.png
  7. 1
      designer_base/src/com/fr/design/locale/designer.properties
  8. 1
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  9. 2
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  10. 1
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  11. 1
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  12. 1
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  13. 105
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

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

@ -88,6 +88,7 @@ public interface UIConstants {
public static final Color DEFAULT_BG_RULER = new Color(0xf7f7f7);
public static final Color RULER_LINE_COLOR = new Color(0xababab);
public static final Color RULER_SCALE_COLOR = new Color(0x4e504f);
public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd);
@ -104,6 +105,8 @@ public interface UIConstants {
public static final BufferedImage DRAG_LEFT_PRESS = BaseUtils.readImage("com/fr/design/images/control/leftpre.png");
public static final BufferedImage DRAG_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png");
public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png");
public static final BufferedImage POP_BUTTON_UP = BaseUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png");
public static final int MODEL_NORMAL = 0;
public static final int MODEL_PRESS = 1;
public static final Icon ARROW_DOWN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png");
@ -132,6 +135,8 @@ public interface UIConstants {
public static final Icon EDIT_ICON = BaseUtils.readIcon("com/fr/design/images/m_file/edit.png");
public static final Icon SEARCH_ICON = BaseUtils.readIcon("/com/fr/design/images/data/search.png");
public static final Icon CLEAR_ICON = BaseUtils.readIcon("/com/fr/design/images/data/source/delete.png");
public static final Icon LIST_EDIT_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit.png");
public static final Icon LIST_EDIT_WHITE_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit.png");
public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127);
public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45);
public static final Color BARNOMAL = new Color(153, 153, 153);

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

@ -2,6 +2,7 @@ package com.fr.design.gui.controlpane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
@ -112,7 +113,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
// mainSplitPane.setOneTouchExpandable(true);
this.add(getLeftPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(0, 10, 12, 10));
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 12, 10));
// mainSplitPane.setDividerLocation(getLeftPreferredSize());
this.checkButtonEnabled();
}
@ -137,14 +138,20 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
toolbarDef.addShortCut(sj.getShortCut());
}
toolBar = ToolBarDef.createJToolBar();
// toolBar.setLayout(new FlowLayout(FlowLayout.LEFT));
toolBar.setUI(new UIToolBarUI(){
@Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.white);
g2.fillRect(0, 0, c.getWidth(), c.getHeight());
}
});
toolbarDef.updateToolBar(toolBar);
// 封装一层,加边框
JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(toolBar, BorderLayout.CENTER);
toolBarPane.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, new Color(201, 198, 184)));
leftContentPane.add(toolBarPane, BorderLayout.NORTH);
// leftContentPane.setBorder(BorderFactory.createLineBorder(new Color(201, 198, 184)));
// 顶部标签及add按钮
topToolBar = new UIToolbar();

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

@ -1,6 +1,7 @@
package com.fr.design.gui.controlpane;
import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.ListModelElement;
@ -31,6 +32,7 @@ public class UINameableListCellRenderer extends
private UILabel editButton; // "编辑按钮",实际上是一个 UILabel,由列表项(UIListControlPane)统一处理点击事件
private UILabel label;
private UIListControlPane listControlPane;
private Color initialLabelForeground;
public UINameableListCellRenderer(UIListControlPane listControlPane) {
super();
@ -47,39 +49,19 @@ public class UINameableListCellRenderer extends
return new Dimension(BUTTON_WIDTH, BUTTON_WIDTH);
}
};
// editButton.set4LargeToolbarButton();
editButton.setIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"));
editButton.setIcon(UIConstants.LIST_EDIT_ICON);
editButton.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR));
editButton.setHorizontalAlignment(SwingConstants.CENTER);
// editButton.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// popupEditDialog();
// }
// });
label = new UILabel();
label.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
// label.setEditable(false);
initialLabelForeground = label.getForeground();
this.setLayout(new BorderLayout());
this.add(editButton, BorderLayout.WEST);
this.add(label, BorderLayout.CENTER);
}
private Border getNoFocusBorder() {
// return BorderFactory.createLineBorder(new Color(201, 198, 184));
return BorderFactory.createMatteBorder(0, 0, 1, 0, BORDER_COLOR);
// Border border = DefaultLookup.getBorder(this, ui, "List.cellNoFocusBorder");
// if (System.getSecurityManager() != null) {
// if (border != null) return border;
// return SAFE_NO_FOCUS_BORDER;
// } else {
// if (border != null &&
// (noFocusBorder == null ||
// noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
// return border;
// }
// return noFocusBorder;
// }
}
private void setText(String t) {
@ -108,20 +90,17 @@ public class UINameableListCellRenderer extends
if (isSelected) {
setBackground(bg == null ? list.getSelectionBackground() : bg);
setForeground(fg == null ? list.getSelectionForeground() : fg);
label.setForeground(Color.white);
editButton.setIcon(UIConstants.LIST_EDIT_WHITE_ICON);
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
label.setForeground(initialLabelForeground);
editButton.setIcon(UIConstants.LIST_EDIT_ICON);
}
// if (value instanceof Icon) {
// setIcon((Icon)value);
// setText("");
// }
// else {
// setIcon(null);
setText((value == null) ? "" : value.toString());
// }
setText((value == null) ? "" : value.toString());
setEnabled(list.isEnabled());
setFont(list.getFont());

7
designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -20,7 +20,7 @@ public class UIEastResizableContainer extends JPanel {
private static final long serialVersionUID = 1854340560790476907L;
private int containerWidth = 240;
private int preferredWidth = 240;
private int topToolPaneHeight = 20;
private int topToolPaneHeight = 25;
private int leftPaneWidth = 40;
private JComponent leftPane;
@ -63,11 +63,12 @@ public class UIEastResizableContainer extends JPanel {
}
public UIEastResizableContainer(JComponent leftPane, JComponent rightPane) {
setBackground(UIConstants.NORMAL_BACKGROUND);
setBackground(UIConstants.PROPERTY_PANE_BACKGROUND);
this.leftPane = leftPane;
this.rightPane = rightPane;
this.topToolPane = new TopToolPane();
topToolPane.setBackground(UIConstants.PROPERTY_PANE_BACKGROUND);
setLayout(containerLayout);
add(topToolPane);
@ -307,7 +308,7 @@ public class UIEastResizableContainer extends JPanel {
}
}
// g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, 5, toolPaneHeight, null);
g.drawImage(button, 18, 7, 5, 5, null);
g.drawImage(button, 18, 9, 5, 5, null);
}
}

BIN
designer_base/src/com/fr/design/images/buttonicon/popdownarrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

BIN
designer_base/src/com/fr/design/images/buttonicon/popuparrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

1
designer_base/src/com/fr/design/locale/designer.properties

@ -2104,3 +2104,4 @@ FR-Designer_Insert_Chart=Insert_Chart
FR-Designer_Insert_Text=Insert_Text
FR-Designer_Double=Double
FR-Designer_Add_Event=Add Event
FR-Designer_Not_Support_Authority_Edit=this element does not support authority edit

1
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2105,3 +2105,4 @@ FR-Designer_Scale_Up=Scale_Up
FR-Designer_Scale_Slider=Scale_Slider
FR-Designer_Scale_Grade=Scale_Grade
FR-Designer_Add_Event=Add Event
FR-Designer_Not_Support_Authority_Edit=this element does not support authority edit

2
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -2108,4 +2108,4 @@ FR-Designer-StyleAlignment_Style_PartSpacing=
FR-Designer_Use_Params_Template=
FR-Designer_Label_Name=
FR-Designer_Insert_Formula=
FR-Designer_Add_Event=
FR-Designer_Not_Support_Authority_Edit=\u3053\u306E\u8981\u7D20\u306F\u6A29\u9650\u5236\u5FA1\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093

1
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2108,3 +2108,4 @@ FR-Designer-StyleAlignment_Style_PartSpacing=
FR-Designer_Use_Params_Template=
FR-Designer_Label_Name=
FR-Designer_Add_Event=
FR-Designer_Not_Support_Authority_Edit=\uD574\uB2F9\uC694\uC18C\uB294\uAD8C\uD55C\uCEE8\uD2B8\uB864\uC744\uC9C0\uC6D0\uD558\uC9C0\uC54A\uC2B5\uB2C8\uB2E4.

1
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2111,3 +2111,4 @@ FR-Designer_Scale_Down=\u7F29\u5C0F
FR-Designer_Scale_Up=\u653E\u5927
FR-Designer_Scale_Slider=\u7F29\u653E\u6ED1\u5757
FR-Designer_Scale_Grade=\u7F29\u653E\u7EA7\u522B\uFF0C\u5355\u51FB\u540E\u8C03\u8282\u663E\u793A\u6BD4\u4F8B\u3002
FR-Designer_Not_Support_Authority_Edit=\u8BE5\u5143\u7D20\u4E0D\u652F\u6301\u6743\u9650\u63A7\u5236

1
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2108,3 +2108,4 @@ FR-Designer-StyleAlignment_Style_PartSpacing=
FR-Designer_Use_Params_Template=
FR-Designer_Label_Name=
FR-Designer_Add_Event=
FR-Designer_Not_Support_Authority_Edit=\u8A72\u5143\u7D20\u4E0D\u652F\u63F4\u8A31\u53EF\u6B0A\u63A7\u5236

105
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -28,12 +28,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private JPanel leftPane;
private JPanel rightPane;
private FixedPopupPane currentPopupPane;
private static final int CONTAINER_WIDTH = 290;
private static final int TAB_WIDTH = 40;
private static final int CONTAINER_WIDTH = 288;
private static final int TAB_WIDTH = 38;
private static final int TAB_BUTTON_WIDTH = 32;
private static final int TAB_BUTTON_HEIGHT = 28;
private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH;
private static final int POPUP_TOOLPANE_HEIGHT = 25;
private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30;
// 弹出对话框高度
private static final int POPUP_MIN_HEIGHT = 145;
private static final int POPUP_MAX_HEIGHT = 480;
private static final int POPUP_DEFAULT_HEIGHT = 360;
private static final String KEY_CELL_ELEMENT = "cellElement";
private static final String KEY_CELL_ATTR = "cellAttr";
private static final String KEY_FLOAT_ELEMENT = "floatElement";
@ -43,7 +48,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final String KEY_WIDGET_LIB = "widgetLib";
private static final String KEY_AUTHORITY_EDITION = "authorityEdition";
private static final String KEY_CONFIGURED_ROLES = "editedRoles";
private static final String DEFAULT_PANE = "defaultPane"; // "无可用配置项"面板
private static final String DEFAULT_PANE = "defaultPane";
private static final String DEFAULT_AUTHORITY_PANE = "defaultAuthorityPane";
private JPanel defaultPane; // "无可用配置项"面板
private JPanel defaultAuthorityPane; // "该元素不支持权限编辑"
public enum PropertyMode {
REPORT, // 报表
@ -78,6 +87,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
super();
// setVerticalDragEnabled(false);
initPropertyItemList();
defaultPane = getDefaultPane(Inter.getLocText("FR-Designer_No_Settings_Available"));
defaultAuthorityPane = getDefaultPane(Inter.getLocText("FR-Designer_Not_Support_Authority_Edit"));
switchMode(PropertyMode.REPORT);
// initContentPane();
// super(leftPane, rightPane);
@ -135,9 +146,10 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
// "无可用配置项"面板
private JPanel getDefaultPane() {
private JPanel getDefaultPane(String prompt) {
JPanel defaultPane = new JPanel();
UILabel label = new UILabel(Inter.getLocText("FR-Designer_No_Settings_Available"));
UILabel label = new UILabel(prompt);
label.setHorizontalAlignment(SwingConstants.CENTER);
defaultPane.setLayout(new BorderLayout());
defaultPane.add(label, BorderLayout.CENTER);
return defaultPane;
@ -160,7 +172,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
rightPane.add(item.getName(), item.getPropertyPanel());
}
rightPane.add(DEFAULT_PANE, getDefaultPane());
rightPane.add(DEFAULT_PANE, defaultPane);
rightPane.add(DEFAULT_AUTHORITY_PANE, defaultAuthorityPane);
replaceRightPane(rightPane);
refreshRightPane();
@ -177,8 +190,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
leftPane.add(item.getButton());
}
// leftPane.setLayout(new BoxLayout(leftPane, BoxLayout.Y_AXIS));
leftPane.setBackground(new Color(226, 226, 226));
leftPane.setBackground(UIConstants.PROPERTY_PANE_BACKGROUND);
replaceLeftPane(leftPane);
}
@ -358,16 +370,24 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
*/
public void refreshRightPane() {
boolean hasAvailableTab = false;
boolean hasEnabledTab = false;
for (String name : propertyItemMap.keySet()) {
PropertyItem propertyItem = propertyItemMap.get(name);
if (propertyItem.isVisible() && !propertyItem.isPoppedOut() && propertyItem.isEnabled()) {
propertyCard.show(rightPane, name); // 显示第一个可用tab
hasAvailableTab = true;
break;
if (propertyItem.isVisible() && propertyItem.isEnabled()) {
hasEnabledTab = true;
if (!propertyItem.isPoppedOut()) {
propertyCard.show(rightPane, name); // 显示第一个可用tab
hasAvailableTab = true;
break;
}
}
}
if (!hasAvailableTab) {
propertyCard.show(rightPane, DEFAULT_PANE);
if (!hasEnabledTab && BaseUtils.isAuthorityEditing()) {
propertyCard.show(rightPane, DEFAULT_AUTHORITY_PANE);
} else {
propertyCard.show(rightPane, DEFAULT_PANE);
}
}
// if (this.getRightPane() instanceof DockingView) {
@ -431,7 +451,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final String ICON_SUFFIX_SELECTED = "_selected.png";
private String btnIconName;
private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一
private final Color selectedBtnBackground = new Color(240, 240, 240);
private final Color selectedBtnBackground = new Color(0xF5F5F7);
private Color originBtnBackground;
public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) {
@ -577,7 +597,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private void initButton() {
button = new UIButton(BaseUtils.readIcon(getBtnIconUrl())) {
public Dimension getPreferredSize() {
return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_WIDTH);
return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
}
@Override
public void paintComponent(Graphics g) {
@ -666,36 +686,25 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private class FixedPopupPane extends JPopupMenu {
private JComponent contentPane;
// private PopupToolPane popupToolPane;
private int fixedHeight;
FixedPopupPane(PropertyItem propertyItem) {
contentPane = propertyItem.getContentPane();
this.setLayout(new BorderLayout());
// popupToolPane = ;
this.add(new PopupToolPane(propertyItem), BorderLayout.NORTH);
this.add(contentPane, BorderLayout.CENTER);
this.setOpaque(false);
fixedHeight = getPreferredSize().height - contentPane.getPreferredSize().height;
updateSize();
setPreferredSize(new Dimension(CONTAINER_WIDTH - TAB_WIDTH, POPUP_DEFAULT_HEIGHT));
}
public void menuSelectionChanged(boolean isIncluded) {
}
private void updateSize() {
int newHeight = fixedHeight + contentPane.getPreferredSize().height;
this.setPreferredSize(new Dimension(CONTAINER_WIDTH - TAB_WIDTH, newHeight));
}
public JComponent getContentPane() {
return contentPane;
}
public void replaceContentPane(JComponent pane) {
// remove(pane);
this.remove(this.contentPane);
this.add(this.contentPane = pane);
updateSize();
refreshContainer();
}
@ -708,9 +717,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 弹出属性面板的工具条
private class PopupToolPane extends JPanel {
private int model = UIConstants.MODEL_NORMAL;
private String title;
private JComponent contentPane;
private PropertyItem propertyItem;
private String buttonType;
private JDialog parentDialog; // 如果不在对话框中,值为null
@ -733,7 +740,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
if (mouseDownCompCoords == null) {
setBackground(originColor);
}
model = UIConstants.MODEL_NORMAL;
repaint();
}
@Override
@ -762,13 +768,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void mouseMoved(MouseEvent e) {
if (e.getX() >= ARROW_RANGE_START) {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
model = UIConstants.MODEL_PRESS;
} else if (isMovable) {
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
setBackground(Color.pink);
} else {
setCursor(Cursor.getDefaultCursor());
model = UIConstants.MODEL_NORMAL;
}
repaint();
}
@ -808,13 +812,12 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
super();
this.propertyItem = propertyItem;
this.title = propertyItem.getTitle();
this.contentPane = propertyItem.getContentPane();
originColor = getBackground();
originColor = Color.white;
setBackground(originColor);
setLayout(new BorderLayout());
UILabel label = new UILabel(title);
label.setForeground(new Color(69, 135, 255));
add(label, BorderLayout.WEST);
setBorder(new EmptyBorder(5, 10, 0, 0));
setBorder(new EmptyBorder(5, 10, 5, 0));
initToolButton(buttonType);
}
@ -857,27 +860,15 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
Image button;
g.setColor(new Color(69, 135, 255));
g.setFont(FRFont.getInstance().applySize(14));
// g.drawString(title, 5, 20);
// g.drawImage(UIConstants.DRAG_BAR, 0, 0, CONTENT_WIDTH, POPUP_TOOLPANE_HEIGHT, null);
if (buttonType.equals(NO_BUTTON)) {
return;
}
if (buttonType.equals(DOWN_BUTTON)) {
if (model == UIConstants.MODEL_NORMAL) {
button = UIConstants.DRAG_LEFT_NORMAL;
} else {
button = UIConstants.DRAG_LEFT_PRESS;
}
button = UIConstants.POP_BUTTON_DOWN;
} else {
if (model == UIConstants.MODEL_NORMAL) {
button = UIConstants.DRAG_RIGHT_NORMAL;
} else {
button = UIConstants.DRAG_RIGHT_PRESS;
}
button = UIConstants.POP_BUTTON_UP;
}
// g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, 5, toolPaneHeight, null);
g.drawImage(button, ARROW_RANGE_START + 12, 7, 5, 5, null);
g.drawImage(button, ARROW_RANGE_START + 8, 4, 16, 16, null);
}
}
@ -887,7 +878,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private Cursor originCursor;
private Cursor southResizeCursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);
private Point mouseDownCompCoords;
private int minHeight; // 对话框最小高度
private JComponent contentPane;
private PropertyItem propertyItem;
public PopupDialog(PropertyItem propertyItem) {
@ -900,8 +891,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
contentPane = propertyItem.getContentPane();
container.add(popupToolPane, BorderLayout.NORTH);
container.add(contentPane, BorderLayout.CENTER);
minHeight = container.getPreferredSize().height;
setSize(CONTENT_WIDTH, minHeight);
setSize(CONTENT_WIDTH, POPUP_DEFAULT_HEIGHT);
// validate();
adjustLocation();
@ -941,8 +931,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
Point currCoords = e.getLocationOnScreen();
bounds.height = currCoords.y - mouseDownCompCoords.y + bounds.height;
// 校正位置
if (bounds.height < minHeight) {
bounds.height = minHeight;
if (bounds.height < POPUP_MIN_HEIGHT) {
bounds.height = POPUP_MIN_HEIGHT;
}
if (bounds.height > POPUP_MAX_HEIGHT) {
bounds.height = POPUP_MAX_HEIGHT;
}
mouseDownCompCoords.y = currCoords.y;
setBounds(bounds);

Loading…
Cancel
Save