Browse Source

REPORT-1858 frm组件隐藏

master
kerry 8 years ago
parent
commit
015d53588e
  1. 7
      designer_form/src/com/fr/design/designer/creator/XChartEditor.java
  2. 8
      designer_form/src/com/fr/design/designer/creator/XCreator.java
  3. 7
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  4. 11
      designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java
  5. 3
      designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java

7
designer_form/src/com/fr/design/designer/creator/XChartEditor.java

@ -85,6 +85,13 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
return new CRPropertyDescriptor[] { return new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter
.getLocText("Form-Widget_Name")), .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( new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setI18NName( WLayoutBorderStyleEditor.class).setI18NName(
Inter.getLocText("Chart-Style_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") Inter.getLocText("Chart-Style_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")

8
designer_form/src/com/fr/design/designer/creator/XCreator.java

@ -379,6 +379,14 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
toData().setWidgetName(name); toData().setWidgetName(name);
} }
/**
* 重置组件的可见性
* @param visible 可见性
*/
public void resetVisible(boolean visible){
toData().setVisible(visible);
}
/** /**
* 返回编辑的子组件scale为其内部组件 * 返回编辑的子组件scale为其内部组件
* @return 组件 * @return 组件

7
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[]{ CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetName", this.data.getClass()) new CRPropertyDescriptor("widgetName", this.data.getClass())
.setI18NName(Inter.getLocText("Form-Widget_Name")), .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( new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setI18NName( WLayoutBorderStyleEditor.class).setI18NName(
Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")

11
designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java

@ -145,7 +145,16 @@ public abstract class XWidgetCreator extends XCreator {
this.draw(); this.draw();
} }
} }
/**
* 渲染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);
}
/** /**
* 重命名 * 重命名
* *

3
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())){ if(ComparatorUtils.equals(FormConstants.NAME, properties[row].getName())){
creator.resetCreatorName(value.toString()); creator.resetCreatorName(value.toString());
} }
if(ComparatorUtils.equals("visible", properties[row].getName())){
creator.resetVisible((boolean) value);
}
properties[row].firePropertyChanged(); properties[row].firePropertyChanged();
return true; return true;
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save