@ -0,0 +1,14 @@ |
|||||||
|
package com.fr.design.fun; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bjorn |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bjorn on 2020-06-12 |
||||||
|
*/ |
||||||
|
public interface ChartWidgetOptionProvider extends ParameterWidgetOptionProvider { |
||||||
|
|
||||||
|
String XML_TAG = "ChartWidgetOptionProvider"; |
||||||
|
|
||||||
|
//在图表区域的开头还是结尾插入
|
||||||
|
boolean isBefore(); |
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
package com.fr.design.fun.impl; |
||||||
|
|
||||||
|
import com.fr.design.fun.ChartWidgetOptionProvider; |
||||||
|
import com.fr.stable.fun.impl.AbstractProvider; |
||||||
|
import com.fr.stable.fun.mark.API; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bjorn |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bjorn on 2020-06-12 |
||||||
|
*/ |
||||||
|
@API(level = ChartWidgetOptionProvider.CURRENT_LEVEL) |
||||||
|
public abstract class AbstractChartWidgetOptionProvider extends AbstractProvider implements ChartWidgetOptionProvider { |
||||||
|
|
||||||
|
public int currentAPILevel() { |
||||||
|
return CURRENT_LEVEL; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String mark4Provider() { |
||||||
|
return getClass().getName(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean isBefore() { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
} |
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 423 B |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 25 KiB |
@ -0,0 +1,32 @@ |
|||||||
|
package com.fr.design.designer.properties.mobile; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.designer.creator.XFieldEditor; |
||||||
|
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.ButtonGroupDefinePane; |
||||||
|
|
||||||
|
public class ButtonGroupPropertyUI extends AbstractWidgetPropertyUIProvider { |
||||||
|
|
||||||
|
private XCreator xCreator; |
||||||
|
|
||||||
|
public ButtonGroupPropertyUI(XFieldEditor xButtonGroupEditor) { |
||||||
|
this.xCreator = xButtonGroupEditor; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public AbstractPropertyTable createWidgetAttrTable() { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public BasicPane createWidgetAttrPane() { |
||||||
|
return new ButtonGroupDefinePane(xCreator); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String tableTitle() { |
||||||
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,83 @@ |
|||||||
|
package com.fr.design.widget.ui.designer.mobile; |
||||||
|
|
||||||
|
import com.fr.design.constants.LayoutConstants; |
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.foldablepane.UIExpandablePane; |
||||||
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.gui.ispinner.UISpinner; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.design.mainframe.DesignerContext; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
import com.fr.form.ui.ButtonGroup; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
|
||||||
|
public class ButtonGroupDefinePane extends MobileWidgetDefinePane { |
||||||
|
|
||||||
|
private XCreator xCreator; // 当前选中控件的xCreator
|
||||||
|
private UISpinner maxShowRowsSpinner; |
||||||
|
|
||||||
|
public ButtonGroupDefinePane(XCreator xCreator) { |
||||||
|
this.xCreator = xCreator; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void initPropertyGroups(Object source) { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
UILabel maxShowRowsLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design-Mobile_Max_Show_Rows"), SwingConstants.LEFT); |
||||||
|
this.maxShowRowsSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 5); |
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[] {maxShowRowsLabel, maxShowRowsSpinner} |
||||||
|
}; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double[] rowSize = {p}; |
||||||
|
double[] columnSize = {p,f}; |
||||||
|
int[][] rowCount = {{1, 1}}; |
||||||
|
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 30, LayoutConstants.VGAP_LARGE); |
||||||
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
||||||
|
final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||||
|
panelWrapper.add(panel, BorderLayout.NORTH); |
||||||
|
UIExpandablePane folderPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panelWrapper); |
||||||
|
this.add(folderPane, BorderLayout.NORTH); |
||||||
|
this.repaint(); |
||||||
|
} |
||||||
|
|
||||||
|
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) { |
||||||
|
ButtonGroup buttonGroup = (ButtonGroup)xCreator.toData(); |
||||||
|
this.maxShowRowsSpinner.setValue(buttonGroup.getMaxShowRows()); |
||||||
|
// 数据 populate 完成后,再设置监听
|
||||||
|
this.bindListeners2Widgets(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void update() { |
||||||
|
ButtonGroup buttonGroup = (ButtonGroup)xCreator.toData(); |
||||||
|
buttonGroup.setMaxShowRows((int) maxShowRowsSpinner.getValue()); |
||||||
|
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来
|
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 20 KiB |