Browse Source

Merge branch 'release/9.0' of http://www.finedevelop.com:2015/scm/~plough/design into release/9.0

master
plough 7 years ago
parent
commit
7302ca7ae4
  1. 2
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  2. 2
      designer/src/com/fr/design/mainframe/JWorkBook.java
  3. 3
      designer/src/com/fr/design/mainframe/ReportComponentComposite.java
  4. 134
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  5. 4
      designer/src/com/fr/design/mainframe/alphafine/preview/PluginPreviewPane.java
  6. 5
      designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java
  7. 7
      designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java
  8. 5
      designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java
  9. 8
      designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java
  10. 3
      designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java
  11. 10
      designer/src/com/fr/start/CollectUserInformationDialog.java
  12. 3
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  13. 34
      designer_base/src/com/fr/design/extra/PluginStoreConstants.java
  14. 7
      designer_base/src/com/fr/design/extra/WebViewDlgHelper.java
  15. 2
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  16. 2
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  17. 2
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  18. 2
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  19. 2
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  20. 2
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  21. 4
      designer_base/src/com/fr/design/scrollruler/HorizontalRulerUI.java
  22. 4
      designer_base/src/com/fr/design/scrollruler/VerticalRulerUI.java

2
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -47,7 +47,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
this.addSelectionChangeListener(new SelectionListener() { this.addSelectionChangeListener(new SelectionListener() {
@Override @Override
public void selectionChanged(SelectionEvent e) { public void selectionChanged(SelectionEvent e) {
if (!isEditable()) { if (!isEditable() && !BaseUtils.isAuthorityEditing()) {
return; return;
} }
doOnSelectionChanged(e); doOnSelectionChanged(e);

2
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -92,7 +92,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
private UIModeControlContainer centerPane; private UIModeControlContainer centerPane;
public ReportComponentComposite reportComposite; public ReportComponentComposite reportComposite;
private ParameterDefinitePane parameterPane; private ParameterDefinitePane parameterPane;
private int resolution; private int resolution = ScreenResolution.getScreenResolution();
public JWorkBook() { public JWorkBook() {
super(new WorkBook(new WorkSheet()), "WorkBook"); super(new WorkBook(new WorkSheet()), "WorkBook");

3
designer/src/com/fr/design/mainframe/ReportComponentComposite.java

@ -33,6 +33,7 @@ public class ReportComponentComposite extends JComponent {
private static final int MAX = 400; private static final int MAX = 400;
private static final int HUND = 100; private static final int HUND = 100;
private static final int MIN = 10; private static final int MIN = 10;
private static final int DIR = 15;
private JWorkBook parent; private JWorkBook parent;
private UIModeControlContainer parentContainer = null; private UIModeControlContainer parentContainer = null;
@ -71,7 +72,7 @@ public class ReportComponentComposite extends JComponent {
if (InputEventBaseOnOS.isControlDown(e)) { if (InputEventBaseOnOS.isControlDown(e)) {
int dir = e.getWheelRotation(); int dir = e.getWheelRotation();
int old_resolution = (int) jSliderContainer.getShowVal().getValue(); int old_resolution = (int) jSliderContainer.getShowVal().getValue();
jSliderContainer.getShowVal().setValue(old_resolution - (dir * MIN)); jSliderContainer.getShowVal().setValue(old_resolution - (dir * DIR));
} }
} }
}; };

134
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -71,6 +71,7 @@ public class AlphaFineDialog extends UIDialog {
private static final String PLUGIN_MARK_SHORT = "k:4 "; private static final String PLUGIN_MARK_SHORT = "k:4 ";
private static final String PLUGIN_MARK = "k:shop "; private static final String PLUGIN_MARK = "k:shop ";
private static final String PLACE_HOLDER = Inter.getLocText("FR-Designer_AlphaFine"); private static final String PLACE_HOLDER = Inter.getLocText("FR-Designer_AlphaFine");
private static final int MAX_SHOW_SIZE = 12;
private AlphaFineTextField searchTextField; private AlphaFineTextField searchTextField;
private UIButton closeButton; private UIButton closeButton;
@ -89,7 +90,6 @@ public class AlphaFineDialog extends UIDialog {
//是否强制打开,因为面板是否关闭绑定了全局鼠标事件,这里需要处理一下 //是否强制打开,因为面板是否关闭绑定了全局鼠标事件,这里需要处理一下
private boolean forceOpen; private boolean forceOpen;
public AlphaFineDialog(Frame parent, boolean forceOpen) { public AlphaFineDialog(Frame parent, boolean forceOpen) {
super(parent); super(parent);
this.forceOpen = forceOpen; this.forceOpen = forceOpen;
@ -161,12 +161,6 @@ public class AlphaFineDialog extends UIDialog {
}); });
topPane.add(closeButton, BorderLayout.EAST); topPane.add(closeButton, BorderLayout.EAST);
add(topPane, BorderLayout.CENTER); add(topPane, BorderLayout.CENTER);
searchTextField.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
doSearch(searchTextField.getText());
}
});
} }
/** /**
@ -174,7 +168,7 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void initSearchTextField() { private void initSearchTextField() {
searchTextField = new AlphaFineTextField(PLACE_HOLDER); searchTextField = new AlphaFineTextField(PLACE_HOLDER);
initTextFieldKeyListener(); initTextFieldListener();
searchTextField.setFont(AlphaFineConstants.GREATER_FONT); searchTextField.setFont(AlphaFineConstants.GREATER_FONT);
searchTextField.setBackground(Color.WHITE); searchTextField.setBackground(Color.WHITE);
searchTextField.setBorderPainted(false); searchTextField.setBorderPainted(false);
@ -228,16 +222,11 @@ public class AlphaFineDialog extends UIDialog {
* @param text * @param text
*/ */
private void doSearch(String text) { private void doSearch(String text) {
showSearchResult(text);
if (StringUtils.isBlank(text) || isNeedSearch(text)) {
removeSearchResult();
} else {
showSearchResult();
}
} }
boolean isNeedSearch(String text) { boolean isNoNeedSearch(String text) {
return ComparatorUtils.equals(PLACE_HOLDER, text) || text.contains("'"); return ComparatorUtils.equals(PLACE_HOLDER, text) || text.contains("'") || StringUtils.isBlank(text);
} }
@Override @Override
@ -272,17 +261,17 @@ public class AlphaFineDialog extends UIDialog {
searchResultPane = null; searchResultPane = null;
} }
setSize(AlphaFineConstants.FIELD_SIZE); setSize(AlphaFineConstants.FIELD_SIZE);
repaint(); refreshContainer();
} }
/** /**
* 展示搜索结果 * 展示搜索结果
*/ */
private void showSearchResult() { private void showSearchResult(String text) {
if (searchResultPane == null) { if (searchResultPane == null) {
initSearchResultComponents(); initSearchResultComponents();
} }
initSearchWorker(); initSearchWorker(text);
} }
/** /**
@ -299,8 +288,8 @@ public class AlphaFineDialog extends UIDialog {
searchResultList.setCellRenderer(new ContentCellRender()); searchResultList.setCellRenderer(new ContentCellRender());
leftSearchResultPane = new UIScrollPane(searchResultList); leftSearchResultPane = new UIScrollPane(searchResultList);
leftSearchResultPane.setBorder(null);
leftSearchResultPane.setBackground(Color.WHITE); leftSearchResultPane.setBackground(Color.WHITE);
leftSearchResultPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
leftSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.LEFT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); leftSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.LEFT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT));
rightSearchResultPane = new JPanel(); rightSearchResultPane = new JPanel();
rightSearchResultPane.setBackground(Color.WHITE); rightSearchResultPane.setBackground(Color.WHITE);
@ -317,7 +306,7 @@ public class AlphaFineDialog extends UIDialog {
/** /**
* 异步加载搜索结果 * 异步加载搜索结果
*/ */
private void initSearchWorker() { private void initSearchWorker(final String text) {
if (this.searchWorker != null && !this.searchWorker.isDone()) { if (this.searchWorker != null && !this.searchWorker.isDone()) {
this.searchWorker.cancel(true); this.searchWorker.cancel(true);
this.searchWorker = null; this.searchWorker = null;
@ -325,9 +314,7 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker = new SwingWorker() { this.searchWorker = new SwingWorker() {
@Override @Override
protected Object doInBackground() throws Exception { protected Object doInBackground() throws Exception {
resumeLeftPane(); rebuildList(text);
splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif")));
rebuildList(searchTextField.getText().toLowerCase());
return null; return null;
} }
@ -347,11 +334,9 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void resumeLeftPane() { private void resumeLeftPane() {
if (searchResultPane != null && defaultPane != null) { if (searchResultPane != null && defaultPane != null) {
rightSearchResultPane.removeAll();
searchResultPane.remove(defaultPane); searchResultPane.remove(defaultPane);
defaultPane = null; defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
refreshContainer();
} }
} }
@ -394,25 +379,26 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void rebuildList(String searchText) { private void rebuildList(String searchText) {
resetContainer(); resetContainer();
if (searchText.startsWith(ADVANCED_SEARCH_MARK)) { if (searchText.startsWith(ADVANCED_SEARCH_MARK)) {
if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) { if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getActionList(storeText); buildActionList(storeText);
} else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) { } else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getDocumentList(storeText); buildDocumentList(storeText);
} else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) { } else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getFileList(storeText); buildFileList(storeText);
} else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) { } else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getFileList(searchText); buildFileList(searchText);
} else if (searchText.startsWith(DS_MARK)) { } else if (searchText.startsWith(DS_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getFileList(DS_NAME + storeText); buildFileList(DS_NAME + storeText);
} else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) { } else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) {
storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length()); storeText = searchText.substring(searchText.indexOf(StringUtils.BLANK) + 1, searchText.length());
getPluginList(storeText); buildPluginList(storeText);
} }
} else { } else {
storeText = searchText.trim(); storeText = searchText.trim();
@ -425,9 +411,11 @@ public class AlphaFineDialog extends UIDialog {
* 重置面板 * 重置面板
*/ */
private void resetContainer() { private void resetContainer() {
rightSearchResultPane.removeAll();
splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif")));
resumeLeftPane();
searchListModel.removeAllElements(); searchListModel.removeAllElements();
searchListModel.resetSelectedState(); searchListModel.resetSelectedState();
rightSearchResultPane.removeAll();
refreshContainer(); refreshContainer();
} }
@ -437,23 +425,22 @@ public class AlphaFineDialog extends UIDialog {
* @param searchText * @param searchText
*/ */
private void doNormalSearch(String searchText) { private void doNormalSearch(String searchText) {
getRecentList(searchText); buildRecentList(searchText);
getRecommendList(searchText); buildRecommendList(searchText);
getActionList(searchText); buildActionList(searchText);
getFileList(searchText); buildFileList(searchText);
getDocumentList(searchText); buildDocumentList(searchText);
getPluginList(searchText); buildPluginList(searchText);
} }
private void getDocumentList(final String searchText) { private void buildDocumentList(final String searchText) {
SearchResult documentModelList = DocumentSearchManager.getDocumentSearchManager().getLessSearchResult(searchText); SearchResult documentModelList = DocumentSearchManager.getDocumentSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : documentModelList) { for (AlphaCellModel object : documentModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
} }
private void getFileList(final String searchText) { private void buildFileList(final String searchText) {
SearchResult fileModelList = FileSearchManager.getFileSearchManager().getLessSearchResult(searchText); SearchResult fileModelList = FileSearchManager.getFileSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : fileModelList) { for (AlphaCellModel object : fileModelList) {
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
@ -461,34 +448,30 @@ public class AlphaFineDialog extends UIDialog {
} }
} }
private void getActionList(final String searchText) { private void buildActionList(final String searchText) {
SearchResult actionModelList = ActionSearchManager.getActionSearchManager().getLessSearchResult(searchText); SearchResult actionModelList = ActionSearchManager.getActionSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : actionModelList) { for (AlphaCellModel object : actionModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
} }
private void getPluginList(final String searchText) { private void buildPluginList(final String searchText) {
SearchResult pluginModelList = PluginSearchManager.getPluginSearchManager().getLessSearchResult(searchText); SearchResult pluginModelList = PluginSearchManager.getPluginSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : pluginModelList) { for (AlphaCellModel object : pluginModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
} }
private void getRecommendList(final String searchText) { private void buildRecommendList(final String searchText) {
SearchResult recommendModelList = RecommendSearchManager.getRecommendSearchManager().getLessSearchResult(searchText); SearchResult recommendModelList = RecommendSearchManager.getRecommendSearchManager().getLessSearchResult(searchText);
for (AlphaCellModel object : recommendModelList) { for (AlphaCellModel object : recommendModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
} }
private void getRecentList(final String searchText) { private void buildRecentList(final String searchText) {
SearchResult recentModelList = RecentSearchManager.getRecentSearchManger().getLessSearchResult(searchText); SearchResult recentModelList = RecentSearchManager.getRecentSearchManger().getLessSearchResult(searchText);
for (AlphaCellModel object : recentModelList) { for (AlphaCellModel object : recentModelList) {
AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModel.addElement(object);
} }
@ -639,11 +622,10 @@ public class AlphaFineDialog extends UIDialog {
} }
} }
private void HandleMoreOrLessResult(int index, MoreModel selectedValue) { private void dealWithMoreOrLessResult(int index, MoreModel selectedValue) {
if (selectedValue.getContent().equals(Inter.getLocText("FR-Designer_AlphaFine_ShowAll"))) { if (ComparatorUtils.equals(Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), selectedValue.getContent())) {
selectedValue.setContent(Inter.getLocText("FR-Designer_AlphaFine_ShowLess")); selectedValue.setContent(Inter.getLocText("FR-Designer_AlphaFine_ShowLess"));
rebuildShowMoreList(index, selectedValue); rebuildShowMoreList(index, selectedValue);
} else { } else {
selectedValue.setContent(Inter.getLocText("FR-Designer_AlphaFine_ShowAll")); selectedValue.setContent(Inter.getLocText("FR-Designer_AlphaFine_ShowAll"));
rebuildShowMoreList(index, selectedValue); rebuildShowMoreList(index, selectedValue);
@ -655,8 +637,7 @@ public class AlphaFineDialog extends UIDialog {
UILabel label = new UILabel(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/opening.gif"))); UILabel label = new UILabel(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/opening.gif")));
label.setBorder(BorderFactory.createEmptyBorder(120, 0, 0, 0)); label.setBorder(BorderFactory.createEmptyBorder(120, 0, 0, 0));
rightSearchResultPane.add(label, BorderLayout.CENTER); rightSearchResultPane.add(label, BorderLayout.CENTER);
validate(); refreshContainer();
repaint();
} }
/** /**
@ -667,18 +648,15 @@ public class AlphaFineDialog extends UIDialog {
} }
/** /**
* 为textfield添加键盘监听器 * 为textfield添加监听器
*/ */
private void initTextFieldKeyListener() { private void initTextFieldListener() {
searchTextField.addKeyListener(new KeyAdapter() { searchTextField.addKeyListener(new KeyAdapter() {
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_DOWN) { if (e.getKeyCode() == KeyEvent.VK_DOWN) {
searchResultList.requestFocus(); searchResultList.requestFocus();
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1); searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1);
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
doNavigate();
saveHistory(searchResultList.getSelectedValue());
} }
} }
@ -690,7 +668,25 @@ public class AlphaFineDialog extends UIDialog {
AlphaFineDialog.this.setVisible(false); AlphaFineDialog.this.setVisible(false);
} else { } else {
searchTextField.setText(null); searchTextField.setText(null);
removeSearchResult();
}
}
}
});
searchTextField.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
if (isNoNeedSearch(searchTextField.getText())) {
removeSearchResult();
} else {
try {
Thread.sleep(10);
doSearch(searchTextField.getText());
} catch (InterruptedException e1) {
FRLogger.getLogger().error(e1.getMessage());
} }
} }
} }
}); });
@ -726,7 +722,7 @@ public class AlphaFineDialog extends UIDialog {
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
//不处理
} }
private void doNavigate() { private void doNavigate() {
@ -778,7 +774,6 @@ public class AlphaFineDialog extends UIDialog {
if (!httpClient.isServerAlive()) { if (!httpClient.isServerAlive()) {
FRLogger.getLogger().error("Failed to sent data to server!"); FRLogger.getLogger().error("Failed to sent data to server!");
} }
httpClient.setTimeout(5000);
} }
@ -935,7 +930,7 @@ public class AlphaFineDialog extends UIDialog {
saveHistory(selectedValue); saveHistory(selectedValue);
} else if (e.getClickCount() == 1) { } else if (e.getClickCount() == 1) {
if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) { if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) {
HandleMoreOrLessResult(selectedIndex, (MoreModel) selectedValue); dealWithMoreOrLessResult(selectedIndex, (MoreModel) selectedValue);
} }
} }
} }
@ -971,10 +966,23 @@ public class AlphaFineDialog extends UIDialog {
@Override @Override
public void addElement(AlphaCellModel element) { public void addElement(AlphaCellModel element) {
AlphaFineHelper.checkCancel();
int index = myDelegate.size(); int index = myDelegate.size();
myDelegate.add(element); myDelegate.add(element);
fireContentsChanged(this, index, index); fireContentsChanged(this, index, index);
fireSelectedStateChanged(element, index); fireSelectedStateChanged(element, index);
}
@Override
protected void fireContentsChanged(Object source, int index0, int index1) {
if (myDelegate.size() > MAX_SHOW_SIZE) {
leftSearchResultPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
leftSearchResultPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 2));
} else {
leftSearchResultPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
}
super.fireContentsChanged(source, index0, index1);
} }
/** /**

4
designer/src/com/fr/design/mainframe/alphafine/preview/PluginPreviewPane.java

@ -49,10 +49,10 @@ public class PluginPreviewPane extends JPanel {
nameLabel.setBackground(AlphaFineConstants.BLUE); nameLabel.setBackground(AlphaFineConstants.BLUE);
nameLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 10, 20)); nameLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 10, 20));
line.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0)); line.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0));
String price0 = price == 0 ? Inter.getLocText("FR-Designer-Collect_Information_free") : String.valueOf(price); String price0 = price == 0 ? Inter.getLocText("FR-Designer-Collect_Information_free") : "¥" + String.valueOf(price);
UILabel priceLabel = new UILabel(price0); UILabel priceLabel = new UILabel(price0);
priceLabel.setForeground(AlphaFineConstants.RED); priceLabel.setForeground(AlphaFineConstants.RED);
priceLabel.setFont(AlphaFineConstants.SMALL_FONT); priceLabel.setFont(AlphaFineConstants.MEDIUM_FONT);
bottomPane.add(priceLabel, BorderLayout.WEST); bottomPane.add(priceLabel, BorderLayout.WEST);
panel.add(nameLabel, BorderLayout.NORTH); panel.add(nameLabel, BorderLayout.NORTH);
panel.add(line, BorderLayout.SOUTH); panel.add(line, BorderLayout.SOUTH);

5
designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java

@ -75,10 +75,9 @@ public class ActionSearchManager implements AlphaFineSearchProcessor {
result.add(object); result.add(object);
} }
} }
if (result.size() == 0) { if (result.isEmpty()) {
return lessModelList; return lessModelList;
} } else if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"))); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set")));
lessModelList.addAll(result); lessModelList.addAll(result);
} else { } else {

7
designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java

@ -61,7 +61,6 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
if (!httpClient.isServerAlive()) { if (!httpClient.isServerAlive()) {
return getNoConnectList(); return getNoConnectList();
} }
httpClient.setTimeout(5000);
result = httpClient.getResponseText(); result = httpClient.getResponseText();
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
try { try {
@ -76,10 +75,9 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
searchResult.add(cellModel); searchResult.add(cellModel);
} }
} }
if (searchResult.size() == 0) { if (searchResult.isEmpty()) {
return lessModelList; return lessModelList;
} } else if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP")));
lessModelList.addAll(searchResult); lessModelList.addAll(searchResult);
} else { } else {
@ -90,7 +88,6 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor {
} }
} catch (JSONException e) { } catch (JSONException e) {
FRLogger.getLogger().error("document search error: " + e.getMessage()); FRLogger.getLogger().error("document search error: " + e.getMessage());
return lessModelList;
} }
} }
return lessModelList; return lessModelList;

5
designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java

@ -100,10 +100,9 @@ public class FileSearchManager implements AlphaFineSearchProcessor {
} }
} }
if (result.size() == 0) { if (result.isEmpty()) {
return lessModelList; return lessModelList;
} } else if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates")));
lessModelList.addAll(result); lessModelList.addAll(result);
} else { } else {

8
designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java

@ -96,7 +96,6 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
if (!httpClient.isServerAlive()) { if (!httpClient.isServerAlive()) {
return getNoConnectList(); return getNoConnectList();
} }
httpClient.setTimeout(5000);
result = httpClient.getResponseText(); result = httpClient.getResponseText();
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
JSONObject jsonObject = new JSONObject(result); JSONObject jsonObject = new JSONObject(result);
@ -109,11 +108,10 @@ public class PluginSearchManager implements AlphaFineSearchProcessor {
searchResult.add(cellModel); searchResult.add(cellModel);
} }
} }
if (searchResult.size() == 0) { if (searchResult.isEmpty()) {
return this.lessModelList; return this.lessModelList;
} } else if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) {
if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon")));
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates")));
lessModelList.addAll(searchResult); lessModelList.addAll(searchResult);
} else { } else {
lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.PLUGIN)); lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.PLUGIN));

3
designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java

@ -34,6 +34,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo
private static final int MAX = 400; private static final int MAX = 400;
private static final int HUND = 100; private static final int HUND = 100;
private static final int MIN = 10; private static final int MIN = 10;
private static final int DIR = 15;
private static final double MIN_TIME = 0.4; private static final double MIN_TIME = 0.4;
public FormElementCaseDesigner elementCaseDesigner; public FormElementCaseDesigner elementCaseDesigner;
private BaseJForm jForm; private BaseJForm jForm;
@ -61,7 +62,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo
if (InputEventBaseOnOS.isControlDown(e)) { if (InputEventBaseOnOS.isControlDown(e)) {
int dir = e.getWheelRotation(); int dir = e.getWheelRotation();
int old_resolution = (int) jSliderContainer.getShowVal().getValue(); int old_resolution = (int) jSliderContainer.getShowVal().getValue();
jSliderContainer.getShowVal().setValue(old_resolution - (dir * MIN)); jSliderContainer.getShowVal().setValue(old_resolution - (dir * DIR));
} }
} }
}; };

10
designer/src/com/fr/start/CollectUserInformationDialog.java

@ -14,6 +14,7 @@ import com.fr.design.mainframe.ActiveKeyGenerator;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import javax.swing.*; import javax.swing.*;
@ -28,12 +29,13 @@ import java.util.Locale;
public class CollectUserInformationDialog extends UIDialog { public class CollectUserInformationDialog extends UIDialog {
private static final String CN_LOGIN_HTML = "http://www.finereport.com/products/frlogin";
private static final String EN_LOGIN_HTML = "http://www.finereport.com/en/frlogin";
private static final String TW_LOGIN_HTML = "http://www.finereport.com/tw/products/frlogin";
private static final String JP_LOGIN_HTML = "http://www.finereport.com/jp/products/frlogin";
private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000; private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000;
private static final String CN_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.cn");
private static final String EN_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.en");
private static final String TW_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.tw");
private static final String JP_LOGIN_HTML = SiteCenter.getInstance().acquireUrlByKind("frlogin.jp");
private UITextField keyTextField; private UITextField keyTextField;
private DescriptionTextArea descriptionTextArea; private DescriptionTextArea descriptionTextArea;

3
designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -202,11 +202,8 @@ public class AlphaFineConfigManager implements XMLable {
} }
public boolean isEnabled() { public boolean isEnabled() {
if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) {
return isEnabled; return isEnabled;
} }
return false;
}
public void setEnabled(boolean isEnabled) { public void setEnabled(boolean isEnabled) {
this.isEnabled = isEnabled; this.isEnabled = isEnabled;

34
designer_base/src/com/fr/design/extra/PluginStoreConstants.java

@ -1,34 +0,0 @@
package com.fr.design.extra;
import com.fr.base.FRContext;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import java.io.FileInputStream;
import java.util.Properties;
/**
* Created by vito on 16/4/22.
*/
public class PluginStoreConstants {
public static final String VERSION = loadAttribute("VERSION", "");
private static Properties PROP = null;
private static String loadAttribute(String key, String defaultValue) {
if (PROP == null) {
PROP = new Properties();
try {
PROP.load(new FileInputStream(StableUtils.pathJoin(FRContext.getCurrentEnv().getWebReportPath(), "scripts/store/web/plugin_store.properties")));
} catch (Exception e) {
}
}
String p = PROP.getProperty(key);
if (StringUtils.isEmpty(p)) {
p = defaultValue;
}
return p;
}
}

7
designer_base/src/com/fr/design/extra/WebViewDlgHelper.java

@ -1,7 +1,6 @@
package com.fr.design.extra; package com.fr.design.extra;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
@ -12,6 +11,7 @@ import com.fr.general.Inter;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.plugin.PluginStoreConstants;
import com.fr.plugin.PluginVerifyException; import com.fr.plugin.PluginVerifyException;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -55,8 +55,8 @@ public class WebViewDlgHelper {
String indexPath = "index.html"; String indexPath = "index.html";
String mainIndexPath = StableUtils.pathJoin(installHome, indexPath); String mainIndexPath = StableUtils.pathJoin(installHome, indexPath);
checkAndCopyMainFile(mainIndexPath, mainJsPath); checkAndCopyMainFile(mainIndexPath, mainJsPath);
updateShopScripts(SHOP_SCRIPTS);
showPluginDlg(mainIndexPath); showPluginDlg(mainIndexPath);
updateShopScripts(SHOP_SCRIPTS);
} }
} else { } else {
BasicPane traditionalStorePane = new BasicPane() { BasicPane traditionalStorePane = new BasicPane() {
@ -195,6 +195,7 @@ public class WebViewDlgHelper {
IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome);
copyMainFile(StableUtils.pathJoin(installHome, "index.html"), StableUtils.pathJoin(installHome, relativePath)); copyMainFile(StableUtils.pathJoin(installHome, "index.html"), StableUtils.pathJoin(installHome, relativePath));
// TODO: 2017/4/17 删除之前存放在安装目录下的script // TODO: 2017/4/17 删除之前存放在安装目录下的script
PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE);
} }
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
@ -209,7 +210,7 @@ public class WebViewDlgHelper {
new SwingWorker<Void, Void>() { new SwingWorker<Void, Void>() {
@Override @Override
protected Void doInBackground() throws Exception { protected Void doInBackground() throws Exception {
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.cv") + "&version=" + PluginStoreConstants.VERSION); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.cv") + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION"));
httpClient.asGet(); httpClient.asGet();
if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) {
String text = httpClient.getResponseText(); String text = httpClient.getResponseText();

2
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -659,7 +659,7 @@ FRFont-Subscript=Subscript
Background_Settings=Background Settings Background_Settings=Background Settings
FormulaD-Invalid_Formula=Invalid Formula FormulaD-Invalid_Formula=Invalid Formula
FR-Base_Margin=Margin FR-Base_Margin=Margin
FR-Designer-Plugin_Shop_Installed=Plug-shop installed, whether to start immediately? FR-Designer-Plugin_Shop_Installed=Plugin store is installed, please reopen the store.
M_Edit-Send_to_Back=Send to Bottom M_Edit-Send_to_Back=Send to Bottom
Email-Can_Preview_Report_Content=Preview Report Content in the Body Email-Can_Preview_Report_Content=Preview Report Content in the Body
FR-Designer-FRFont_Italic=Italic FR-Designer-FRFont_Italic=Italic

2
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -657,7 +657,7 @@ FRFont-Subscript=\u4E0B\u4ED8\u304D
Background_Settings=\u80CC\u666F\u8A2D\u5B9A Background_Settings=\u80CC\u666F\u8A2D\u5B9A
FormulaD-Invalid_Formula=\u7121\u52B9\u306A\u516C\u5F0F FormulaD-Invalid_Formula=\u7121\u52B9\u306A\u516C\u5F0F
FR-Base_Margin=\u30DE\u30FC\u30B8\u30F3 FR-Base_Margin=\u30DE\u30FC\u30B8\u30F3
FR-Designer-Plugin_Shop_Installed=\u30D7\u30E9\u30B0\u30A4\u30F3\u30B7\u30E7\u30C3\u30D7\u304C\u3059\u3050\u306B\u958B\u59CB\u3059\u308B\u304B\u3069\u3046\u304B\u3001\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u3059\u304B\uFF1F FR-Designer-Plugin_Shop_Installed=
M_Edit-Send_to_Back=\u6700\u80CC\u9762\u3078\u79FB\u52D5(K) M_Edit-Send_to_Back=\u6700\u80CC\u9762\u3078\u79FB\u52D5(K)
Email-Can_Preview_Report_Content=\u30C6\u30AD\u30B9\u30C8\u30D7\u30EC\u30D3\u30E5\u30FC\u30EC\u30DD\u30FC\u30C8\u306E\u5185\u5BB9 Email-Can_Preview_Report_Content=\u30C6\u30AD\u30B9\u30C8\u30D7\u30EC\u30D3\u30E5\u30FC\u30EC\u30DD\u30FC\u30C8\u306E\u5185\u5BB9
FR-Designer-FRFont_Italic=\u50BE\u659C FR-Designer-FRFont_Italic=\u50BE\u659C

2
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -657,7 +657,7 @@ FRFont-Subscript=\uBC11\uC904
Background_Settings=\uBC30\uACBD\uC124\uC815 Background_Settings=\uBC30\uACBD\uC124\uC815
FormulaD-Invalid_Formula=\uC62C\uBC14\uB974\uC9C0\uC54A\uC740\uC218\uC2DD FormulaD-Invalid_Formula=\uC62C\uBC14\uB974\uC9C0\uC54A\uC740\uC218\uC2DD
FR-Base_Margin=\uC5EC\uBC31 FR-Base_Margin=\uC5EC\uBC31
FR-Designer-Plugin_Shop_Installed=\uD50C\uB7EC\uADF8\uC778 \uC0C1\uC810 \uC989\uC2DC \uC2DC\uC791\uD560\uC9C0 \uC5EC\uBD80\uB97C \uC124\uCE58? FR-Designer-Plugin_Shop_Installed=
M_Edit-Send_to_Back=\uC81C\uC77C\uBC11\uC5D0\uB450\uAE30(K) M_Edit-Send_to_Back=\uC81C\uC77C\uBC11\uC5D0\uB450\uAE30(K)
Email-Can_Preview_Report_Content=\uBCF8\uBB38\uBBF8\uB9AC\uBCF4\uAE30\uBB38\uC11C\uB0B4\uC6A9 Email-Can_Preview_Report_Content=\uBCF8\uBB38\uBBF8\uB9AC\uBCF4\uAE30\uBB38\uC11C\uB0B4\uC6A9
FR-Designer-FRFont_Italic=\uAE30\uC6B8\uC784\uAF34 FR-Designer-FRFont_Italic=\uAE30\uC6B8\uC784\uAF34

2
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -660,7 +660,7 @@ FRFont-Subscript=\u4E0B\u6807
Background_Settings=\u80CC\u666F\u8BBE\u7F6E Background_Settings=\u80CC\u666F\u8BBE\u7F6E
FormulaD-Invalid_Formula=\u975E\u6CD5\u7684\u516C\u5F0F FormulaD-Invalid_Formula=\u975E\u6CD5\u7684\u516C\u5F0F
FR-Base_Margin=\u8FB9\u8DDD FR-Base_Margin=\u8FB9\u8DDD
FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88C5\u5B8C\u6BD5,\u662F\u5426\u7ACB\u523B\u542F\u52A8? FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88C5\u5B8C\u6BD5,\u8BF7\u91CD\u65B0\u6253\u5F00\u63D2\u4EF6\u5546\u5E97\u3002
M_Edit-Send_to_Back=\u7F6E\u4E8E\u5E95\u5C42(K) M_Edit-Send_to_Back=\u7F6E\u4E8E\u5E95\u5C42(K)
Email-Can_Preview_Report_Content=\u6B63\u6587\u9884\u89C8\u62A5\u8868\u5185\u5BB9 Email-Can_Preview_Report_Content=\u6B63\u6587\u9884\u89C8\u62A5\u8868\u5185\u5BB9
FR-Designer-FRFont_Italic=\u503E\u659C FR-Designer-FRFont_Italic=\u503E\u659C

2
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -659,7 +659,7 @@ FRFont-Subscript=\u4E0B\u6A19
Background_Settings=\u80CC\u666F\u8A2D\u5B9A Background_Settings=\u80CC\u666F\u8A2D\u5B9A
FormulaD-Invalid_Formula=\u975E\u6CD5\u7684\u516C\u5F0F FormulaD-Invalid_Formula=\u975E\u6CD5\u7684\u516C\u5F0F
FR-Base_Margin=\u908A\u8DDD FR-Base_Margin=\u908A\u8DDD
FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88DD\u5B8C\u7562,\u662F\u5426\u7ACB\u523B\u555F\u52D5? FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88DD\u5B8C\u7562,\u8ACB\u91CD\u65B0\u6253\u958B\u63D2\u4EF6\u5546\u5E97\u3002
M_Edit-Send_to_Back=\u7F6E\u65BC\u5E95\u5C64(K) M_Edit-Send_to_Back=\u7F6E\u65BC\u5E95\u5C64(K)
Email-Can_Preview_Report_Content=\u6B63\u6587\u9810\u89BD\u5831\u8868\u5167\u5BB9 Email-Can_Preview_Report_Content=\u6B63\u6587\u9810\u89BD\u5831\u8868\u5167\u5BB9
FR-Designer-FRFont_Italic=\u659C\u9AD4 FR-Designer-FRFont_Italic=\u659C\u9AD4

2
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -381,10 +381,8 @@ public abstract class ToolBarMenuDock {
// shortCuts.add(new ForumAction()); // shortCuts.add(new ForumAction());
} }
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) {
shortCuts.add(new AlphaFineAction()); shortCuts.add(new AlphaFineAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
}
shortCuts.add(new AboutAction()); shortCuts.add(new AboutAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]); return shortCuts.toArray(new ShortCut[shortCuts.size()]);
} }

4
designer_base/src/com/fr/design/scrollruler/HorizontalRulerUI.java

@ -12,6 +12,7 @@ import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.design.file.HistoryTemplateListPane;
public class HorizontalRulerUI extends RulerUI { public class HorizontalRulerUI extends RulerUI {
@ -25,7 +26,8 @@ public class HorizontalRulerUI extends RulerUI {
for (int i = k; i < (pxToLength(size.getWidth() + extra) + 1) * ratio; i++) { for (int i = k; i < (pxToLength(size.getWidth() + extra) + 1) * ratio; i++) {
g.setColor(BaseRuler.UNIT_SIGN_COLOR); g.setColor(BaseRuler.UNIT_SIGN_COLOR);
if (i % BaseRuler.SCALE_10 == 0) { if (i % BaseRuler.SCALE_10 == 0) {
String text = Utils.convertNumberStringToString(i / showText); double times = (double)HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution();
String text = Utils.convertNumberStringToString(Math.round(i / times));
Graphics2D gg = (Graphics2D) g.create((int) (toPX(i) / ratio) - extra + 1, 0, BaseRuler.NUMBER_100, size.height); Graphics2D gg = (Graphics2D) g.create((int) (toPX(i) / ratio) - extra + 1, 0, BaseRuler.NUMBER_100, size.height);
BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_100, BaseRuler.NUMBER_14, text, Style.getInstance().deriveHorizontalAlignment( BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_100, BaseRuler.NUMBER_14, text, Style.getInstance().deriveHorizontalAlignment(
Style.LEFT_TO_RIGHT).deriveFRFont(BaseRuler.TEXT_FONT), ScreenResolution.getScreenResolution()); Style.LEFT_TO_RIGHT).deriveFRFont(BaseRuler.TEXT_FONT), ScreenResolution.getScreenResolution());

4
designer_base/src/com/fr/design/scrollruler/VerticalRulerUI.java

@ -9,6 +9,7 @@ import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.design.file.HistoryTemplateListPane;
public class VerticalRulerUI extends RulerUI{ public class VerticalRulerUI extends RulerUI{
@ -22,8 +23,9 @@ public class VerticalRulerUI extends RulerUI{
for (int i = k; i < (pxToLength(size.height + extra) + 1) * ratio; i++) { for (int i = k; i < (pxToLength(size.height + extra) + 1) * ratio; i++) {
g.setColor(BaseRuler.UNIT_SIGN_COLOR); g.setColor(BaseRuler.UNIT_SIGN_COLOR);
if (i % BaseRuler.SCALE_10 == 0) { if (i % BaseRuler.SCALE_10 == 0) {
double times = (double) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution() / ScreenResolution.getScreenResolution();
String text = Utils.convertNumberStringToString(Math.round(i / times));
GraphHelper.drawLine(g, size.width, toPX(i) / ratio - extra, 0, toPX(i) / ratio - extra); GraphHelper.drawLine(g, size.width, toPX(i) / ratio - extra, 0, toPX(i) / ratio - extra);
String text = Utils.convertNumberStringToString(i / showText);
Graphics2D gg = (Graphics2D) g.create(0, (int) (toPX(i) / ratio - extra + 1), size.width, BaseRuler.NUMBER_99); Graphics2D gg = (Graphics2D) g.create(0, (int) (toPX(i) / ratio - extra + 1), size.width, BaseRuler.NUMBER_99);
BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_11, BaseRuler.NUMBER_100, text, Style.getInstance().deriveVerticalAlignment(1).deriveRotation( BaseUtils.drawStringStyleInRotation(gg, BaseRuler.NUMBER_11, BaseRuler.NUMBER_100, text, Style.getInstance().deriveVerticalAlignment(1).deriveRotation(
BaseRuler.NUMBER_90).deriveFRFont(BaseRuler.TEXT_FONT), ScreenResolution.getScreenResolution()); BaseRuler.NUMBER_90).deriveFRFont(BaseRuler.TEXT_FONT), ScreenResolution.getScreenResolution());

Loading…
Cancel
Save