forked from fanruan/design
Henry.Wang
3 years ago
23 changed files with 208 additions and 102 deletions
@ -1,9 +1,25 @@ |
|||||||
package com.fr.design.base.mode; |
package com.fr.design.base.mode; |
||||||
|
|
||||||
|
|
||||||
|
import com.fr.design.mainframe.DesignerContext; |
||||||
|
|
||||||
public enum DesignerMode { |
public enum DesignerMode { |
||||||
NORMAL, |
NORMAL, |
||||||
BAN_COPY_AND_CUT, |
BAN_COPY_AND_CUT, |
||||||
VCS, |
VCS, |
||||||
AUTHORITY, |
AUTHORITY { |
||||||
DUCHAMP |
@Override |
||||||
|
public void closeMode() { |
||||||
|
DesignerContext.getDesignerFrame().closeAuthorityMode(); |
||||||
|
} |
||||||
|
}, |
||||||
|
DUCHAMP; |
||||||
|
|
||||||
|
public void openMode() { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void closeMode() { |
||||||
|
} |
||||||
|
|
||||||
} |
} |
||||||
|
@ -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