forked from fanruan/design
Browse Source
* commit '790e2b4dbb42d00b7a194c10f3e319d85fa3b177': fix 初始化 fix MOBILE-25111 默认UI调整feature/big-screen
Hades
5 years ago
8 changed files with 248 additions and 31 deletions
@ -0,0 +1,36 @@
|
||||
package com.fr.design.designer.properties.mobile; |
||||
|
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; |
||||
import com.fr.design.gui.itable.AbstractPropertyTable; |
||||
import com.fr.design.widget.ui.designer.mobile.MobileBookMarkDefinePane; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/2/12 |
||||
*/ |
||||
public class MobileBooKMarkUsePropertyUI extends AbstractWidgetPropertyUIProvider { |
||||
|
||||
private XCreator xCreator; |
||||
|
||||
public MobileBooKMarkUsePropertyUI(XCreator xCreator) { |
||||
this.xCreator = xCreator; |
||||
} |
||||
|
||||
@Override |
||||
public AbstractPropertyTable createWidgetAttrTable() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BasicPane createWidgetAttrPane() { |
||||
return new MobileBookMarkDefinePane(xCreator); |
||||
} |
||||
|
||||
@Override |
||||
public String tableTitle() { |
||||
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); |
||||
} |
||||
} |
@ -0,0 +1,62 @@
|
||||
package com.fr.design.widget.ui.designer.mobile; |
||||
|
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.foldablepane.UIExpandablePane; |
||||
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.mainframe.FormDesigner; |
||||
import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; |
||||
|
||||
import javax.swing.JPanel; |
||||
import java.awt.BorderLayout; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/2/12 |
||||
*/ |
||||
public class MobileBookMarkDefinePane extends MobileWidgetDefinePane { |
||||
|
||||
private XCreator xCreator; |
||||
private MobileBookMarkUsePane mobileBookMarkUsePane; |
||||
|
||||
public MobileBookMarkDefinePane(XCreator xCreator) { |
||||
this.xCreator = xCreator; |
||||
} |
||||
|
||||
@Override |
||||
public void initPropertyGroups(Object source) { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
this.mobileBookMarkUsePane = new MobileBookMarkUsePane(); |
||||
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, mobileBookMarkUsePane); |
||||
panel.add(uiExpandablePane); |
||||
this.add(panel, BorderLayout.NORTH); |
||||
} |
||||
|
||||
private void bindListeners2Widgets() { |
||||
reInitAllListeners(); |
||||
AttributeChangeListener changeListener = new AttributeChangeListener() { |
||||
@Override |
||||
public void attributeChange() { |
||||
update(); |
||||
} |
||||
}; |
||||
this.addAttributeChangeListener(changeListener); |
||||
} |
||||
|
||||
private void reInitAllListeners() { |
||||
initListener(this); |
||||
} |
||||
|
||||
@Override |
||||
public void populate(FormDesigner designer) { |
||||
this.mobileBookMarkUsePane.populate(xCreator); |
||||
this.bindListeners2Widgets(); |
||||
} |
||||
|
||||
@Override |
||||
public void update() { |
||||
this.mobileBookMarkUsePane.update(xCreator); |
||||
} |
||||
} |
@ -0,0 +1,86 @@
|
||||
package com.fr.design.widget.ui.designer.mobile.component; |
||||
|
||||
import com.fr.design.designer.IntervalConstants; |
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.gui.icheckbox.UICheckBox; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
import com.fr.form.ui.container.WLayout; |
||||
|
||||
import javax.swing.BorderFactory; |
||||
import javax.swing.JPanel; |
||||
import javax.swing.event.ChangeEvent; |
||||
import javax.swing.event.ChangeListener; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Color; |
||||
import java.awt.Component; |
||||
import java.awt.event.MouseAdapter; |
||||
import java.awt.event.MouseEvent; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/2/12 |
||||
*/ |
||||
public class MobileBookMarkUsePane extends BasicPane { |
||||
|
||||
private UICheckBox showHierarchicalBookmarksCheck; |
||||
|
||||
public MobileBookMarkUsePane() { |
||||
initComponent(); |
||||
} |
||||
|
||||
|
||||
private void initComponent() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
this.showHierarchicalBookmarksCheck = new UICheckBox( |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Show_BookMark"), true) { |
||||
@Override |
||||
protected void initListener() { |
||||
this.addMouseListener(new MouseAdapter() { |
||||
@Override |
||||
public void mouseClicked(MouseEvent e) { |
||||
attributeChange(); |
||||
} |
||||
}); |
||||
} |
||||
}; |
||||
UILabel hintLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Show_BookMark_Hint")); |
||||
hintLabel.setForeground(Color.GRAY); |
||||
double f = TableLayout.FILL; |
||||
double p = TableLayout.PREFERRED; |
||||
double[] rowSize = {p, p}; |
||||
double[] columnSize = {f}; |
||||
int[][] rowCount = {{1}, {1}}; |
||||
Component[][] components = new Component[][]{ |
||||
new Component[]{this.showHierarchicalBookmarksCheck}, |
||||
new Component[]{hintLabel} |
||||
}; |
||||
JPanel wrapPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
JPanel showBookMarkPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, |
||||
IntervalConstants.INTERVAL_L1, |
||||
IntervalConstants.INTERVAL_L1); |
||||
showBookMarkPane.setBorder( |
||||
BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0)); |
||||
wrapPane.add(showBookMarkPane, BorderLayout.CENTER); |
||||
this.add(showBookMarkPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
public void populate(XCreator xCreator) { |
||||
WLayout wLayout = ((WLayout) xCreator.toData()); |
||||
this.showHierarchicalBookmarksCheck.setSelected(wLayout.isShowBookmarks()); |
||||
} |
||||
|
||||
public void update(XCreator xCreator) { |
||||
WLayout wLayout = ((WLayout) xCreator.toData()); |
||||
wLayout.setShowBookmarks(showHierarchicalBookmarksCheck.isSelected()); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "MobileBookMarkUsePane"; |
||||
} |
||||
} |
Loading…
Reference in new issue