Browse Source
* commit '3dab55b9d8bd0aa2ad6d02de309898d1829fe26b': 添加国际化,修改PMD REPORT-1384 按钮控件自定义颜色样式 REPORT-576 button样式自定义图片设置,默认背景设置 调整格式 调整一下 调整一下 调整一下 REPORT-576 tab属性部分添加 REPORT-576 tab删除提示框功能添加 REPORT-1096 取色板=》调整代码 REPORT-1096 取色板=》调整代码 无JIRA任务。修改代码 REPORT-1096 取色板=》解决一些bug REPORT-1096 取色板=》将取色框改为模态对话框;修改鼠标事件响应方法 REPORT-1096 取色板=》改为只在按下鼠标左键时设置颜色 常量改成大写 在表单->模板菜单->移动端属性中加入报表解析方式的选项master
rinoux
8 years ago
23 changed files with 711 additions and 222 deletions
@ -0,0 +1,112 @@
|
||||
package com.fr.design.dialog.mobile; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.border.UITitledBorder; |
||||
import com.fr.design.gui.ibutton.UIRadioButton; |
||||
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.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
import java.awt.event.ActionListener; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 由于MobileUserHtmlGroupPane 现在在report和form中均会用到,会出现重复代码,故放入base中 |
||||
* Created by fanglei on 2016/12/28. |
||||
*/ |
||||
public abstract class MobileUseHtmlGroupBeanPane<T> extends BasicBeanPane<T> { |
||||
|
||||
private List<UIRadioButton> radioButtons = new ArrayList<UIRadioButton>(); |
||||
|
||||
public MobileUseHtmlGroupBeanPane() { |
||||
initComponents(); |
||||
} |
||||
|
||||
private void initComponents() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
this.setBorder(UITitledBorder.createBorderWithTitle(this.title4PopupWindow())); |
||||
|
||||
double p = TableLayout.PREFERRED; |
||||
double[] rowSize = {p, p}; |
||||
double[] columnSize = {p, p, p}; |
||||
|
||||
UIRadioButton useApp = new UIRadioButton(Inter.getLocText("FR-mobile_native_analysis")); |
||||
useApp.setSelected(true); |
||||
UIRadioButton useHTML5 = new UIRadioButton(Inter.getLocText("FR-mobile_html_analysis")); |
||||
|
||||
addToButtonGroup(useApp, useHTML5); |
||||
|
||||
Component[][] components = new Component[][]{ |
||||
new Component[]{new UILabel(Inter.getLocText("FR-mobile_analysis_style")), useApp, useHTML5}, |
||||
new Component[]{new UILabel(Inter.getLocText("FR-mobile_analysis_annotation")), null, null} |
||||
}; |
||||
JPanel usePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
||||
usePane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); |
||||
|
||||
this.add(usePane); |
||||
} |
||||
|
||||
private void addToButtonGroup(UIRadioButton... radios) { |
||||
ButtonGroup buttonGroup = new ButtonGroup(); |
||||
for (UIRadioButton radio : radios) { |
||||
radioButtons.add(radio); |
||||
buttonGroup.add(radio); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 设置按钮状态 |
||||
*/ |
||||
public void setEnabled(boolean enabled) { |
||||
for (UIRadioButton radioButton : radioButtons) { |
||||
radioButton.setEnabled(enabled); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 获取当前选中的按钮index |
||||
* |
||||
* @return 按钮index |
||||
*/ |
||||
public int getSelectRadioIndex() { |
||||
for (int i = 0, len = radioButtons.size(); i < len; i++) { |
||||
if (radioButtons.get(i).isSelected()) { |
||||
return i; |
||||
} |
||||
} |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
/** |
||||
* 选中指定index的按钮 |
||||
*/ |
||||
public void selectIndexButton(int index) { |
||||
if (index < 0 || index > radioButtons.size() - 1) { |
||||
return; |
||||
} |
||||
|
||||
UIRadioButton button = radioButtons.get(index); |
||||
button.setSelected(true); |
||||
} |
||||
|
||||
/** |
||||
* 给所有的按钮加上监听 |
||||
*/ |
||||
public void addActionListener(ActionListener actionListener) { |
||||
for (UIRadioButton radioButton : radioButtons) { |
||||
radioButton.addActionListener(actionListener); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return Inter.getLocText("FR-mobile_report_analysis"); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,53 @@
|
||||
package com.fr.design.style.background; |
||||
|
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.general.Background; |
||||
import com.fr.general.Inter; |
||||
|
||||
/** |
||||
* Created by ibm on 2017/1/5. |
||||
*/ |
||||
public class BackgroundButtonPane extends BackgroundPane { |
||||
|
||||
|
||||
public BackgroundButtonPane() { |
||||
super(); |
||||
} |
||||
|
||||
protected void initTabPane() { |
||||
int index = 0; |
||||
for (Class<? extends Background> key : BackgroundFactory.buttonKindsOfKey()) { |
||||
BackgroundUIWrapper wrapper = BackgroundFactory.getButtonWrapper(key); |
||||
wrapper.setIndex(index++); |
||||
tabbedPane.addTab(Inter.getLocText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane()); |
||||
} |
||||
} |
||||
|
||||
protected BackgroundUIWrapper getBackgroundUIWrapper(Background background) { |
||||
return BackgroundFactory.getButtonWrapper(background == null ? null : background.getClass()); |
||||
} |
||||
|
||||
protected BackgroundDetailPane getTabItemPane(Background background, int index) { |
||||
BackgroundDetailPane quickPane = cacheMap.get(index); |
||||
if (quickPane == null) { |
||||
quickPane = BackgroundFactory.createButtonIfAbsent(background == null ? null : background.getClass()); |
||||
quickPane.addChangeListener(backgroundChangeListener); |
||||
cacheMap.put(index, quickPane); |
||||
} |
||||
tabbedPane.setComponentAt(index, quickPane); |
||||
tabbedPane.setSelectedIndex(index); |
||||
return quickPane; |
||||
} |
||||
|
||||
protected BackgroundDetailPane getTabItemPaneByIndex(int index) { |
||||
BackgroundDetailPane quickPane = cacheMap.get(index); |
||||
if (quickPane == null) { |
||||
quickPane = BackgroundFactory.createButtonIfAbsent(index); |
||||
tabbedPane.setComponentAt(index, quickPane); |
||||
cacheMap.put(index, quickPane); |
||||
quickPane.addChangeListener(backgroundChangeListener); |
||||
} |
||||
return quickPane; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,79 @@
|
||||
package com.fr.design.style.background.impl; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.base.background.ImageBackground; |
||||
import com.fr.design.gui.ibutton.UIButton; |
||||
import com.fr.general.Background; |
||||
import com.fr.general.Inter; |
||||
import com.fr.stable.Constants; |
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
|
||||
/** |
||||
* Created by ibm on 2017/1/5. |
||||
*/ |
||||
public class ImageButtonBackgroundPane extends ImageBackgroundPane { |
||||
private UIButton chooseButton; |
||||
private UIButton clearButton; |
||||
|
||||
public ImageButtonBackgroundPane(){ |
||||
super(); |
||||
Style imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_CENTER); |
||||
previewPane.setImageStyle(imageStyle); |
||||
} |
||||
|
||||
public JPanel initSelectFilePane(){ |
||||
|
||||
JPanel choosePane = new JPanel(new BorderLayout(0, 10)); |
||||
choosePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
||||
JPanel choosePane1 = new JPanel(new BorderLayout(0, 10)); |
||||
initButton(); |
||||
|
||||
choosePane.add(chooseButton, BorderLayout.NORTH); |
||||
|
||||
choosePane1.add(clearButton,BorderLayout.NORTH); |
||||
choosePane.add(choosePane1,BorderLayout.CENTER); |
||||
|
||||
imageSizeLabel.setHorizontalAlignment(SwingConstants.CENTER); |
||||
choosePane1.add(imageSizeLabel,BorderLayout.CENTER); |
||||
this.add(choosePane,BorderLayout.EAST); |
||||
|
||||
return choosePane; |
||||
} |
||||
|
||||
private void initButton() { |
||||
chooseButton = new UIButton(Inter.getLocText("FR-Designer_Background_Image_Select")); |
||||
chooseButton.addActionListener(selectPictureActionListener); |
||||
clearButton = new UIButton(Inter.getLocText("FR-Designer_Background_Clear")); |
||||
clearButton.addActionListener(new ActionListener() { |
||||
public void actionPerformed(ActionEvent e) { |
||||
previewPane.setImage(null); |
||||
previewPane.repaint(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
public void imageStyleRepaint(){ |
||||
|
||||
} |
||||
|
||||
|
||||
public void populate(Background background) { |
||||
if(background != null && background instanceof ImageBackground){ |
||||
ImageBackground imageBackground = (ImageBackground) background; |
||||
if(imageBackground.getImage() != null) { |
||||
previewPane.setImage(imageBackground.getImage()); |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
public Background update() { |
||||
if(previewPane.getImage() == null) { |
||||
return null; |
||||
} |
||||
return new ImageBackground(previewPane.getImage()); |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.fr.design.form.mobile; |
||||
|
||||
import com.fr.design.dialog.mobile.MobileUseHtmlGroupBeanPane; |
||||
import com.fr.form.main.mobile.FormMobileAttr; |
||||
|
||||
/** |
||||
* 直接copyreport中的MobileUseHtmlGroupPane |
||||
* Created by fanglei on 2016/12/28. |
||||
*/ |
||||
public class MobileUseHtmlGroupPane extends MobileUseHtmlGroupBeanPane<FormMobileAttr> { |
||||
@Override |
||||
public void populateBean(FormMobileAttr mobileAttr) { |
||||
if(mobileAttr != null) { |
||||
selectIndexButton(mobileAttr.isUseHTML() ? 1 : 0); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public FormMobileAttr updateBean() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void updateBean(FormMobileAttr mobileAttr) { |
||||
if(mobileAttr != null) { |
||||
mobileAttr.setUseHTML(getSelectRadioIndex() == 1); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue