Browse Source

newui缩放

fbp/merge
renekton 7 months ago
parent
commit
3d585c092c
  1. 12
      designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java
  2. 41
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java
  3. 26
      designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java

12
designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java

@ -32,6 +32,9 @@ import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
public class JavaEditorPane extends BasicPane { public class JavaEditorPane extends BasicPane {
private RSyntaxTextArea javaText; private RSyntaxTextArea javaText;
@ -83,13 +86,12 @@ public class JavaEditorPane extends BasicPane {
} }
UIScrollPane jt = new UIScrollPane(javaText); UIScrollPane jt = new UIScrollPane(javaText);
JPanel toolbarPane = new JPanel(new FlowLayout(FlowLayout.LEFT)); JPanel toolbarPane = new JPanel(new BorderLayout());
UIButton saveButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save")); UIButton saveButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save"));
saveButton.setAction(new SaveAction()); saveButton.setAction(new SaveAction());
UIButton compileButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Compile")); UIButton compileButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Compile"));
compileButton.setAction(new CompilerAction()); compileButton.setAction(new CompilerAction());
toolbarPane.add(saveButton); toolbarPane.add(row(8, cell(saveButton), cell(compileButton)).getComponent());
toolbarPane.add(compileButton);
this.add(toolbarPane, BorderLayout.NORTH); this.add(toolbarPane, BorderLayout.NORTH);
this.add(jt, BorderLayout.CENTER); this.add(jt, BorderLayout.CENTER);
@ -155,7 +157,7 @@ public class JavaEditorPane extends BasicPane {
private void saveTextToFile(String text) { private void saveTextToFile(String text) {
if (StringUtils.isEmpty(text)) { if (StringUtils.isEmpty(text)) {
return; return;
} }
if (StringUtils.isEmpty(className)) { if (StringUtils.isEmpty(className)) {
return; return;
@ -180,7 +182,7 @@ public class JavaEditorPane extends BasicPane {
@Override @Override
protected JavaCompileInfo doInBackground() throws Exception { protected JavaCompileInfo doInBackground() throws Exception {
return FRContext.getCommonOperator().compile(javaText.getText()); return FRContext.getCommonOperator().compile(javaText.getText());
} }

41
designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -93,12 +93,11 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
outReportEnginePane.add(createReportEnginePane()); outReportEnginePane.add(createReportEnginePane());
JPanel outAdvicePane = new JPanel(); JPanel outAdvicePane = new JPanel();
outAdvicePane.setLayout(FRGUIPaneFactory.createBorderLayout()); outAdvicePane.setLayout(FRGUIPaneFactory.createBorderLayout());
outAdvicePane.setPreferredSize(new Dimension(FineUIScale.scale(600), FineUIScale.scale(160)));
outAdvicePane.add(createAdvicePane()); outAdvicePane.add(createAdvicePane());
this.add(column(20, this.add(column(20,
cell(wrapComponentWithTitle(outReportEnginePane, Toolkit.i18nText("Fine-Design_Report_Report_Engine_Attribute"))), cell(wrapComponentWithTitle(outReportEnginePane, Toolkit.i18nText("Fine-Design_Report_Report_Engine_Attribute"))),
cell(wrapComponentWithTitle(outPagingEngineSelectPane, Toolkit.i18nText("Fine-Design_Report_Paging_Engine_Select"))).weight(1.0), cell(wrapComponentWithTitle(outPagingEngineSelectPane, Toolkit.i18nText("Fine-Design_Report_Paging_Engine_Select"))),
cell(wrapComponentWithTitle(outAdvicePane, Toolkit.i18nText("Fine-Design_Report_Advice")))) cell(wrapComponentWithTitle(outAdvicePane, Toolkit.i18nText("Fine-Design_Report_Advice"))))
.getComponent()); .getComponent());
} }
@ -123,8 +122,6 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
createEngineXSettingPane(); createEngineXSettingPane();
createLineEngineSettingPane(); createLineEngineSettingPane();
outLineEngineSettingPane.setVisible(false); outLineEngineSettingPane.setVisible(false);
outEngineXSettingPane.setPreferredSize(new Dimension(scale(625), scale(220)));
outLineEngineSettingPane.setPreferredSize(new Dimension(scale(625), scale(220)));
engineSettingPane.add(box(cell(outEngineXSettingPane), engineSettingPane.add(box(cell(outEngineXSettingPane),
cell(outLineEngineSettingPane)).getComponent() cell(outLineEngineSettingPane)).getComponent()
, BorderLayout.WEST); , BorderLayout.WEST);
@ -157,18 +154,18 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
rowCountPanel.add(rowCountBox); rowCountPanel.add(rowCountBox);
JPanel tip = createTipPane(Toolkit.i18nText("Fine-Design_Report_Engine_X_tip")); JPanel tip = createTipPane(Toolkit.i18nText("Fine-Design_Report_Engine_X_tip"));
engineXSettingPane.add(row(20, engineXSettingPane.add(row(20,
column(10, column(
column(fix(6), cell(title)), column(fix(6), cell(title)),
cell(new UILabel()), cell(new UILabel()),
cell(new UILabel()), cell(new UILabel()),
cell(new UILabel()) cell(new UILabel())
), ),
column(10, column(
cell(pageQueryBoxPanel), cell(pageQueryBoxPanel),
cell(engineXPageQueryPane), cell(engineXPageQueryPane),
cell(rowCountPanel), cell(rowCountPanel),
cell(tip))) cell(tip)))
.getComponent()); .getComponent());
outEngineXSettingPane.add(engineXSettingPane); outEngineXSettingPane.add(engineXSettingPane);
} }
@ -189,14 +186,14 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
lineEnginePageQueryBox.addActionListener(new SelectActionListener(lineEnginePageQueryBox, lineEnginePageQueryPane)); lineEnginePageQueryBox.addActionListener(new SelectActionListener(lineEnginePageQueryBox, lineEnginePageQueryPane));
JPanel tipPane = createTipPane(Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip")); JPanel tipPane = createTipPane(Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip"));
lineEngineSettingPane.add(row(20, lineEngineSettingPane.add(row(20,
column(10, column(
column(fix(6), cell(title)), column(fix(6), cell(title)),
cell(new UILabel()), cell(new UILabel()),
cell(new UILabel())), cell(new UILabel())),
column(10, column(
cell(pageQueryBoxPanel), cell(pageQueryBoxPanel),
cell(lineEnginePageQueryPane), cell(lineEnginePageQueryPane),
cell(tipPane))) cell(tipPane)))
.getComponent()); .getComponent());
outLineEngineSettingPane.add(lineEngineSettingPane); outLineEngineSettingPane.add(lineEngineSettingPane);
} }

26
designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java

@ -37,11 +37,11 @@ public class WriteShortCutsPane extends JPanel{
private UILabel nextRowHK; private UILabel nextRowHK;
private UILabel preCol; private UILabel preCol;
private UILabel preRow; private UILabel preRow;
public WriteShortCutsPane(){ public WriteShortCutsPane(){
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(createContentPane(), BorderLayout.NORTH); this.add(createContentPane(), BorderLayout.NORTH);
if(!ServerPreferenceConfig.getInstance().isWriteShortCuts()){ if(!ServerPreferenceConfig.getInstance().isWriteShortCuts()){
nextColString = "Enter"; nextColString = "Enter";
nextRowString = "Tab"; nextRowString = "Tab";
@ -60,10 +60,10 @@ public class WriteShortCutsPane extends JPanel{
return contentPane; return contentPane;
} }
private JPanel getFeatureNamePane(){ private JPanel getFeatureNamePane(){
JPanel featureNamePane = new JPanel(new BorderLayout()); JPanel featureNamePane = new JPanel(new BorderLayout());
featureNamePane.setBorder(BorderFactory.createEmptyBorder(16, 0, 0, 0)); featureNamePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
UILabel name = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Feature_Name"), SwingConstants.RIGHT); UILabel name = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Feature_Name"), SwingConstants.RIGHT);
UILabel nextCol = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Column"), SwingConstants.CENTER); UILabel nextCol = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Column"), SwingConstants.CENTER);
UILabel nextRow = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Row"), SwingConstants.CENTER); UILabel nextRow = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Row"), SwingConstants.CENTER);
@ -75,13 +75,13 @@ public class WriteShortCutsPane extends JPanel{
JPanel centerPane = new JPanel(new BorderLayout()); JPanel centerPane = new JPanel(new BorderLayout());
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); centerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
centerPane.add(column(24, centerPane.add(column(10,
row(10, cell(name).weight(0.13), cell(nextCol).weight(0.15), cell(new JPanel()).weight(0.12), cell(nextRow).weight(0.15), flex(0.45)), row(10, cell(name).weight(0.13), cell(nextCol).weight(0.15), cell(new JPanel()).weight(0.12), cell(nextRow).weight(0.15), flex(0.45)),
row(10, cell(shortName).weight(0.13), cell(nextColHK).weight(0.15), cell(switchBtnPane).weight(0.12), cell(nextRowHK).weight(0.15), flex(0.45)) row(10, cell(shortName).weight(0.13), cell(nextColHK).weight(0.15), cell(switchBtnPane).weight(0.12), cell(nextRowHK).weight(0.15), flex(0.45))
).getComponent()); ).getComponent());
featureNamePane.add(centerPane, BorderLayout.CENTER); featureNamePane.add(centerPane, BorderLayout.CENTER);
return featureNamePane; return featureNamePane;
} }
@ -96,7 +96,7 @@ public class WriteShortCutsPane extends JPanel{
private JPanel getHintsPane(){ private JPanel getHintsPane(){
JPanel hintsPane = new JPanel(new BorderLayout()); JPanel hintsPane = new JPanel(new BorderLayout());
hintsPane.setBorder(BorderFactory.createEmptyBorder(16, 0, 0, 0)); hintsPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
UILabel systemDefault = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_System_Default"), SwingConstants.RIGHT); UILabel systemDefault = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_System_Default"), SwingConstants.RIGHT);
UILabel preColText = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Previous_Column"), SwingConstants.CENTER); UILabel preColText = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Previous_Column"), SwingConstants.CENTER);
@ -107,19 +107,19 @@ public class WriteShortCutsPane extends JPanel{
JPanel centerPane = new JPanel(new BorderLayout()); JPanel centerPane = new JPanel(new BorderLayout());
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); centerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
centerPane.add(column(24, centerPane.add(column(10,
row(10, cell(systemDefault).weight(0.13), cell(preColText).weight(0.24), cell(preCol).weight(0.14), flex(0.64)), row(10, cell(systemDefault).weight(0.13), cell(preColText).weight(0.24), cell(preCol).weight(0.14), flex(0.64)),
row(10, cell(new JPanel()).weight(0.13), cell(preRowText).weight(0.24), cell(preRow).weight(0.14), flex(0.64)) row(10, cell(new JPanel()).weight(0.13), cell(preRowText).weight(0.24), cell(preRow).weight(0.14), flex(0.64))
).getComponent()); ).getComponent());
hintsPane.add(centerPane, BorderLayout.CENTER); hintsPane.add(centerPane, BorderLayout.CENTER);
return hintsPane; return hintsPane;
} }
public ActionListener getListener(){ public ActionListener getListener(){
ActionListener actionListener = new ActionListener() { ActionListener actionListener = new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String temp= nextColString; String temp= nextColString;
@ -136,10 +136,10 @@ public class WriteShortCutsPane extends JPanel{
}); });
} }
}; };
return actionListener; return actionListener;
} }
private void switchColRow(){ private void switchColRow(){
nextColHK.setText(nextColString); nextColHK.setText(nextColString);
nextRowHK.setText(nextRowString); nextRowHK.setText(nextRowString);

Loading…
Cancel
Save