jeo
5 years ago
62 changed files with 795 additions and 295 deletions
@ -0,0 +1,57 @@
|
||||
package com.fr.design.formula; |
||||
|
||||
import com.fr.stable.StringUtils; |
||||
|
||||
/** |
||||
* @author Joe |
||||
* @version 10.0 |
||||
* Created by Joe on 10/30/2019 |
||||
*/ |
||||
public enum FormulaConstants { |
||||
|
||||
PAGE_NUMBER("$$page_number", "Page_Number"), |
||||
TOTAL_PAGE_NUMBER("$$totalPage_number", "Total_Page_Number"), |
||||
FINE_USERNAME("$fine_username", "Fine_Username"), |
||||
FINE_ROLE("$fine_role", "Fine_Role"), |
||||
FINE_POSITION("$fine_position", "Fine_Position"), |
||||
NULL("NULL", "Null"), |
||||
NOFILTER("NOFILTER", "No_Filter"), |
||||
REPORT_NAME("reportName", "Report_Name"), |
||||
FORMLET_NAME("formletName", "Formlet_Name"), |
||||
SERVLET_URL("servletURL", "Servlet_URL"), |
||||
SERVER_SCHEMA("serverSchema", "Server_Schema"), |
||||
SERVER_NAME("serverName", "Server_Name"), |
||||
SERVER_PORT("serverPort", "Server_Port"), |
||||
SERVER_URL("serverURL", "Server_URL"), |
||||
CONTEXT_PATH("contextPath", "Context_Path"), |
||||
SESSION_ID("sessionID", "SessionID"); |
||||
|
||||
private String key; |
||||
private String value; |
||||
private static final String KEY_PREFIX = "Fine-Design_CurReport_Variable_"; |
||||
|
||||
private FormulaConstants(String key, String value) { |
||||
this.key = key; |
||||
this.value = KEY_PREFIX + value; |
||||
} |
||||
|
||||
public String getKey() { |
||||
return key; |
||||
} |
||||
|
||||
public String getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public static String getValueByKey(String key) { |
||||
for (FormulaConstants formulaConstant : values()) { |
||||
if (formulaConstant.getKey().equals(key)) { |
||||
return formulaConstant.getValue(); |
||||
} |
||||
} |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,36 @@
|
||||
package com.fr.design.gui.ibutton; |
||||
|
||||
|
||||
import javax.swing.*; |
||||
import java.util.LinkedHashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 互斥的按钮 |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/11/12 |
||||
*/ |
||||
public class ModeButtonGroup<T> extends ButtonGroup { |
||||
|
||||
private Map<T, AbstractButton> buttonMap = new LinkedHashMap<>(); |
||||
|
||||
public void put(T t, AbstractButton button) { |
||||
add(button); |
||||
buttonMap.put(t, button); |
||||
} |
||||
|
||||
public void setSelectButton(T t) { |
||||
buttonMap.get(t).setSelected(true); |
||||
} |
||||
|
||||
public T getCurrentSelected() { |
||||
for (Map.Entry<T, AbstractButton> entry : buttonMap.entrySet()) { |
||||
if (entry.getValue().isSelected()) { |
||||
return entry.getKey(); |
||||
} |
||||
} |
||||
return buttonMap.entrySet().iterator().next().getKey(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,36 @@
|
||||
package com.fr.design.utils.gui; |
||||
|
||||
import com.fr.stable.os.OperatingSystem; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/10/29 |
||||
*/ |
||||
public enum FineDesignScreen { |
||||
|
||||
/** |
||||
* 一个临界dpi |
||||
* 设计器(windows/linux)大于等于该dpi界面ui变得很小 (jdk bug 在jdk9修复: http://openjdk.java.net/jeps/263)
|
||||
*/ |
||||
DPI_144(144); |
||||
|
||||
private int value; |
||||
|
||||
FineDesignScreen(int value) { |
||||
this.value = value; |
||||
} |
||||
|
||||
/** |
||||
* 判断win/linux下的dpi macos不做处理 |
||||
* @return |
||||
*/ |
||||
public static boolean isHighDPI() { |
||||
if (OperatingSystem.isMacos()) { |
||||
return false; |
||||
} |
||||
return Toolkit.getDefaultToolkit().getScreenResolution() >= DPI_144.value; |
||||
} |
||||
} |
@ -0,0 +1,36 @@
|
||||
package com.fr.design.widget.ui.designer.layout; |
||||
|
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.mainframe.FormDesigner; |
||||
import com.fr.design.widget.ui.designer.AbstractDataModify; |
||||
import com.fr.form.ui.container.WSortLayout; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 9.0 |
||||
* Created by hades on 2019/11/18 |
||||
*/ |
||||
public abstract class AbstractFRLayoutDefinePane<T extends WSortLayout> extends AbstractDataModify<T> { |
||||
|
||||
|
||||
public AbstractFRLayoutDefinePane(XCreator xCreator) { |
||||
super(xCreator); |
||||
} |
||||
|
||||
public AbstractFRLayoutDefinePane(XCreator xCreator, FormDesigner designer) { |
||||
super(xCreator, designer); |
||||
} |
||||
|
||||
protected void copyLayoutAttr(WSortLayout srcLayout, WSortLayout destLayout) { |
||||
destLayout.clearListeners(); |
||||
destLayout.clearMobileWidgetList(); |
||||
for (int i = 0, len = srcLayout.getMobileWidgetListSize(); i < len; i++) { |
||||
destLayout.addMobileWidget(srcLayout.getMobileWidget(i)); |
||||
} |
||||
destLayout.setSorted(true); |
||||
for (int i = 0, len = srcLayout.getListenerSize(); i < len; i++) { |
||||
destLayout.addListener(srcLayout.getListener(i)); |
||||
} |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue