|
|
|
@ -26,6 +26,7 @@ public class ParameterPropertyPane extends JPanel{
|
|
|
|
|
private static final int PADDING_SMALL = 5; |
|
|
|
|
private static final int PADDING_MIDDLE = 10; |
|
|
|
|
private static final int PADDING_LARGE = 15; |
|
|
|
|
private static final int ADD_PARA_PANE_MAX_HEIGHT = 95; |
|
|
|
|
|
|
|
|
|
public static final ParameterPropertyPane getInstance() { |
|
|
|
|
if (THIS == null) { |
|
|
|
@ -86,6 +87,7 @@ public class ParameterPropertyPane extends JPanel{
|
|
|
|
|
// 显示或隐藏添加参数面板
|
|
|
|
|
public void refreshState(JTemplate jt) { |
|
|
|
|
setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem(), jt); |
|
|
|
|
updateAddParaPaneSize(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 显示或隐藏添加参数面板
|
|
|
|
@ -93,6 +95,16 @@ public class ParameterPropertyPane extends JPanel{
|
|
|
|
|
refreshState(DesignerContext.getDesignerFrame().getSelectedJTemplate()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void updateAddParaPaneSize() { |
|
|
|
|
if (!addParaPane.isVisible()) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
addParaPane.setPreferredSize(null); |
|
|
|
|
int height = Math.min(addParaPane.getPreferredSize().height, ADD_PARA_PANE_MAX_HEIGHT); |
|
|
|
|
addParaPane.setPreferredSize(new Dimension(addParaPane.getPreferredSize().width, height)); |
|
|
|
|
repaintContainer(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setAddParaPaneVisible(boolean isVisible, JTemplate jt) { |
|
|
|
|
if (isVisible == addParaPane.isVisible() || formHierarchyTreePaneWrapper == null) { |
|
|
|
|
return; |
|
|
|
@ -112,7 +124,6 @@ public class ParameterPropertyPane extends JPanel{
|
|
|
|
|
addParaPane.setVisible(false); |
|
|
|
|
this.setPreferredSize(new Dimension(getWidth(), formHierarchyTreePaneWrapper.getPreferredSize().height + UIConstants.GAP_NORMAL)); |
|
|
|
|
} |
|
|
|
|
repaintContainer(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setEditor(FormDesigner editor) { |
|
|
|
|