Browse Source

REPORT-5908 && REPORT-6110 设计器下拉菜单、右击菜单视觉调整缩放弹窗也改成圆角样式;设计器模板内存智能优化优化了一下模板激活时间,去掉激活时刷新右侧面板调用

master
plough 7 years ago
parent
commit
c6a942790a
  1. 24
      designer-base/src/com/fr/design/DesignerEnvManager.java
  2. 22
      designer-base/src/com/fr/design/actions/file/PreferencePane.java
  3. 2
      designer-base/src/com/fr/design/file/HistoryTemplateListPane.java
  4. 3
      designer-base/src/com/fr/design/file/MutilTempalteTabPane.java
  5. 2
      designer-base/src/com/fr/design/mainframe/DesignerFrame.java
  6. 27
      designer-base/src/com/fr/design/mainframe/JSliderPane.java
  7. 4
      designer-base/src/com/fr/design/mainframe/JVirtualTemplate.java

24
designer-base/src/com/fr/design/DesignerEnvManager.java

@ -61,6 +61,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private static final int MAX_SHOW_NUM = 10;
private static final String VERSION_80 = "80";
private static final int CACHINGTEMPLATE_LIMIT = 5;
private static DesignerEnvManager designerEnvManager; // gui.
private String activationKey = null;
@ -99,6 +100,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private int language;
//2014-8-26默认显示全部, 因为以前的版本, 虽然是false, 实际上是显示所有表, 因此这边要兼容
private boolean useOracleSystemSpace = true;
private int cachingTemplateLimit = CACHINGTEMPLATE_LIMIT;
private boolean autoBackUp = true;
private int undoLimit = 5;
private short pageLengthUnit = Constants.UNIT_MM;
@ -244,7 +246,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
// 写文件的LogLocation
String logLocation = DesignerEnvManager.getEnvManager().getLogLocation();
if (logLocation != null) {
//Mac下8.0,9.0 选项-日志设置为空时在根目录下检测文件存在会抛无权限,这里应该设个默认值比较好吧
if (StringUtils.isNotEmpty(logLocation)) {
try {
Calendar calender = GregorianCalendar.getInstance();
calender.setTimeInMillis(System.currentTimeMillis());
@ -629,6 +632,21 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.useOracleSystemSpace = displayOracleSystem;
}
/**
* 配置最大缓存模板个数
*/
public void setCachingTemplateLimit(int cachingTemplateLimit) {
this.cachingTemplateLimit = cachingTemplateLimit;
}
/**
* 获取最大缓存模板个数
*/
public int getCachingTemplateLimit() {
return this.cachingTemplateLimit;
}
/**
* 是否加入产品改良
*
@ -1392,6 +1410,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.setMaxNumberOrPreviewRow(reader.getAttrAsInt("maxNumberOrPreviewRow", 200));
this.setOracleSystemSpace(reader.getAttrAsBoolean("useOracleSystemSpace", true));
this.setCachingTemplateLimit(reader.getAttrAsInt("cachingTemplateLimit", CACHINGTEMPLATE_LIMIT));
this.setJoinProductImprove(reader.getAttrAsBoolean("joinProductImprove", true));
this.setAutoBackUp(reader.getAttrAsBoolean("autoBackUp", true));
this.setTemplateTreePaneExpanded(reader.getAttrAsBoolean("templateTreePaneExpanded", false));
@ -1612,6 +1631,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (!this.isOracleSystemSpace()) {
writer.attr("useOracleSystemSpace", this.isOracleSystemSpace());
}
if (this.getCachingTemplateLimit() >= 0) {
writer.attr("cachingTemplateLimit", this.getCachingTemplateLimit());
}
if (!this.isJoinProductImprove()) {
writer.attr("joinProductImprove", this.isJoinProductImprove());
}

22
designer-base/src/com/fr/design/actions/file/PreferencePane.java

@ -14,6 +14,7 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
@ -55,6 +56,9 @@ public class PreferencePane extends BasicPane {
private static final int MAX_UNDO_LIMIT_50 = 50;
private static final int SELECTED_INDEX_4 = 4;
private static final int SELECTED_INDEX_5 = 5;
private static final int CACHING_MAX = 10;
private static final int CACHING_DEFAULT = 5;
private static final int CACHING_GAP = 5;
private static final String TYPE = "pressed";
private static final String DISPLAY_TYPE = "+";
@ -113,6 +117,7 @@ public class PreferencePane extends BasicPane {
private IntegerEditor portEditor;
private UITextField jdkHomeTextField;
private UICheckBox oracleSpace;
private UISpinner cachingTemplateSpinner;
private UICheckBox joinProductImprove;
public PreferencePane() {
@ -173,6 +178,7 @@ public class PreferencePane extends BasicPane {
JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
spaceUpPane.add(oraclePane, BorderLayout.NORTH);
spaceUpPane.add(createMemoryPane(), BorderLayout.CENTER);
spaceUpPane.add(improvePane, BorderLayout.SOUTH);
advancePane.add(spaceUpPane);
}
@ -497,6 +503,20 @@ public class PreferencePane extends BasicPane {
serverPortPane.add(choosePortPane, BorderLayout.CENTER);
}
private JPanel createMemoryPane() {
JPanel memoryPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Preference_CachingTemplate"));
UILabel memoryLabel = new UILabel(Inter.getLocText("FR-Designer_Preference_MaxCachingTemplate"));
UILabel memoryTipLabel = new UILabel(Inter.getLocText("FR-Designer_Preference_CachingTemplateTip"));
memoryTipLabel.setBorder(BorderFactory.createEmptyBorder( 0, CACHING_GAP, 0, 0));
cachingTemplateSpinner = new UISpinner(0, CACHING_MAX, 1, CACHING_DEFAULT);
JPanel memorySpace = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());
memorySpace.add(memoryLabel);
memorySpace.add(cachingTemplateSpinner);
memorySpace.add(memoryTipLabel);
memoryPane.add(memorySpace);
return memoryPane;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("M_Window-Preference");
@ -555,6 +575,7 @@ public class PreferencePane extends BasicPane {
this.jdkHomeTextField.setText(designerEnvManager.getJdkHome());
this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace());
this.cachingTemplateSpinner.setValue(designerEnvManager.getCachingTemplateLimit());
this.joinProductImprove.setSelected(designerEnvManager.isJoinProductImprove());
}
@ -615,6 +636,7 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setJdkHome(jdkHomeTextField.getText());
designerEnvManager.setOracleSystemSpace(this.oracleSpace.isSelected());
designerEnvManager.setCachingTemplateLimit((int) this.cachingTemplateSpinner.getValue());
designerEnvManager.setJoinProductImprove(this.joinProductImprove.isSelected());
// designerEnvManager.setAutoBackUp(this.autoBackUp.isSelected());

2
designer-base/src/com/fr/design/file/HistoryTemplateListPane.java

@ -35,7 +35,7 @@ import java.util.List;
public class HistoryTemplateListPane extends JPanel implements FileOperations, CallbackEvent {
//最大保存内存中面板数,为0时关闭优化内存
private static final int DEAD_LINE = 5;
private static final int DEAD_LINE = DesignerEnvManager.getEnvManager().getCachingTemplateLimit();;
private static final int LIST_BORDER = 4;
private List<JTemplate<?, ?>> historyList;
private JTemplate<?, ?> editingTemplate;

3
designer-base/src/com/fr/design/file/MutilTempalteTabPane.java

@ -16,6 +16,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants;
import com.fr.stable.project.ProjectConstants;
@ -709,7 +710,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
filename = ((FileNodeFILE) openedTemplate.get(selectedIndex).getEditingFILE()).getEnvPath() + File.separator + filename;
}
filename = filename.replaceAll("/", "\\\\");
filename = OperatingSystem.isWindows() ? filename.replaceAll("/", "\\\\") : filename.replaceAll("\\\\", "/");
if (!specifiedTemplate.isALLSaved()) {
specifiedTemplate.stopEditing();

2
designer-base/src/com/fr/design/mainframe/DesignerFrame.java

@ -929,8 +929,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} else {
this.addAndActivateJTemplate(jt);
}
//REPORT-5084:激活后刷新一下右側面板
jt.refreshEastPropertiesPane();
}
/**

27
designer-base/src/com/fr/design/mainframe/JSliderPane.java

@ -6,6 +6,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ibutton.UISliderButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.gui.islider.UISlider;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinnerUI;
@ -21,7 +22,6 @@ import javax.swing.JButton;
import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JRadioButton;
import javax.swing.JSeparator;
import javax.swing.JSpinner;
@ -41,6 +41,7 @@ import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
@ -59,22 +60,15 @@ public class JSliderPane extends JPanel {
private static final double ONEPOINTEIGHT = 1.8;
private static final int SIX = 6;
private static final int TEN = 10;
private static final int ONE_EIGHT = 18;
private static final int FONT_SIZE = 12;
private static final int SPINNER_WIDTH = 45;
private static final int SPINNER_HEIGHT = 20;
private static final int HALF_HUNDRED = 50;
private static final int HUNDRED = 100;
private static final int TWO_HUNDRED = 200;
private static final int THREE_HUNDRED = 300;
private static final int FOUR_HUNDRED = 400;
private static final int DIALOG_WIDTH = 157;
private static final int DIALOG_HEIGHT = 192;
private static final int SLIDER_WIDTH = 220;
private static final int SLIDER_HEIGHT = 20;
private static final int SHOWVALBUTTON_WIDTH = 40;
private static final int SHOWVALBUTTON_HEIGHTH = 20;
private static final int SLIDER_GAP = 5;
private static final int TOOLTIP_Y = 30;
private static final Color BACK_COLOR = new Color(245, 245, 247);
@ -427,14 +421,14 @@ public class JSliderPane extends JPanel {
dialog = new PopupPane(upButton, dialogContentPanel);
if (upButtonX == 0) {
upButtonX = btnCoords.x;
GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT);
GUICoreUtils.showPopupMenu(dialog, upButton, -dialog.getPreferredSize().width + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -dialog.getPreferredSize().height);
}
} else {
if (upButtonX == 0) {
upButtonX = btnCoords.x;
GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT);
GUICoreUtils.showPopupMenu(dialog, upButton, -dialog.getPreferredSize().width + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -dialog.getPreferredSize().height);
} else {
GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT);
GUICoreUtils.showPopupMenu(dialog, upButton, -dialog.getPreferredSize().width + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -dialog.getPreferredSize().height);
}
}
}
@ -503,9 +497,12 @@ class JSliderPaneUI extends BasicSliderUI {
}
class PopupPane extends JPopupMenu {
class PopupPane extends UIPopupMenu {
private static final float REC = 8f;
private static final int INSERT_TOPBOTTOM = 10;
private static final int INSERT_LEFTRIGHT = 2;
private static final int DIALOG_WIDTH = 157;
private static final int DIALOG_HEIGHT = 192;
private static final int DIALOG_HEIGHT = 205;
PopupPane(JButton b, JPanel dialogContentPanel) {
this.add(dialogContentPanel, BorderLayout.CENTER);
@ -513,5 +510,7 @@ class PopupPane extends JPopupMenu {
this.setBackground(new Color(245, 245, 247));
}
public Insets getInsets() {
return new Insets(INSERT_TOPBOTTOM, INSERT_LEFTRIGHT, INSERT_TOPBOTTOM, INSERT_LEFTRIGHT);
}
}

4
designer-base/src/com/fr/design/mainframe/JVirtualTemplate.java

@ -12,6 +12,7 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.file.FILE;
import com.fr.file.FileNodeFILE;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
@ -41,7 +42,8 @@ public class JVirtualTemplate extends JTemplate {
if (editingFileName.startsWith(ProjectConstants.REPORTLETS_NAME)) {
editingFileName = ((FileNodeFILE) getEditingFILE()).getEnvPath() + File.separator + editingFileName;
}
return editingFileName.replaceAll("/", "\\\\");
editingFileName = OperatingSystem.isWindows() ? editingFileName.replaceAll("/", "\\\\") : editingFileName.replaceAll("\\\\", "/");
return editingFileName;
}
/**

Loading…
Cancel
Save