* commit '041918a62e23e9dfab0be955c03d726333b23422': (862 commits) 1 1 1 1 REPORT-5661 mac设计器打开最近的模板,提示模板不存在 REPORT-5661 区分mac和windows 优先处理内存释放问题 REPORT-5661 mac设计器打开最近的模板,提示模板不存在 格式化JavaScript代码+登录接口 REPORT-5668 单元格元素与悬浮元素图表配置问题 REPORT-5700 设计器图标补充修改 REPORT-5262 alphafine 远程设计搜索模板速度慢 默认模板启动问题 REPORT-5668 单元格元素和悬浮元素编辑器频繁初始化导致的内存激增问题 a REPORT-4386 界面,超链-邮件,编辑框内容输入后显示不全 REPORT-5692 [9.0三轮回归] 查询按钮改名字后,不会立即在设计器改变名字 REPORT-5692 [9.0三轮回归] 查询按钮改名字后,不会立即在设计器改变名字 REPORT-5134 设计器单元格里插入控件后,复制粘贴,显示null REPORT-5097 9.0,切换到本地其他目录,点击帮助-产品演示,不需要切换目录的提示 暂时先不改 ...master
@ -1,44 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||||
<module type="JAVA_MODULE" version="4"> |
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true"> |
|
||||||
<exclude-output /> |
|
||||||
<content url="file://$MODULE_DIR$"> |
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> |
|
||||||
</content> |
|
||||||
<orderEntry type="inheritedJdk" /> |
|
||||||
<orderEntry type="sourceFolder" forTests="false" /> |
|
||||||
<orderEntry type="module" module-name="designer_base" /> |
|
||||||
<orderEntry type="module" module-name="designer_form" /> |
|
||||||
<orderEntry type="module" module-name="designer_chart" /> |
|
||||||
<orderEntry type="module" module-name="designer_chart" /> |
|
||||||
<orderEntry type="module" module-name="designer_base" /> |
|
||||||
<orderEntry type="module" module-name="designer_form" /> |
|
||||||
<orderEntry type="module" module-name="base" /> |
|
||||||
<orderEntry type="module" module-name="base-basic" /> |
|
||||||
<orderEntry type="module" module-name="base-calculate" /> |
|
||||||
<orderEntry type="module" module-name="base-data" /> |
|
||||||
<orderEntry type="module" module-name="base-file" /> |
|
||||||
<orderEntry type="module" module-name="base-performance" /> |
|
||||||
<orderEntry type="module" module-name="base-plugin-engine" /> |
|
||||||
<orderEntry type="module" module-name="base-stable" /> |
|
||||||
<orderEntry type="module" module-name="chart-base" /> |
|
||||||
<orderEntry type="module" module-name="chart-chartattr" /> |
|
||||||
<orderEntry type="module" module-name="chart-chartdata" /> |
|
||||||
<orderEntry type="module" module-name="chart-chartglyph" /> |
|
||||||
<orderEntry type="module" module-name="chart-web" /> |
|
||||||
<orderEntry type="module" module-name="engine" /> |
|
||||||
<orderEntry type="module" module-name="engine-cross" /> |
|
||||||
<orderEntry type="module" module-name="engine-enhancement" /> |
|
||||||
<orderEntry type="module" module-name="engine-page" /> |
|
||||||
<orderEntry type="module" module-name="engine-remote" /> |
|
||||||
<orderEntry type="module" module-name="engine-view" /> |
|
||||||
<orderEntry type="module" module-name="engine-write" /> |
|
||||||
<orderEntry type="module" module-name="fmobile" /> |
|
||||||
<orderEntry type="module" module-name="form" /> |
|
||||||
<orderEntry type="module" module-name="fsbakrestore" /> |
|
||||||
<orderEntry type="module" module-name="fschedule" /> |
|
||||||
<orderEntry type="module" module-name="fservice" /> |
|
||||||
<orderEntry type="module" module-name="fsmonitor" /> |
|
||||||
<orderEntry type="library" name="lib" level="project" /> |
|
||||||
</component> |
|
||||||
</module> |
|
@ -0,0 +1,35 @@ |
|||||||
|
/* |
||||||
|
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. |
||||||
|
*/ |
||||||
|
package com.fr.design.actions.cell; |
||||||
|
|
||||||
|
import com.fr.base.BaseUtils; |
||||||
|
import com.fr.design.actions.UpdateAction; |
||||||
|
import com.fr.design.mainframe.EastRegionContainerPane; |
||||||
|
import com.fr.design.menu.KeySetUtils; |
||||||
|
|
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
|
||||||
|
/** |
||||||
|
* Condition Attributes. |
||||||
|
*/ |
||||||
|
public class ConditionAttributesAction extends UpdateAction { |
||||||
|
public ConditionAttributesAction() { |
||||||
|
this.setMenuKeySet(KeySetUtils.CONDITION_ATTR); |
||||||
|
this.setName(getMenuKeySet().getMenuKeySetName()); |
||||||
|
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||||
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/highlight.png")); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CONDITION_ATTR); |
||||||
|
EastRegionContainerPane.getInstance().setWindow2PreferWidth(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void update() { |
||||||
|
super.update(); |
||||||
|
this.setEnabled(EastRegionContainerPane.getInstance().isConditionAttrPaneEnabled()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
/* |
||||||
|
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. |
||||||
|
*/ |
||||||
|
package com.fr.design.actions.edit; |
||||||
|
|
||||||
|
import com.fr.base.BaseUtils; |
||||||
|
import com.fr.design.actions.UpdateAction; |
||||||
|
import com.fr.design.mainframe.EastRegionContainerPane; |
||||||
|
import com.fr.design.menu.KeySetUtils; |
||||||
|
|
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
|
||||||
|
/** |
||||||
|
* HyperlinkAction. |
||||||
|
*/ |
||||||
|
public class HyperlinkAction extends UpdateAction { |
||||||
|
|
||||||
|
public HyperlinkAction() { |
||||||
|
this.setMenuKeySet(KeySetUtils.HYPER_LINK); |
||||||
|
this.setName(getMenuKeySet().getMenuKeySetName()); |
||||||
|
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||||
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/hyperLink.png")); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_HYPERLINK); |
||||||
|
EastRegionContainerPane.getInstance().setWindow2PreferWidth(); |
||||||
|
} |
||||||
|
} |
@ -1,98 +1,128 @@ |
|||||||
/* |
/* |
||||||
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. |
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. |
||||||
*/ |
*/ |
||||||
package com.fr.design.actions.insert.flot; |
package com.fr.design.actions.insert.flot; |
||||||
|
|
||||||
import com.fr.base.BaseUtils; |
import com.fr.base.BaseFormula; |
||||||
import com.fr.base.DynamicUnitList; |
import com.fr.base.BaseUtils; |
||||||
import com.fr.base.Formula; |
import com.fr.base.DynamicUnitList; |
||||||
import com.fr.design.file.HistoryTemplateListPane; |
import com.fr.design.actions.ElementCaseAction; |
||||||
import com.fr.design.mainframe.ElementCasePane; |
import com.fr.design.dialog.BasicDialog; |
||||||
import com.fr.design.menu.MenuKeySet; |
import com.fr.design.dialog.DialogActionAdapter; |
||||||
import com.fr.general.Inter; |
import com.fr.design.file.HistoryTemplateListPane; |
||||||
import com.fr.grid.Grid; |
import com.fr.design.formula.FormulaFactory; |
||||||
import com.fr.grid.selection.FloatSelection; |
import com.fr.design.formula.UIFormula; |
||||||
import com.fr.report.ReportHelper; |
import com.fr.design.mainframe.DesignerContext; |
||||||
import com.fr.report.cell.FloatElement; |
import com.fr.design.mainframe.ElementCasePane; |
||||||
import com.fr.report.elementcase.TemplateElementCase; |
import com.fr.design.menu.MenuKeySet; |
||||||
import com.fr.stable.unit.FU; |
import com.fr.general.Inter; |
||||||
|
import com.fr.grid.Grid; |
||||||
import javax.swing.*; |
import com.fr.grid.selection.FloatSelection; |
||||||
import java.awt.event.ActionEvent; |
import com.fr.report.ReportHelper; |
||||||
|
import com.fr.report.cell.FloatElement; |
||||||
/** |
import com.fr.report.elementcase.TemplateElementCase; |
||||||
* Insert formula. |
import com.fr.stable.unit.FU; |
||||||
*/ |
|
||||||
public class FormulaFloatAction extends AbstractShapeAction { |
import javax.swing.*; |
||||||
public FormulaFloatAction(ElementCasePane t) { |
|
||||||
super(t); |
/** |
||||||
this.setMenuKeySet(FLOAT_INSERT_FORMULA); |
* Insert formula. |
||||||
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); |
*/ |
||||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
public class FormulaFloatAction extends ElementCaseAction { |
||||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); |
|
||||||
} |
private boolean returnValue = false; |
||||||
|
|
||||||
public static final MenuKeySet FLOAT_INSERT_FORMULA = new MenuKeySet() { |
public FormulaFloatAction(ElementCasePane t) { |
||||||
@Override |
super(t); |
||||||
public char getMnemonic() { |
this.setMenuKeySet(FLOAT_INSERT_FORMULA); |
||||||
return 'F'; |
this.setName(getMenuKeySet().getMenuKeySetName()); |
||||||
} |
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||||
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); |
||||||
@Override |
} |
||||||
public String getMenuName() { |
|
||||||
return Inter.getLocText("FR-Designer_Insert_Formula"); |
public static final MenuKeySet FLOAT_INSERT_FORMULA = new MenuKeySet() { |
||||||
} |
@Override |
||||||
|
public char getMnemonic() { |
||||||
@Override |
return 'F'; |
||||||
public KeyStroke getKeyStroke() { |
} |
||||||
return null; |
|
||||||
} |
@Override |
||||||
}; |
public String getMenuName() { |
||||||
|
return Inter.getLocText("FR-Designer_Insert_Formula"); |
||||||
/** |
} |
||||||
* 动作 |
|
||||||
* |
@Override |
||||||
* @param e 事件 |
public KeyStroke getKeyStroke() { |
||||||
*/ |
return null; |
||||||
public void actionPerformed(ActionEvent e) { |
} |
||||||
ElementCasePane jws = getEditingComponent(); |
}; |
||||||
if (jws == null) { |
|
||||||
return; |
private void doWithDrawingFloatElement() { |
||||||
} |
ElementCasePane jws = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane(); |
||||||
//
|
Grid grid = jws.getGrid(); |
||||||
FloatElement floatElement = new FloatElement(new Formula("")); |
|
||||||
this.startDraw(floatElement); |
ElementCasePane reportPane = grid.getElementCasePane(); |
||||||
doWithDrawingFloatElement(); |
TemplateElementCase report = reportPane.getEditingElementCase(); |
||||||
jws.getGrid().startEditing(); |
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report); |
||||||
} |
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report); |
||||||
|
|
||||||
private void doWithDrawingFloatElement() { |
int horizentalScrollValue = grid.getHorizontalValue(); |
||||||
ElementCasePane jws = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane(); |
int verticalScrollValue = grid.getVerticalValue(); |
||||||
Grid grid = jws.getGrid(); |
|
||||||
|
int resolution = grid.getResolution(); |
||||||
ElementCasePane reportPane = grid.getElementCasePane(); |
int floatWdith = grid.getDrawingFloatElement().getWidth().toPixI(resolution); |
||||||
TemplateElementCase report = reportPane.getEditingElementCase(); |
int floatHeight = grid.getDrawingFloatElement().getWidth().toPixI(resolution); |
||||||
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report); |
|
||||||
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report); |
FU evtX_fu = FU.valueOfPix((grid.getWidth() - floatWdith) / 2, resolution); |
||||||
|
FU evtY_fu = FU.valueOfPix((grid.getHeight() - floatHeight) / 2, resolution); |
||||||
int horizentalScrollValue = grid.getHorizontalValue(); |
|
||||||
int verticalScrollValue = grid.getVerticalValue(); |
FU leftDistance = FU.getInstance(evtX_fu.toFU() + columnWidthList.getRangeValue(0, horizentalScrollValue).toFU()); |
||||||
|
FU topDistance = FU.getInstance(evtY_fu.toFU() + rowHeightList.getRangeValue(0, verticalScrollValue).toFU()); |
||||||
int resolution = grid.getResolution(); |
|
||||||
int floatWdith = grid.getDrawingFloatElement().getWidth().toPixI(resolution); |
grid.getDrawingFloatElement().setLeftDistance(leftDistance); |
||||||
int floatHeight = grid.getDrawingFloatElement().getWidth().toPixI(resolution); |
grid.getDrawingFloatElement().setTopDistance(topDistance); |
||||||
|
|
||||||
FU evtX_fu = FU.valueOfPix((grid.getWidth() - floatWdith) / 2, resolution); |
report.addFloatElement(grid.getDrawingFloatElement()); |
||||||
FU evtY_fu = FU.valueOfPix((grid.getHeight() - floatHeight) / 2, resolution); |
reportPane.setSelection(new FloatSelection(grid.getDrawingFloatElement().getName())); |
||||||
|
} |
||||||
FU leftDistance = FU.getInstance(evtX_fu.toFU() + columnWidthList.getRangeValue(0, horizentalScrollValue).toFU()); |
|
||||||
FU topDistance = FU.getInstance(evtY_fu.toFU() + rowHeightList.getRangeValue(0, verticalScrollValue).toFU()); |
/** |
||||||
|
* 执行动作 |
||||||
grid.getDrawingFloatElement().setLeftDistance(leftDistance); |
* |
||||||
grid.getDrawingFloatElement().setTopDistance(topDistance); |
* @return 成功返回true |
||||||
|
*/ |
||||||
report.addFloatElement(grid.getDrawingFloatElement()); |
@Override |
||||||
reportPane.setSelection(new FloatSelection(grid.getDrawingFloatElement().getName())); |
public boolean executeActionReturnUndoRecordNeeded() { |
||||||
} |
final ElementCasePane reportPane = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane(); |
||||||
|
if (reportPane == null) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
reportPane.stopEditing(); |
||||||
|
final FloatElement floatElement = new FloatElement(); |
||||||
|
final UIFormula formulaPane = FormulaFactory.createFormulaPane(); |
||||||
|
formulaPane.populate(BaseFormula.createFormulaBuilder().build()); |
||||||
|
|
||||||
|
BasicDialog dialog = formulaPane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { |
||||||
|
|
||||||
|
@Override |
||||||
|
public void doOk() { |
||||||
|
floatElement.setValue(formulaPane.update()); |
||||||
|
if (reportPane == null) { |
||||||
|
return; |
||||||
|
} |
||||||
|
reportPane.getGrid().setDrawingFloatElement(floatElement); |
||||||
|
doWithDrawingFloatElement(); |
||||||
|
returnValue = true; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void doCancel() { |
||||||
|
returnValue = false; |
||||||
|
} |
||||||
|
}); |
||||||
|
dialog.setVisible(true); |
||||||
|
return returnValue; |
||||||
|
} |
||||||
|
|
||||||
} |
} |
@ -0,0 +1,27 @@ |
|||||||
|
package com.fr.design.mainframe; |
||||||
|
|
||||||
|
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by plough on 2017/9/4. |
||||||
|
*/ |
||||||
|
public class ReportHyperlinkGroupPaneNoPop extends ReportHyperlinkGroupPane{ |
||||||
|
private static ReportHyperlinkGroupPaneNoPop singleton; |
||||||
|
|
||||||
|
private ReportHyperlinkGroupPaneNoPop(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) { |
||||||
|
super(hyperlinkGroupPaneActionProvider); |
||||||
|
} |
||||||
|
|
||||||
|
public static ReportHyperlinkGroupPaneNoPop getInstance(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) { |
||||||
|
if (singleton == null) { |
||||||
|
singleton = new ReportHyperlinkGroupPaneNoPop(hyperlinkGroupPaneActionProvider); |
||||||
|
} |
||||||
|
singleton.refreshPane(); |
||||||
|
return singleton; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected boolean isNewStyle() { |
||||||
|
return false; |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 738 B |
After Width: | Height: | Size: 618 B |
After Width: | Height: | Size: 303 B |
After Width: | Height: | Size: 547 B |
After Width: | Height: | Size: 323 B |
After Width: | Height: | Size: 371 B |
After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 461 B |
After Width: | Height: | Size: 761 B |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 331 KiB |
After Width: | Height: | Size: 528 B |
After Width: | Height: | Size: 488 B |
After Width: | Height: | Size: 279 B |
After Width: | Height: | Size: 430 B |
After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 299 B |
After Width: | Height: | Size: 539 B |
@ -1,37 +0,0 @@ |
|||||||
package com.fr.design.mainframe.alphafine.preview; |
|
||||||
|
|
||||||
|
|
||||||
import com.fr.design.gui.ilable.UILabel; |
|
||||||
import com.fr.design.mainframe.alphafine.AlphaFineConstants; |
|
||||||
import com.fr.general.IOUtils; |
|
||||||
import com.fr.general.Inter; |
|
||||||
|
|
||||||
import javax.swing.*; |
|
||||||
import java.awt.*; |
|
||||||
|
|
||||||
|
|
||||||
/** |
|
||||||
* Created by XiaXiang on 2017/5/5. |
|
||||||
*/ |
|
||||||
public class ActionPreviewPane extends JPanel { |
|
||||||
private static final Font NAME = new Font("Song_TypeFace", 0, 14); |
|
||||||
|
|
||||||
public ActionPreviewPane() { |
|
||||||
setLayout(new BorderLayout()); |
|
||||||
setBackground(null); |
|
||||||
setBorder(BorderFactory.createEmptyBorder(135, 0, 0, 0)); |
|
||||||
UILabel image = new UILabel(); |
|
||||||
image.setPreferredSize(new Dimension(150, 111)); |
|
||||||
image.setHorizontalAlignment(SwingConstants.CENTER); |
|
||||||
image.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
||||||
image.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/noresult.png")); |
|
||||||
UILabel description = new UILabel(Inter.getLocText("FR-Designer_NoResult")); |
|
||||||
description.setForeground(AlphaFineConstants.MEDIUM_GRAY); |
|
||||||
description.setFont(NAME); |
|
||||||
description.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
||||||
description.setHorizontalAlignment(SwingConstants.CENTER); |
|
||||||
this.add(image, BorderLayout.CENTER); |
|
||||||
this.add(description, BorderLayout.SOUTH); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,32 @@ |
|||||||
|
package com.fr.design.mainframe.alphafine.preview; |
||||||
|
|
||||||
|
import com.bulenkov.iconloader.IconLoader; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.mainframe.alphafine.AlphaFineConstants; |
||||||
|
import com.fr.general.FRFont; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by XiaXiang on 2017/8/14. |
||||||
|
*/ |
||||||
|
public class NoResultPane extends JPanel { |
||||||
|
public NoResultPane(String title, String iconUrl) { |
||||||
|
setLayout(new BorderLayout()); |
||||||
|
setBackground(Color.white); |
||||||
|
setPreferredSize(new Dimension(AlphaFineConstants.LEFT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); |
||||||
|
UILabel image = new UILabel(); |
||||||
|
image.setPreferredSize(new Dimension(150, 111)); |
||||||
|
image.setHorizontalAlignment(SwingConstants.CENTER); |
||||||
|
image.setIcon(IconLoader.getIcon(iconUrl)); |
||||||
|
image.setBorder(BorderFactory.createEmptyBorder(100, 0, 0, 0)); |
||||||
|
UILabel description = new UILabel(title); |
||||||
|
description.setForeground(AlphaFineConstants.MEDIUM_GRAY); |
||||||
|
description.setFont(FRFont.getInstance("SimSun", Font.PLAIN, 14)); |
||||||
|
description.setBorder(BorderFactory.createEmptyBorder(0, 0, 135, 0)); |
||||||
|
description.setHorizontalAlignment(SwingConstants.CENTER); |
||||||
|
add(image, BorderLayout.CENTER); |
||||||
|
add(description, BorderLayout.SOUTH); |
||||||
|
} |
||||||
|
} |
@ -1,59 +1,69 @@ |
|||||||
/** |
/** |
||||||
* |
* |
||||||
*/ |
*/ |
||||||
package com.fr.design.mainframe.bbs; |
package com.fr.design.mainframe.bbs; |
||||||
|
|
||||||
import com.fr.general.IOUtils; |
import com.fr.general.IOUtils; |
||||||
|
import com.fr.general.SiteCenter; |
||||||
import com.fr.stable.StringUtils; |
import com.fr.stable.StringUtils; |
||||||
|
|
||||||
import java.util.Properties; |
import java.util.Properties; |
||||||
|
|
||||||
/** |
/** |
||||||
* @author neil |
* @author neil |
||||||
* |
|
||||||
* @date: 2015-3-10-上午9:50:13 |
* @date: 2015-3-10-上午9:50:13 |
||||||
*/ |
*/ |
||||||
public class BBSConstants { |
public class BBSConstants { |
||||||
|
|
||||||
//判断是否更新的关键字
|
//判断是否更新的关键字
|
||||||
public static final String UPDATE_KEY = loadAttribute("UPDATE_KEY", "newIsPopup"); |
public static final String UPDATE_KEY = loadAttribute("UPDATE_KEY", "newIsPopup"); |
||||||
|
|
||||||
|
|
||||||
private static final String GUEST_KEY = "USER"; |
private static final String GUEST_KEY = "USER"; |
||||||
private static final String LINK_KEY = "LINK"; |
private static final String GUEST_KEY_ONLINE = "guest.user"; |
||||||
private static final int GUEST_NUM = 5; |
private static final String LINK_KEY = "LINK"; |
||||||
|
private static final String LINK_KEY_ONLINE = "guest.link"; |
||||||
//用户名信息数组
|
|
||||||
public static final String[] ALL_GUEST = loadAllGuestsInfo(GUEST_KEY); |
private static Properties PROP = null; |
||||||
//用户论坛链接信息
|
|
||||||
public static final String[] ALL_LINK = loadAllGuestsInfo(LINK_KEY); |
public static String[] getAllGuest() { |
||||||
|
return loadAllGuestsInfoOnline(GUEST_KEY_ONLINE, loadAllGuestsInfo(GUEST_KEY)); |
||||||
private static Properties PROP = null; |
} |
||||||
|
|
||||||
//加载所有用户的信息, 用户名, 论坛连接
|
public static String[] getAllLink() { |
||||||
private static String[] loadAllGuestsInfo(String key){ |
return loadAllGuestsInfoOnline(LINK_KEY_ONLINE, loadAllGuestsInfo(LINK_KEY)); |
||||||
String[] allGuests = new String[GUEST_NUM]; |
} |
||||||
for (int i = 0; i < GUEST_NUM; i++) { |
|
||||||
allGuests[i] = loadAttribute(key + i, StringUtils.EMPTY); |
//加载所有用户的信息, 用户名, 论坛连接
|
||||||
} |
private static String loadAllGuestsInfo(String key) { |
||||||
|
return loadAttribute(key, StringUtils.EMPTY); |
||||||
return allGuests; |
} |
||||||
} |
|
||||||
//如果要定制, 直接改bbs.properties就行了
|
//加载所有用户的信息, 用户名, 论坛连接
|
||||||
private static String loadAttribute(String key, String defaultValue) { |
private static String[] loadAllGuestsInfoOnline(String key, String defaultValue) { |
||||||
if (PROP == null) { |
String[] allGuests = new String[0]; |
||||||
PROP = new Properties(); |
String guest = SiteCenter.getInstance().acquireUrlByKind(key, defaultValue); |
||||||
try { |
if (StringUtils.isNotEmpty(guest)) { |
||||||
PROP.load(IOUtils.getResourceAsStream("/com/fr/design/mainframe/bbs/bbs.properties", BBSConstants.class)); |
allGuests = guest.split("\\|"); |
||||||
} catch (Exception e) { |
} |
||||||
} |
return allGuests; |
||||||
} |
} |
||||||
|
|
||||||
String p = PROP.getProperty(key); |
//如果要定制, 直接改bbs.properties就行了
|
||||||
if (StringUtils.isEmpty(p)) { |
private static String loadAttribute(String key, String defaultValue) { |
||||||
p = defaultValue; |
if (PROP == null) { |
||||||
} |
PROP = new Properties(); |
||||||
return p; |
try { |
||||||
} |
PROP.load(IOUtils.getResourceAsStream("/com/fr/design/mainframe/bbs/bbs.properties", BBSConstants.class)); |
||||||
|
} catch (Exception e) { |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
String p = PROP.getProperty(key); |
||||||
|
if (StringUtils.isEmpty(p)) { |
||||||
|
p = defaultValue; |
||||||
|
} |
||||||
|
return p; |
||||||
|
} |
||||||
|
|
||||||
} |
} |
@ -0,0 +1,123 @@ |
|||||||
|
package com.fr.design.mainframe.cell; |
||||||
|
|
||||||
|
import com.fr.design.gui.iscrollbar.UIScrollBar; |
||||||
|
import com.fr.design.mainframe.CellElementPropertyPane; |
||||||
|
import com.fr.quickeditor.cellquick.layout.CellElementBarLayout; |
||||||
|
|
||||||
|
import javax.swing.BorderFactory; |
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.Container; |
||||||
|
import java.awt.Dimension; |
||||||
|
import java.awt.event.AdjustmentEvent; |
||||||
|
import java.awt.event.AdjustmentListener; |
||||||
|
import java.awt.event.MouseWheelEvent; |
||||||
|
import java.awt.event.MouseWheelListener; |
||||||
|
|
||||||
|
/** |
||||||
|
* 右侧单元格元素面板抽象类 |
||||||
|
* |
||||||
|
* @author yaoh.wu |
||||||
|
* @version 2017年7月25日 |
||||||
|
* @since 9.0 |
||||||
|
*/ |
||||||
|
public abstract class AbstractDSCellEditorPane extends JPanel { |
||||||
|
|
||||||
|
/** |
||||||
|
* 滚动条相关配置 |
||||||
|
*/ |
||||||
|
private static final int MAXVALUE = 100; |
||||||
|
private static final int TITLE_HEIGHT = 95; |
||||||
|
private static final int CONTENT_PANE_WIDTH_GAP = 3; |
||||||
|
private static final int SCROLLBAR_WIDTH = 7; |
||||||
|
private static final int MOUSE_WHEEL_SPEED = 5; |
||||||
|
private int maxHeight = 280; |
||||||
|
|
||||||
|
private JPanel leftContentPane; |
||||||
|
private UIScrollBar scrollBar; |
||||||
|
|
||||||
|
protected abstract JPanel createContentPane(); |
||||||
|
|
||||||
|
public abstract String getIconPath(); |
||||||
|
|
||||||
|
public abstract String title4PopupWindow(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 从面板拿数据保存 |
||||||
|
*/ |
||||||
|
public abstract void update(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新面板数据 |
||||||
|
*/ |
||||||
|
public abstract void populate(); |
||||||
|
|
||||||
|
protected void createScrollPane() { |
||||||
|
leftContentPane = this.createContentPane(); |
||||||
|
this.prepareScrollBar(); |
||||||
|
leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground())); |
||||||
|
|
||||||
|
this.setLayout(new CellElementBarLayout(leftContentPane) { |
||||||
|
@Override |
||||||
|
public void layoutContainer(Container parent) { |
||||||
|
maxHeight = CellElementPropertyPane.getInstance().getHeight() - TITLE_HEIGHT; |
||||||
|
int beginY; |
||||||
|
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { |
||||||
|
beginY = 0; |
||||||
|
} else { |
||||||
|
int preferredHeight = leftContentPane.getPreferredSize().height; |
||||||
|
int value = scrollBar.getValue(); |
||||||
|
beginY = value * (preferredHeight - maxHeight) / (MAXVALUE - scrollBar.getVisibleAmount()); |
||||||
|
} |
||||||
|
int width = parent.getWidth(); |
||||||
|
int height = parent.getHeight(); |
||||||
|
if (leftContentPane.getPreferredSize().height > maxHeight) { |
||||||
|
leftContentPane.setBounds(0, -beginY, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height + beginY); |
||||||
|
scrollBar.setBounds(width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, 0, SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, height); |
||||||
|
} else { |
||||||
|
leftContentPane.setBounds(0, 0, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height); |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
this.add(scrollBar); |
||||||
|
this.add(leftContentPane); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
private void prepareScrollBar() { |
||||||
|
scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) { |
||||||
|
@Override |
||||||
|
public int getVisibleAmount() { |
||||||
|
int preferredHeight = leftContentPane.getPreferredSize().height; |
||||||
|
int e = MAXVALUE * (maxHeight) / preferredHeight; |
||||||
|
setVisibleAmount(e); |
||||||
|
return e; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int getMaximum() { |
||||||
|
return MAXVALUE; |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
scrollBar.addAdjustmentListener(new AdjustmentListener() { |
||||||
|
|
||||||
|
@Override |
||||||
|
public void adjustmentValueChanged(AdjustmentEvent e) { |
||||||
|
doLayout(); |
||||||
|
} |
||||||
|
}); |
||||||
|
this.addMouseWheelListener(new MouseWheelListener() { |
||||||
|
|
||||||
|
@Override |
||||||
|
public void mouseWheelMoved(MouseWheelEvent e) { |
||||||
|
int value = scrollBar.getValue(); |
||||||
|
value += MOUSE_WHEEL_SPEED * e.getWheelRotation(); |
||||||
|
scrollBar.setValue(value); |
||||||
|
doLayout(); |
||||||
|
} |
||||||
|
}); |
||||||
|
scrollBar.setPreferredSize(new Dimension(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, this.getHeight())); |
||||||
|
scrollBar.setBlockIncrement(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP); |
||||||
|
scrollBar.setBorder(BorderFactory.createMatteBorder(0, CONTENT_PANE_WIDTH_GAP, 0, 0, this.getBackground())); |
||||||
|
} |
||||||
|
} |
@ -1,28 +0,0 @@ |
|||||||
package com.fr.design.mainframe.cell; |
|
||||||
|
|
||||||
import com.fr.design.dialog.BasicPane; |
|
||||||
|
|
||||||
/** |
|
||||||
* 右侧单元格元素面板抽象类 |
|
||||||
* |
|
||||||
* @author yaoh.wu |
|
||||||
* @version 2017年7月25日 |
|
||||||
* @since 9.0 |
|
||||||
*/ |
|
||||||
public abstract class CellEditorPane extends BasicPane { |
|
||||||
|
|
||||||
public abstract String getIconPath(); |
|
||||||
|
|
||||||
public abstract String title4PopupWindow(); |
|
||||||
|
|
||||||
/** |
|
||||||
* 从面板拿数据保存 |
|
||||||
*/ |
|
||||||
public abstract void update(); |
|
||||||
|
|
||||||
/** |
|
||||||
* 更新面板数据 |
|
||||||
* |
|
||||||
*/ |
|
||||||
public abstract void populate(); |
|
||||||
} |
|