Browse Source
Merge in DESIGN/design from ~STARRYI/design:release/11.0 to release/11.0 * commit '80af035ce63bd01f092556ce21ec0386d9c2226a': REPORT-51919 【主题切换】复用组件适配主题切换 REPORT-59097 【主题切换】悬浮元素默认样式,应该是跟随主题的默认fix-lag
starryi
3 years ago
11 changed files with 121 additions and 42 deletions
@ -0,0 +1,41 @@
|
||||
package com.fr.design.mainframe.theme.utils; |
||||
|
||||
import com.fr.base.NameStyle; |
||||
import com.fr.base.theme.TemplateTheme; |
||||
import com.fr.base.theme.settings.ThemedCellStyle; |
||||
import com.fr.design.file.HistoryTemplateListCache; |
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.report.cell.FloatElement; |
||||
import com.fr.stable.unit.UNIT; |
||||
|
||||
/** |
||||
* @author Starryi |
||||
* @version 1.0 |
||||
* Created by Starryi on 2021/9/9 |
||||
*/ |
||||
public class DefaultThemedFloatElement { |
||||
public static FloatElement createInstance() { |
||||
return themingFloatElement(new FloatElement()); |
||||
} |
||||
|
||||
public static FloatElement createInstance(Object value) { |
||||
return themingFloatElement(new FloatElement(value)); |
||||
} |
||||
|
||||
public static FloatElement createInstance(UNIT leftDistance, UNIT topDistance, UNIT width, UNIT height, Object value) { |
||||
return themingFloatElement(new FloatElement(leftDistance, topDistance, width, height, value)); |
||||
} |
||||
|
||||
private static FloatElement themingFloatElement(FloatElement floatElement) { |
||||
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
||||
if (template != null) { |
||||
TemplateTheme theme = template.getTemplateTheme(); |
||||
ThemedCellStyle themedCellStyle = theme.getCellStyleList().getUse4Default(); |
||||
if (themedCellStyle != null) { |
||||
NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle()); |
||||
floatElement.setStyle(nameStyle); |
||||
} |
||||
} |
||||
return floatElement; |
||||
} |
||||
} |
Loading…
Reference in new issue