From 4fefd27c156689d4d4969a5c37d1c352ce529243 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 17 Mar 2017 09:16:06 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-1858=20=20frm=E7=BB=84=E4=BB=B6=E9=9A=90?= =?UTF-8?q?=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/designer/creator/XChartEditor.java | 7 +++++++ .../src/com/fr/design/designer/creator/XElementCase.java | 7 +++++++ .../com/fr/design/designer/creator/XWidgetCreator.java | 9 +++++++++ .../src/com/fr/design/gui/xtable/PropertyGroupModel.java | 3 +++ 4 files changed, 26 insertions(+) diff --git a/designer_form/src/com/fr/design/designer/creator/XChartEditor.java b/designer_form/src/com/fr/design/designer/creator/XChartEditor.java index 605532ab1..2ac2c12e3 100644 --- a/designer_form/src/com/fr/design/designer/creator/XChartEditor.java +++ b/designer_form/src/com/fr/design/designer/creator/XChartEditor.java @@ -85,6 +85,13 @@ public class XChartEditor extends XBorderStyleWidgetCreator { return new CRPropertyDescriptor[] { new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter .getLocText("Form-Widget_Name")), + new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( + Inter.getLocText("FR-Designer_Widget-Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + makeVisible(toData().isVisible());} + }), new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( WLayoutBorderStyleEditor.class).setI18NName( Inter.getLocText("Chart-Style_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index a932548cc..7b6dac0e8 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -83,6 +83,13 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ new CRPropertyDescriptor("widgetName", this.data.getClass()) .setI18NName(Inter.getLocText("Form-Widget_Name")), + new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( + Inter.getLocText("FR-Designer_Widget-Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + makeVisible(toData().isVisible());} + }), new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( WLayoutBorderStyleEditor.class).setI18NName( Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") diff --git a/designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java b/designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java index 9de56622d..2c1be0eab 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java +++ b/designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java @@ -146,6 +146,15 @@ public abstract class XWidgetCreator extends XCreator { } } + /** + * 渲染Painter + */ + public void paint(Graphics g) { + //不可见时,按钮.4f透明 + AlphaComposite composite = this.data.isVisible() ? (AlphaComposite)((Graphics2D)g).getComposite() : AlphaComposite.getInstance(AlphaComposite.SRC_OVER,HALF_OPACITY); + ((Graphics2D)g).setComposite(composite); + super.paint(g); + } /** * 重命名 * diff --git a/designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java b/designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java index 8e8cadad1..bb0f0cd3a 100644 --- a/designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java +++ b/designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java @@ -53,6 +53,9 @@ public class PropertyGroupModel extends AbstractPropertyGroupModel { if(ComparatorUtils.equals(FormConstants.NAME, properties[row].getName())){ creator.resetCreatorName(value.toString()); } + if(ComparatorUtils.equals("visible", properties[row].getName())){ + creator.resetVisible((boolean) value); + } properties[row].firePropertyChanged(); return true; } catch (Exception e) {