From 52580743f16fddbd3a913a551f2ef6019aa2c5f5 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 16 Nov 2016 17:52:54 +0800 Subject: [PATCH 1/4] rt --- .../parameter/ParameterToolBarPane.java | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index d495e9c06a..0b23f290ae 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -29,16 +29,17 @@ public class ParameterToolBarPane extends BasicBeanPane { private UIButton addAll; private UILabel label; private int breakid; - + private static final int GAP_H = 4; private static final int GAP_V = 6; private static final int GAP_BV = 4; - + private static final int WIDTH = 225; + private static final int L_H = 18; public ParameterToolBarPane() { this.setLayout(new FlowParameterPaneLayout()); - + label = new UILabel() { private static final long serialVersionUID = 1L; @@ -51,7 +52,7 @@ public class ParameterToolBarPane extends BasicBeanPane { label.setHorizontalAlignment(SwingConstants.LEFT); label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); this.add(label); - + addAll = new UIButton(Inter.getLocText("Add-all")); this.add(addAll); @@ -61,7 +62,7 @@ public class ParameterToolBarPane extends BasicBeanPane { protected String title4PopupWindow() { return null; } - + public Parameter getTargetParameter(UIButton button) { int index = parameterSelectedLabellist.indexOf(button); if(index < 0 || index > parameterList.length - 1) { @@ -74,9 +75,9 @@ public class ParameterToolBarPane extends BasicBeanPane { public void populateBean(Parameter[] parameterArray) { parameterSelectedLabellist.clear(); this.removeAll(); - + this.add(label); - + if (parameterArray.length == 0) { this.setVisible(false); this.repaint(); @@ -84,14 +85,14 @@ public class ParameterToolBarPane extends BasicBeanPane { } else { this.setVisible(true); } - + parameterList = parameterArray; for (int i = 0; i < parameterList.length; i++) { UIButton parameterSelectedLabel = new UIButton(parameterList[i].getName()); parameterSelectedLabellist.add(parameterSelectedLabel); this.add(parameterSelectedLabel); } - + for(UIButton parameterSelectedLabel : parameterSelectedLabellist) { parameterSelectedLabel.addMouseListener(paraMouseListner); } @@ -128,9 +129,9 @@ public class ParameterToolBarPane extends BasicBeanPane { public Dimension preferredLayoutSize(Container parent) { int w = parent.getWidth(); - + layoutContainer(parent); - + int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (20 + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); return new Dimension(w, h); } @@ -140,12 +141,12 @@ public class ParameterToolBarPane extends BasicBeanPane { } public void layoutContainer(Container parent) { - int width = parent.getWidth(); + int width = parent.getWidth() == 0 ? WIDTH : parent.getWidth(); int x = 0; int y = L_H + GAP_H; - + label.setBounds(0, 0, width, L_H); - + breakid = 1; for (UIButton tab : parameterSelectedLabellist) { Dimension dim = tab.getPreferredSize(); @@ -154,9 +155,9 @@ public class ParameterToolBarPane extends BasicBeanPane { x = 0; y += (dim.height + GAP_V); } - + tab.setBounds(x, y, dim.width, dim.height); - + x += (dim.width + GAP_H); } addAll.setBounds(0, y + GAP_V+ 20, width, addAll.getPreferredSize().height); From 2d9ab1ff073746dd09f910d8e15ef07c48cf4605 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 16 Nov 2016 18:07:44 +0800 Subject: [PATCH 2/4] rt --- .../src/com/fr/design/parameter/ParameterToolBarPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index 0b23f290ae..f7a6eec94c 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -48,12 +48,12 @@ public class ParameterToolBarPane extends BasicBeanPane { return new Dimension(super.getPreferredSize().width, 18); } }; - label.setText(Inter.getLocText("Following_parameters_are_not_generated")+":"); + label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated")+":"); label.setHorizontalAlignment(SwingConstants.LEFT); label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); this.add(label); - addAll = new UIButton(Inter.getLocText("Add-all")); + addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all")); this.add(addAll); } From 347bea91e6781da77d2f6fb36c2d828a1d91120f Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 16 Nov 2016 18:55:49 +0800 Subject: [PATCH 3/4] rt --- .../com/fr/design/parameter/ParameterToolBarPane.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index f7a6eec94c..2e97da5a73 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -33,6 +33,7 @@ public class ParameterToolBarPane extends BasicBeanPane { private static final int GAP_H = 4; private static final int GAP_V = 6; private static final int GAP_BV = 4; + private static final int BUTTON_HEIGHT = 20; private static final int WIDTH = 225; private static final int L_H = 18; @@ -48,12 +49,12 @@ public class ParameterToolBarPane extends BasicBeanPane { return new Dimension(super.getPreferredSize().width, 18); } }; - label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated")+":"); + label.setText(Inter.getLocText("Following_parameters_are_not_generated")+":"); label.setHorizontalAlignment(SwingConstants.LEFT); label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); this.add(label); - addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all")); + addAll = new UIButton(Inter.getLocText("Add-all")); this.add(addAll); } @@ -132,7 +133,7 @@ public class ParameterToolBarPane extends BasicBeanPane { layoutContainer(parent); - int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (20 + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); + int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); return new Dimension(w, h); } @@ -160,7 +161,7 @@ public class ParameterToolBarPane extends BasicBeanPane { x += (dim.width + GAP_H); } - addAll.setBounds(0, y + GAP_V+ 20, width, addAll.getPreferredSize().height); + addAll.setBounds(0, y + GAP_V + BUTTON_HEIGHT, width, addAll.getPreferredSize().height); } } From e36d08e8b2b334aa24acbe5204cd5e941ad20b1d Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 16 Nov 2016 18:57:27 +0800 Subject: [PATCH 4/4] rt --- .../src/com/fr/design/parameter/ParameterToolBarPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index 2e97da5a73..aa7c11660a 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -49,12 +49,12 @@ public class ParameterToolBarPane extends BasicBeanPane { return new Dimension(super.getPreferredSize().width, 18); } }; - label.setText(Inter.getLocText("Following_parameters_are_not_generated")+":"); + label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated")+":"); label.setHorizontalAlignment(SwingConstants.LEFT); label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); this.add(label); - addAll = new UIButton(Inter.getLocText("Add-all")); + addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all")); this.add(addAll); }