From adee1bff1360ba6a2380d76ab4c09f0966b1acb5 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 3 Aug 2017 15:29:49 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=A4=96=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=3D=E3=80=8B=E8=A7=86=E8=A7=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/constants/UIConstants.java | 3 + .../icontainer/UIEastResizableContainer.java | 3 +- .../design/images/buttonicon/popdownarrow.png | Bin 0 -> 315 bytes .../design/images/buttonicon/popuparrow.png | Bin 0 -> 308 bytes .../mainframe/EastRegionContainerPane.java | 72 ++++++------------ 5 files changed, 30 insertions(+), 48 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/buttonicon/popdownarrow.png create mode 100644 designer_base/src/com/fr/design/images/buttonicon/popuparrow.png diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index c63dcdea79..77ae663502 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/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"); diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 19390a7849..8e9fb6ffab 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -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); diff --git a/designer_base/src/com/fr/design/images/buttonicon/popdownarrow.png b/designer_base/src/com/fr/design/images/buttonicon/popdownarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..d89d951399c6249a3d6a854b477f5f24c663bfd6 GIT binary patch literal 315 zcmV-B0mS}^P)Px#^+`lQR5%gUP`wTTK^Xi#aS}m8t3ypMk%)+R0F^|i^$hnQ5|OBMN`-_MP$?vy zLE|Ul_T1RLOluH>w)IA%G#!zXgyYTH$I<@=8U-^fNJ5TV{zWobAJ z`ANV9I#6m>A2=nyFv2(Vs9CaZT} znE&>$1q48xl6UPS0anvSA8DDr!e9hop`EXpuqTcjJdMht_$%V?%&rsfcq5g<{k#AG N002ovPDHLkV1iQ9j647U literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/buttonicon/popuparrow.png b/designer_base/src/com/fr/design/images/buttonicon/popuparrow.png new file mode 100644 index 0000000000000000000000000000000000000000..76f831bf02678c128bbdf7461551fa4f549e5bb0 GIT binary patch literal 308 zcmV-40n7f0P)Px#?ny*JR5%f1U>Nd%k&qAE=KR$8^Ph1d10w?u1H*sb{|pQ~Kuy>8rLen$^fD1L zU}rMhRiK(%|Ns9t`~ROoli@#u?En9aaD8wFE`t~u8UHh}v$g~2uP`-?4F5mF*aQvm zT=HM$-_KwBfG*$$YPt{B$jJDGC<8#6e}4aU0O)UJMh3=Js)lUpKzatyE1zHnu)rAT zG`eOx71rnm6UIM4mt^@YV-SF;#~KS*H9Io?foVdfF$^F@Gsqwm14z{jG5{V6K)*5m z{PBA$EWp5i#^G#`Mi_t_0E+Mb4F8`oFfvXfRx`|yfu#Zelx;@}NP{c@0000= 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 +797,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 +845,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 +863,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 +876,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 +916,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);