Browse Source

代码修改

research/11.0
kerry 4 years ago
parent
commit
c02a4e970d
  1. 16
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/PredefinedBackgroundSettingPane.java
  3. 6
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java
  4. 17
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java

16
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java

@ -18,6 +18,8 @@ import com.fr.log.FineLoggerFactory;
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.Dimension;
import java.awt.Label;
@ -33,6 +35,7 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
private ComponentStyleSettingPane componentStyleSettingPane;
private PredefinedStyleSelectPane selectPane;
private boolean isPopulating = false;
private UITabbedPane uiTabbedPane;
@Override
protected JPanel createContentPane() {
@ -52,7 +55,8 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
}
public void valueChangeAction() {
previewPane.refresh(this.update());
boolean displayFormBackground = backgroundSettingPane.currentFormBackground() || uiTabbedPane.getSelectedIndex() == 3;
previewPane.refresh(this.update(), displayFormBackground);
}
@Override
@ -122,12 +126,17 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
JPanel titlePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Custom_Detail"));
titlePane.setLayout(FRGUIPaneFactory.createLeftZeroLayout());
jPanel.add(titlePane, BorderLayout.CENTER);
UITabbedPane uiTabbedPane = new UITabbedPane();
uiTabbedPane = new UITabbedPane();
uiTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Template_Background"), createTemplateBackgroundSettingPane());
uiTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Cell_Style"), createCellStyleSettingPane());
uiTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Chart_Style"), createChartStyleSettingPane());
uiTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Component_Style"), createComponentStyleSettingPane());
uiTabbedPane.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
valueChangeAction();
}
});
titlePane.add(uiTabbedPane);
titlePane.setPreferredSize(new Dimension(333, 320));
return jPanel;
@ -175,6 +184,7 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
this.backgroundSettingPane.populateBean(previewObject.getPredefinedBackground());
this.cellStyleSettingPane.populateBean(previewObject.getCellStyleMap());
this.componentStyleSettingPane.populateBean(previewObject.getComponentStyle());
previewPane.refresh(previewObject);
isPopulating = false;
}

4
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/PredefinedBackgroundSettingPane.java

@ -59,6 +59,10 @@ public class PredefinedBackgroundSettingPane extends BasicBeanPane<PredefinedBac
this.buttonGroup.setSelectedIndex(0);
}
public boolean currentFormBackground() {
return buttonGroup.getSelectedIndex() == 1;
}
@Override
public void populateBean(PredefinedBackground predefinedBackground) {
reportBackgroundSettingPane.populateBean(predefinedBackground.getReportBackground());

6
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java

@ -68,8 +68,12 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane {
}
public void refresh(PredefinedStyle style) {
refresh(style, false);
}
public void refresh(PredefinedStyle style, boolean displayFormBackground) {
elementCasePreview.refresh(style);
background = style.getReportBackground();
background = displayFormBackground ? style.getFormBackground().getBackground() : style.getReportBackground();
this.repaint();
}

17
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java

@ -8,9 +8,7 @@ import com.fr.config.ServerPreferenceConfig;
import com.fr.config.StyleMap;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.AttrScrollPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.dialog.MultiTabPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.icombobox.UIComboBox;
@ -31,9 +29,9 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.util.ArrayList;
import java.util.List;
@ -56,17 +54,10 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane<N
@Override
protected JPanel createCustomDetailPane() {
JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
customPredefinedStylePane = new CustomStylePane();
BasicScrollPane basicScrollPane = new AttrScrollPane() {
@Override
protected JPanel createContentPane() {
return customPredefinedStylePane;
}
};
basicScrollPane.setPreferredSize(new Dimension(233, 214));
panel.add(basicScrollPane);
return panel;
jPanel.add(customPredefinedStylePane, BorderLayout.CENTER);
return jPanel;
}
protected JPanel createPredefinedSettingPane() {

Loading…
Cancel
Save