Browse Source

Merge pull request #14813 in DESIGN/design from fbp/release to fbp/feature

* commit '6514ac64266d41f731c4b2e5226b712ba216fa79':
  REPORT-134411 DataOperatorProvider接口适配Connection 优化部分写法
  REPORT-134498 修复启动页的环境卡片边框问题
  REPORT-134411 DataOperatorProvider接口适配Connection
  行式放一行
  去除包名
  去除包名
  去掉包名
  REPORT-134248 启动页优化
  修改注释
  当button点击时不转换成字母
  基于UISpinner新增字母spinner
  REPORT-134321 【fr-fbp回归】设计器和服务器网络不通,远程报错未知错误
fbp/feature
superman 3 months ago
parent
commit
043410f0b4
  1. 47
      designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java
  2. 15
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  3. 3
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  4. 10
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  5. 2
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  6. 19
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  7. 9
      designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java
  8. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  9. 101
      designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java
  10. 11
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  11. 152
      designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java
  12. 39
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  13. 19
      designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java
  14. 47
      designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java
  15. 8
      designer-base/src/test/java/com/fr/design/gui/storybook/components/ButtonStoryBoard.java
  16. 13
      designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java
  17. 3
      designer-realize/src/main/java/com/fr/start/CarinaDesigner.java

47
designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java

@ -44,6 +44,9 @@ import static com.formdev.flatlaf.util.UIScale.scale;
*/ */
public class FineUIUtils { public class FineUIUtils {
public static final String LEFT = "LEFT";
public static final String RIGHT = "RIGHT";
public static final int RETINA_SCALE_FACTOR = 2; public static final int RETINA_SCALE_FACTOR = 2;
/** /**
@ -212,17 +215,48 @@ public class FineUIUtils {
*/ */
public static void paintPartRoundButtonBorder(Component c, Graphics2D g2, int x, int y, int width, int height, public static void paintPartRoundButtonBorder(Component c, Graphics2D g2, int x, int y, int width, int height,
float borderWidth, float arc) { float borderWidth, float arc) {
if (isLeftRoundButton(c)) {
paintPartRoundButtonBorder(g2, x, y, width, height, borderWidth, arc, LEFT, false);
} else {
paintPartRoundButtonBorder(g2, x, y, width, height, borderWidth, arc, RIGHT, false);
}
}
/**
* 绘制部分圆角矩形边框
*
* @param g2 Graphics2D
* @param x x坐标
* @param y y坐标
* @param width 宽度
* @param height 高度
* @param borderWidth 边框宽度
* @param arc 圆角
* @param roundPart 圆角的方位当前只能设置一侧
* @param closedPath 是否封闭非圆角那一侧是否有边框是为有边框
*/
public static void paintPartRoundButtonBorder(Graphics2D g2, int x, int y, int width, int height,
float borderWidth, float arc, String roundPart, boolean closedPath) {
FlatUIUtils.setRenderingHints(g2); FlatUIUtils.setRenderingHints(g2);
arc = scale(arc); arc = scale(arc);
float t = scale(borderWidth); float t = scale(borderWidth);
float t2x = t * 2; float t2x = t * 2;
Path2D path2D = new Path2D.Float(Path2D.WIND_EVEN_ODD); Path2D path2D = new Path2D.Float(Path2D.WIND_EVEN_ODD);
if (isLeftRoundButton(c)) { switch (roundPart) {
path2D.append(createLeftRoundRectangle(x, y, width, height, arc), false);
path2D.append(createLeftRoundRectangle(x + t, y + t, width - t, height - t2x, arc - t), false); case LEFT: {
} else { path2D.append(createLeftRoundRectangle(x, y, width, height, arc), false);
path2D.append(createRightRoundRectangle(x, y, width, height, arc), false); path2D.append(createLeftRoundRectangle(x + t, y + t,
path2D.append(createRightRoundRectangle(x, y + t, width - t, height - t2x, arc - t), false); width - (closedPath ? t2x : t), height - t2x, arc - t), false);
break;
}
case RIGHT:
default: {
path2D.append(createRightRoundRectangle(x, y, width, height, arc), false);
path2D.append(createRightRoundRectangle(x + (closedPath ? t : 0), y + t,
width - (closedPath ? t2x : t), height - t2x, arc - t), false);
break;
}
} }
g2.fill(path2D); g2.fill(path2D);
} }
@ -452,6 +486,7 @@ public class FineUIUtils {
/** /**
* 创建一个支持自动换行的提示文本 * 创建一个支持自动换行的提示文本
*
* @param text 显示的文本内容 * @param text 显示的文本内容
* @return 自动换行提示文本 * @return 自动换行提示文本
*/ */

15
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -104,8 +104,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
* The manager of Designer GUI. * The manager of Designer GUI.
* 下面的作者日期都是随手写的具体作者已经无法考究 * 下面的作者日期都是随手写的具体作者已经无法考究
* *
* @author anonymous * @author anonymous
* @version 11.0 * @version 11.0
* created by anonymous on 2002/11/08 * created by anonymous on 2002/11/08
*/ */
public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReadable { public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReadable {
@ -1713,7 +1713,16 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReada
} }
} }
} }
Carina.config(LanguageConfigProvider.class).setLocale(CommonUtils.localeToString(designerEnvManager.getLanguage())); setLocale();
}
private static void setLocale() {
try {
Carina.config(LanguageConfigProvider.class)
.setLocale(CommonUtils.localeToString(designerEnvManager.getLanguage()));
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} }

3
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -180,8 +180,9 @@ public class EnvChangeEntrance {
private boolean doSwitch2Env(final String envName, PopTipStrategy strategy) { private boolean doSwitch2Env(final String envName, PopTipStrategy strategy) {
DesignerWorkspaceInfo selectedEnv = getSelectedEnv(envName); DesignerWorkspaceInfo selectedEnv = getSelectedEnv(envName);
EnvBackupHelper.getInstance().backup();
try { try {
EnvBackupHelper.getInstance().backup();
Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv); Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
if (notValid(workspace, selectedEnv)) { if (notValid(workspace, selectedEnv)) {
return false; return false;

10
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -25,6 +25,7 @@ import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget; import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier; import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.log.FineLoggerFactory;
import com.fr.report.LockItem; import com.fr.report.LockItem;
import com.fr.security.encryption.transmission.TransmissionEncryptionManager; import com.fr.security.encryption.transmission.TransmissionEncryptionManager;
import com.fr.workspace.server.repository.connection.ConnectionRepository; import com.fr.workspace.server.repository.connection.ConnectionRepository;
@ -86,14 +87,13 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
final List<ServerDataSetBean> beans = TableDataRepository.getInstance().getAllTableData(); final List<ServerDataSetBean> beans = TableDataRepository.getInstance().getAllTableData();
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
final Map<String, TableData> tableDataMap = new HashMap<>(); final Map<String, TableData> tableDataMap = new HashMap<>();
try { for (ServerDataSetBean bean : beans) {
for (ServerDataSetBean bean : beans) { try {
tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData())); tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData()));
} catch (Exception e) {
FineLoggerFactory.getLogger().error("[TableData] getTableData :{} failed!", bean.getDatasetName(), e);
} }
} catch (Exception e) {
throw new RuntimeException(e);
} }
final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() { final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() {
public void complete() { public void complete() {
populate(tableDataMap); populate(tableDataMap);

2
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -1022,7 +1022,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
dgEdit(getTableDataInstance().creatTableDataPane(), createDsName(getNamePrefix()), false); DesignCacheManager.processByCacheTableData(() -> dgEdit(getTableDataInstance().creatTableDataPane(), createDsName(getNamePrefix()), false));
} }
} }

19
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -349,25 +349,6 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
} }
} }
private boolean saveByOldWay(List<String> removedConnNames, List<ConnectionBean> addedOrUpdatedConnections) {
final int remaining = ConnectionConfigProviderFactory.getConfigProvider().getRemainingCon(removedConnNames.size(), addedOrUpdatedConnections.size());
try {
removedConnNames.forEach(n -> ConnectionConfigWriterFactory.getConfigWriter().removeConnection(n));
int innerRemaining = remaining;
for (ConnectionBean cb : addedOrUpdatedConnections) {
if (innerRemaining > 0) {
ConnectionConfigWriterFactory.getConfigWriter().addConnectionWithoutCheck(cb.getName(), cb.getConnection());
innerRemaining--;
} else {
break;
}
}
return true;
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return false;
}
public static void showDialog(Window parent) { public static void showDialog(Window parent) {
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());

9
designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java

@ -82,16 +82,19 @@ public class ConnectionInfoBeanHelper {
* 根据bean创建连接 * 根据bean创建连接
*/ */
public static Connection createConnection(ConnectionInfoBean infoBean) { public static Connection createConnection(ConnectionInfoBean infoBean) {
Connection connection = null;
try { try {
if (JDBCConnectionProcessor.KEY.acceptConnectionTypes().contains(infoBean.getConnectionType())) { if (JDBCConnectionProcessor.KEY.acceptConnectionTypes().contains(infoBean.getConnectionType())) {
return createJDBCConnection(infoBean); connection = createJDBCConnection(infoBean);
} else { } else {
return ConnectionProcessorFactory.createConnection(infoBean, true); connection = ConnectionProcessorFactory.createConnection(infoBean, true);
} }
connection.setConnectionName(infoBean.getConnectionName());
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
return null; return connection;
} }
return connection;
} }
/** /**

4
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -188,6 +188,10 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
} }
private boolean isAutoParameterDatabase() { private boolean isAutoParameterDatabase() {
String name = connectionTableProcedurePane.getSelectedDatabaseConnnectonName();
if (StringUtils.isEmpty(name)) {
return false;
}
Connection connection = ConnectionInfoBeanHelper.createConnection(ConnectionRepository.getInstance().getByName(connectionTableProcedurePane.getSelectedDatabaseConnnectonName())); Connection connection = ConnectionInfoBeanHelper.createConnection(ConnectionRepository.getInstance().getByName(connectionTableProcedurePane.getSelectedDatabaseConnnectonName()));
return connection != null && ArrayUtils.contains(DRIVERS, connection.getDriver()); return connection != null && ArrayUtils.contains(DRIVERS, connection.getDriver());
} }

101
designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java

@ -1,32 +1,22 @@
package com.fr.design.gui.columnrow; package com.fr.design.gui.columnrow;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ispinner.ColumnRowSpinner; import com.fr.design.gui.ispinner.FineUpperCaseSpinner;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.UpperCaseSpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.JFormattedTextField;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SpinnerListModel;
import javax.swing.JSpinner.DefaultEditor;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.text.AbstractDocument;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.DocumentFilter;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.swing.ui.layout.Layouts.fix;
@ -40,29 +30,17 @@ import static com.fine.swing.ui.layout.Layouts.row;
public class ColumnRowPane extends JPanel implements UIObserver { public class ColumnRowPane extends JPanel implements UIObserver {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static String[] columnarray = new String[1000];
private static String[] rowarray = new String[5000];
protected FineUpperCaseSpinner columnSpinner;
protected UpperCaseSpinner columnSpinner; protected UISpinner rowSpinner;
protected UIBasicSpinner rowSpinner;
static {
for (int i = 1; i <= 1000; i++) {
columnarray[i - 1] = StableUtils.convertIntToABC(i);
}
for (int i = 1; i <= 5000; i++) {
rowarray[i - 1] = StringUtils.EMPTY + i;
}
}
protected DocumentListener d = new DocumentListener() { protected DocumentListener d = new DocumentListener() {
@Override @Override
public void removeUpdate(DocumentEvent e) { public void removeUpdate(DocumentEvent e) {
String rolText = ((DefaultEditor) columnSpinner.getEditor()).getTextField().getText(); String rolText = columnSpinner.getTextFieldNew().getText();
String rowText = ((DefaultEditor) rowSpinner.getEditor()).getTextField().getText(); String rowText = rowSpinner.getTextField().getText();
if (rolText == null || rolText.length() == 0 || rowText == null || rowText.length() == 0) { if (rolText == null || rolText.length() == 0 || rowText == null || rowText.length() == 0) {
return; return;
} }
@ -73,8 +51,8 @@ public class ColumnRowPane extends JPanel implements UIObserver {
@Override @Override
public void insertUpdate(DocumentEvent e) { public void insertUpdate(DocumentEvent e) {
int col = StableUtils.convertABCToInt(((DefaultEditor) columnSpinner.getEditor()).getTextField().getText()) - 1; int col = StableUtils.convertABCToInt(columnSpinner.getTextFieldNew().getText()) - 1;
int row = Integer.parseInt(((DefaultEditor) rowSpinner.getEditor()).getTextField().getText()) - 1; int row = Integer.parseInt(rowSpinner.getTextField().getText()) - 1;
setColumnRow(ColumnRow.valueOf(col, row)); setColumnRow(ColumnRow.valueOf(col, row));
} }
@ -128,58 +106,21 @@ public class ColumnRowPane extends JPanel implements UIObserver {
protected void initRowSpinner() { protected void initRowSpinner() {
rowSpinner = new ColumnRowSpinner((new SpinnerListModel(rowarray))) { rowSpinner = new UISpinner(1, 5000, 1);
public boolean shouldResponseChangeListener() {
return false;
}
};
rowSpinner.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
JFormattedTextField rftf = GUICoreUtils.getSpinnerTextField(rowSpinner);
if (rftf != null) {
rftf.setColumns(4); // specify more width than we need
rftf.setHorizontalAlignment(UITextField.LEFT);
}
} }
protected void initColSpinner() { protected void initColSpinner() {
SpinnerListModel columnSpinnerListModel = new SpinnerListModel(columnarray); columnSpinner = new FineUpperCaseSpinner(1, 5000, 1);
columnSpinner = new UpperCaseSpinner(columnSpinnerListModel) {
public boolean shouldResponseChangeListener() {
return false;
}
};
columnSpinner.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
JFormattedTextField cftf = GUICoreUtils.getSpinnerTextField(columnSpinner);
if (cftf != null) {
cftf.setColumns(3); // specify more width than we need
cftf.setHorizontalAlignment(UITextField.LEFT);
}else {
throw new IllegalArgumentException("Spinner'Editor can not be null!");
}
((AbstractDocument) cftf.getDocument()).setDocumentFilter(new DocumentFilter() {
public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
fb.insertString(offset, string.toUpperCase(), attr);
}
public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr) throws BadLocationException {
if (string != null) {
string = string.toUpperCase();
}
fb.replace(offset, length, string, attr);
}
});
} }
protected void addDocumentListener(DocumentListener l) { protected void addDocumentListener(DocumentListener l) {
((DefaultEditor) columnSpinner.getEditor()).getTextField().getDocument().addDocumentListener(l); columnSpinner.getTextFieldNew().getDocument().addDocumentListener(l);
((DefaultEditor) rowSpinner.getEditor()).getTextField().getDocument().addDocumentListener(l); rowSpinner.getTextField().getDocument().addDocumentListener(l);
} }
private void removeDocumentListener(DocumentListener l) { private void removeDocumentListener(DocumentListener l) {
((DefaultEditor) columnSpinner.getEditor()).getTextField().getDocument().removeDocumentListener(l); columnSpinner.getTextFieldNew().getDocument().removeDocumentListener(l);
((DefaultEditor) rowSpinner.getEditor()).getTextField().getDocument().removeDocumentListener(l); rowSpinner.getTextField().getDocument().removeDocumentListener(l);
} }
/** /**
@ -208,17 +149,13 @@ public class ColumnRowPane extends JPanel implements UIObserver {
column = 0; column = 0;
} }
removeDocumentListener(d); removeDocumentListener(d);
String colValue = StableUtils.convertIntToABC(column + 1); columnSpinner.setValue(column+1);
columnSpinner.setValue(colValue);
((DefaultEditor) columnSpinner.getEditor()).getTextField().setText(colValue);
int row = columnRow.getRow(); int row = columnRow.getRow();
// shoc 小于0就蹦了 // shoc 小于0就蹦了
if (row < 0) { if (row < 0) {
row = 0; row = 0;
} }
String rowValue = Integer.toString(row + 1); rowSpinner.setValue(row+1);
rowSpinner.setValue(rowValue);
((DefaultEditor) rowSpinner.getEditor()).getTextField().setText(rowValue);
addDocumentListener(d); addDocumentListener(d);
fireChanged(); fireChanged();
} }

11
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -123,7 +123,7 @@ public class TableViewList extends UIList {
if (refresh) { if (refresh) {
clearCache(datasource); clearCache(datasource);
} }
return processDataInAnotherThread(databaseName, searchFilter, typesFilter); return processDataInAnotherThread(datasource, searchFilter, typesFilter);
} }
@Override @Override
@ -144,7 +144,7 @@ public class TableViewList extends UIList {
} }
private void clearCache(Connection datasource) { private void clearCache(Connection datasource) {
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); String[] schemas = DataCoreUtils.getDatabaseSchemaByName(datasource);
schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas; schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas;
for (String schema : schemas) { for (String schema : schemas) {
doClearCache(datasource, schema); doClearCache(datasource, schema);
@ -166,18 +166,17 @@ public class TableViewList extends UIList {
* @param searchFilter * @param searchFilter
* @param typesFilter * @param typesFilter
*/ */
private DefaultListModel processDataInAnotherThread(String databaseName, String searchFilter, String... typesFilter) throws Exception { private DefaultListModel processDataInAnotherThread(Connection datasource, String searchFilter, String... typesFilter) throws Exception {
DefaultListModel defaultListModel = new DefaultListModel(); DefaultListModel defaultListModel = new DefaultListModel();
Connection datasource = ConnectionInfoBeanHelper.createConnection(ConnectionRepository.getInstance().getByName(databaseName));
if (datasource == null) { if (datasource == null) {
return defaultListModel; return defaultListModel;
} }
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); String[] schemas = DataCoreUtils.getDatabaseSchemaByName(datasource);
searchFilter = searchFilter.toLowerCase(); searchFilter = searchFilter.toLowerCase();
boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace(); boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace();
// oracle不勾选显示所有表,则只显示用户下的(包括存储过程和table表) // oracle不勾选显示所有表,则只显示用户下的(包括存储过程和table表)
DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(datasource, isOracleSystemSpace); DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(datasource.getConnectionName(), isOracleSystemSpace);
if (ArrayUtils.isNotEmpty(detail.getSchemas())) { if (ArrayUtils.isNotEmpty(detail.getSchemas())) {
schemas = detail.getSchemas(); schemas = detail.getSchemas();
} }

152
designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java

@ -0,0 +1,152 @@
package com.fr.design.gui.ispinner;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.AbstractDocument;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.DocumentFilter;
import java.awt.BorderLayout;
import java.awt.Insets;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* 字母spinner
*
* @author Renekton
* @since 11.0
* @Created on 2024/09/11
*/
public class FineUpperCaseSpinner extends UISpinner {
private UITextField textField;
public FineUpperCaseSpinner(double minValue, double maxValue, double dierta) {
super(minValue, maxValue, dierta);
}
protected void initComponents() {
setLayout(new BorderLayout());
textField = initTextField();
Insets insets = FineUIUtils.getUIInsets("InputTextField.borderInsets", defaultInsets);
textField.setBorder(new ScaledEmptyBorder(insets.top, insets.left, insets.bottom, insets.right));
textField.setOpaque(false);
add(textField, BorderLayout.CENTER);
setValue(value);
initArrowPane();
componentInitListeners();
}
protected void setTextField(double value) {
textField.getDocument().removeDocumentListener(docListener);
textField.setText(StableUtils.convertIntToABC((int)value).toUpperCase());
textField.getDocument().addDocumentListener(docListener);
}
protected UITextField initTextField() {
int columns = this.numberFieldColumns == 0 ? DEFAULT_NUMBERFIELD_COLUMNS : this.numberFieldColumns;
UITextField textField = new UITextField(columns) {
public boolean shouldResponseChangeListener() {
return false;
}
};
((AbstractDocument) textField.getDocument()).setDocumentFilter(new DocumentFilter() {
public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
fb.insertString(offset, string.toUpperCase(), attr);
}
public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr) throws BadLocationException {
if (string != null) {
string = string.toUpperCase();
}
fb.replace(offset, length, string, attr);
}
});
return textField;
}
protected DocumentListener docListener = new DocumentListener() {
@Override
public void removeUpdate(DocumentEvent e) {
setTextFieldValue(getTextValue());
}
@Override
public void insertUpdate(DocumentEvent e) {
setTextFieldValue(getTextValue());
}
@Override
public void changedUpdate(DocumentEvent e) {
setTextFieldValue(getTextValue());
}
};
protected void initTextFiledListeners() {
textField.getDocument().removeDocumentListener(docListener);
textField.getDocument().addDocumentListener(docListener);
textField.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
textFieldFocus = true;
}
@Override
public void focusLost(FocusEvent e) {
textFieldFocus = false;
textField.getDocument().removeDocumentListener(docListener);
if (!preAction && !nextAction) {
textField.setText(StableUtils.convertIntToABC((int)value).toUpperCase());
}
textField.getDocument().addDocumentListener(docListener);
preAction = false;
nextAction = false;
}
});
}
protected void initTextMouseListener() {
textField.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
hover = true;
repaint();
}
@Override
public void mouseExited(MouseEvent e) {
hover = false;
repaint();
}
});
}
public UITextField getTextFieldNew() {
return textField;
}
private double getTextValue() {
try {
if (StringUtils.isEmpty(textField.getText())) {
return 1;
} else if (StringUtils.isNumber(textField.getText())) {
return Double.parseDouble(textField.getText());
}
return StableUtils.convertABCToInt(textField.getText());
} catch (NumberFormatException numberFormatException) {
return 1;
}
}
}

39
designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java

@ -13,7 +13,6 @@ import com.fr.design.gui.itextfield.UINumberField;
import com.fr.stable.CommonUtils; import com.fr.stable.CommonUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -46,11 +45,11 @@ import static com.fine.theme.utils.FineUIStyle.setStyle;
*/ */
public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, HoverAware { public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, HoverAware {
private final Insets defaultInsets = new Insets(0, 6, 0, 6); protected final Insets defaultInsets = new Insets(0, 6, 0, 6);
private final int defaultButtonSize = 24; private final int defaultButtonSize = 24;
private final int ICON_WIDTH = 12; private final int ICON_WIDTH = 12;
protected double value; protected double value;
private static final int DEFAULT_NUMBERFIELD_COLUMNS = 2; protected static final int DEFAULT_NUMBERFIELD_COLUMNS = 2;
private UINumberField textField; private UINumberField textField;
private UIButton preButton; private UIButton preButton;
private UIButton nextButton; private UIButton nextButton;
@ -64,10 +63,14 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver,
/** /**
* Spinner内的数字文本框长度 * Spinner内的数字文本框长度
*/ */
private int numberFieldColumns; protected int numberFieldColumns;
private boolean textFieldFocus = false; protected boolean textFieldFocus = false;
private boolean hover; protected boolean hover;
protected boolean preAction;
protected boolean nextAction;
private static final String UI_CLASS_ID = "InputUI"; private static final String UI_CLASS_ID = "InputUI";
@ -116,6 +119,11 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver,
}); });
} }
initTextMouseListener();
}
protected void initTextMouseListener() {
textField.addMouseListener(new MouseAdapter() { textField.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
@ -129,7 +137,6 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver,
repaint(); repaint();
} }
}); });
} }
/** /**
@ -281,19 +288,24 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver,
return hover; return hover;
} }
private void initComponents() { protected void initComponents() {
setLayout(new BorderLayout());
textField = initNumberField(); textField = initNumberField();
textField.setMaxValue(maxValue); textField.setMaxValue(maxValue);
textField.setMinValue(minValue); textField.setMinValue(minValue);
Insets insets = FineUIUtils.getUIInsets("InputTextField.borderInsets", defaultInsets); Insets insets = FineUIUtils.getUIInsets("InputTextField.borderInsets", defaultInsets);
textField.setBorder(new ScaledEmptyBorder(insets.top, insets.left, insets.bottom, insets.right)); textField.setBorder(new ScaledEmptyBorder(insets.top, insets.left, insets.bottom, insets.right));
textField.setOpaque(false); textField.setOpaque(false);
add(textField, BorderLayout.CENTER);
setValue(value); setValue(value);
initArrowPane();
componentInitListeners();
}
protected void initArrowPane() {
preButton = createArrowButton(new LazyIcon("up_arrow", ICON_WIDTH)); preButton = createArrowButton(new LazyIcon("up_arrow", ICON_WIDTH));
nextButton = createArrowButton(new LazyIcon("down_arrow", ICON_WIDTH)); nextButton = createArrowButton(new LazyIcon("down_arrow", ICON_WIDTH));
setLayout(new BorderLayout());
add(textField, BorderLayout.CENTER);
JPanel arrowPane = new JPanel(); JPanel arrowPane = new JPanel();
arrowPane.setLayout(new GridLayout(2, 1)); arrowPane.setLayout(new GridLayout(2, 1));
arrowPane.add(preButton); arrowPane.add(preButton);
@ -304,7 +316,6 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver,
int buttonHeight = FineUIUtils.getAndScaleInt("InputButton.height", defaultButtonSize); int buttonHeight = FineUIUtils.getAndScaleInt("InputButton.height", defaultButtonSize);
arrowPane.setPreferredSize(new Dimension(buttonWidth, buttonHeight)); arrowPane.setPreferredSize(new Dimension(buttonWidth, buttonHeight));
add(arrowPane, BorderLayout.EAST); add(arrowPane, BorderLayout.EAST);
componentInitListeners();
} }
private UIButton createArrowButton(Icon icon) { private UIButton createArrowButton(Icon icon) {
@ -337,16 +348,18 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver,
textField.setMinValue(minValue); textField.setMinValue(minValue);
} }
private void componentInitListeners() { protected void componentInitListeners() {
preButton.addActionListener(new ActionListener() { preButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
preAction = true;
setValue(value + dierta); setValue(value + dierta);
} }
}); });
nextButton.addActionListener(new ActionListener() { nextButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
nextAction = true;
setValue(value - dierta); setValue(value - dierta);
} }
}); });
@ -391,7 +404,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver,
return numberField; return numberField;
} }
private DocumentListener docListener = new DocumentListener() { protected DocumentListener docListener = new DocumentListener() {
@Override @Override
public void removeUpdate(DocumentEvent e) { public void removeUpdate(DocumentEvent e) {
setTextFieldValue(textField.getValue()); setTextFieldValue(textField.getValue());

19
designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java

@ -3,7 +3,6 @@ package com.fr.design.write.submit;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.GraphHelper;
import com.fr.data.AbstractClassJob; import com.fr.data.AbstractClassJob;
import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -18,7 +17,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.stable.ListMap; import com.fr.stable.ListMap;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.i18n.Toolkit;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -28,7 +27,6 @@ import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.flex;
/** /**
* Author : Shockway * Author : Shockway
@ -45,11 +43,12 @@ public abstract class CustomJobPane extends BasicBeanPane {
JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
classNameTextField = new UITextField(); classNameTextField = new UITextField();
UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); UIButton browserButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Select"));
UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); UIButton editButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Edit"));
UITextArea area = new UITextArea(2, 1); UITextArea area = new UITextArea(2, 1);
area.setText(Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask"));
browserButton.addActionListener(new ActionListener() { browserButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -60,7 +59,7 @@ public abstract class CustomJobPane extends BasicBeanPane {
new DialogActionAdapter() { new DialogActionAdapter() {
public void doOk() { public void doOk() {
classNameTextField.setText(bPane.getClassPath()); classNameTextField.setText(bPane.getClassPath());
area.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); area.setText(Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask"));
checkAddButtonEnable(); checkAddButtonEnable();
} }
}).setVisible(true); }).setVisible(true);
@ -74,7 +73,7 @@ public abstract class CustomJobPane extends BasicBeanPane {
new DialogActionAdapter() { new DialogActionAdapter() {
public void doOk() { public void doOk() {
classNameTextField.setText(javaEditorPane.getClassText()); classNameTextField.setText(javaEditorPane.getClassText());
area.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); area.setText(Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask"));
checkAddButtonEnable(); checkAddButtonEnable();
} }
}); });
@ -101,9 +100,9 @@ public abstract class CustomJobPane extends BasicBeanPane {
dsPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); dsPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
dsPane.add(area); dsPane.add(area);
this.add(column(20, this.add(column(20,
cell(FineUIUtils.wrapComponentWithTitle(reportletNamePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Name"))), cell(FineUIUtils.wrapComponentWithTitle(reportletNamePane, Toolkit.i18nText("Fine-Design_Basic_Class_Name"))),
cell(FineUIUtils.wrapComponentWithTitle(objectProperiesPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property"))).weight(1.0), cell(FineUIUtils.wrapComponentWithTitle(objectProperiesPane, Toolkit.i18nText("Fine-Design_Basic_Property"))).weight(1.0),
cell(FineUIUtils.wrapComponentWithTitle(dsPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Job_Description"))) cell(FineUIUtils.wrapComponentWithTitle(dsPane, Toolkit.i18nText("Fine-Design_Basic_Custom_Job_Description")))
).getComponent()); ).getComponent());
checkAddButtonEnable(); checkAddButtonEnable();
} }

47
designer-base/src/main/java/com/fr/startup/ui/StartupPageWorkspacePanel.java

@ -7,7 +7,6 @@ import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.components.tooltip.ModernToolTip;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.FRGraphics2D; import com.fr.design.gui.itextfield.FRGraphics2D;
@ -22,10 +21,8 @@ import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollBar; import javax.swing.JScrollBar;
import javax.swing.JToolTip;
import javax.swing.JViewport; import javax.swing.JViewport;
import javax.swing.ScrollPaneConstants; import javax.swing.ScrollPaneConstants;
import java.awt.BasicStroke;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
@ -140,6 +137,7 @@ public class StartupPageWorkspacePanel extends JPanel {
this.contentPanel.setOpaque(false); this.contentPanel.setOpaque(false);
this.add(contentPanel, BorderLayout.NORTH); this.add(contentPanel, BorderLayout.NORTH);
} }
private JComponent generateUnLimitContentPanel(List<List<StartupWorkspaceBean>> partitions) { private JComponent generateUnLimitContentPanel(List<List<StartupWorkspaceBean>> partitions) {
JComponent panel = generateUnLimitContentPanel0(partitions); JComponent panel = generateUnLimitContentPanel0(partitions);
@ -228,7 +226,7 @@ public class StartupPageWorkspacePanel extends JPanel {
g.fillRoundRect(0, 0, preferredSize.width, preferredSize.height, 5, 5); g.fillRoundRect(0, 0, preferredSize.width, preferredSize.height, 5, 5);
} }
} }
}; };
showAllPanel.setLayout(new BorderLayout()); showAllPanel.setLayout(new BorderLayout());
UILabel fontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Expand_All")); UILabel fontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Expand_All"));
@ -287,10 +285,6 @@ public class StartupPageWorkspacePanel extends JPanel {
AtomicReference<Color> borderColorRef = new AtomicReference<>(null); AtomicReference<Color> borderColorRef = new AtomicReference<>(null);
JPanel selectWorkspacePanel = new JPanel() { JPanel selectWorkspacePanel = new JPanel() {
@Override
public JToolTip createToolTip() {
return new ModernToolTip();
}
@Override @Override
protected void paintComponent(Graphics g) { protected void paintComponent(Graphics g) {
@ -316,16 +310,15 @@ public class StartupPageWorkspacePanel extends JPanel {
if (borderColor != null) { if (borderColor != null) {
g2d.setColor(borderColor); g2d.setColor(borderColor);
g2d.setStroke(new BasicStroke(BORDER_THIN)); FineUIUtils.paintPartRoundButtonBorder(g2d, 0, 0,
FlatUIUtils.setRenderingHints(g2d); this.getWidth(), this.getHeight(),
Path2D path2D = FineUIUtils.createLeftRoundRectangle(0, 0, BORDER_THIN, ARC_DIAMETER,
getWidth() - BORDER_THIN, getHeight() - BORDER_THIN, ARC_DIAMETER); FineUIUtils.LEFT, true);
g2d.draw(path2D);
} }
} }
}; };
selectWorkspacePanel.setLayout(new BorderLayout()); selectWorkspacePanel.setLayout(new BorderLayout());
selectWorkspacePanel.setToolTipText(Toolkit.i18nText("Fine-Design_Startup_Page_Double_Click_Enter_Workspace")); selectWorkspacePanel.setToolTipText(workspaceInfo.getPath());
selectWorkspacePanel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); selectWorkspacePanel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
{ {
@ -348,7 +341,7 @@ public class StartupPageWorkspacePanel extends JPanel {
FineUIUtils.setFontSize(nameLabel, NAME_LABEL_SIZE); FineUIUtils.setFontSize(nameLabel, NAME_LABEL_SIZE);
nameLabel.setPreferredSize(PATH_DIMENSION); nameLabel.setPreferredSize(PATH_DIMENSION);
Color nameForeground = nameLabel.getForeground(); Color nameForeground = nameLabel.getForeground();
simpleDescPanel.add(nameLabel,BorderLayout.NORTH); simpleDescPanel.add(nameLabel, BorderLayout.NORTH);
UILabel pathLabel = new UILabel(workspaceInfo.getPath()); UILabel pathLabel = new UILabel(workspaceInfo.getPath());
pathLabel.setPreferredSize(PATH_DIMENSION); pathLabel.setPreferredSize(PATH_DIMENSION);
@ -369,7 +362,7 @@ public class StartupPageWorkspacePanel extends JPanel {
Color hoverColor = FlatUIUtils.getUIColor("brand.normal", HOVER_COLOR); Color hoverColor = FlatUIUtils.getUIColor("brand.normal", HOVER_COLOR);
borderColorRef.set(hoverColor); borderColorRef.set(hoverColor);
nameLabel.setForeground(hoverColor); nameLabel.setForeground(hoverColor);
pathLabel.setForeground(hoverColor ); pathLabel.setForeground(hoverColor);
repaintAll(); repaintAll();
} }
@ -394,12 +387,7 @@ public class StartupPageWorkspacePanel extends JPanel {
}; };
UILabel arrowLabel = new UILabel(new LazyIcon("more_arrow", 20)) { UILabel arrowLabel = new UILabel(new LazyIcon("more_arrow", 20));
@Override
public JToolTip createToolTip() {
return new ModernToolTip();
}
};
arrowLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Startup_Page_Enter_Workspace")); arrowLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Startup_Page_Enter_Workspace"));
arrowLabel.addMouseListener(new MouseAdapter() { arrowLabel.addMouseListener(new MouseAdapter() {
@Override @Override
@ -433,10 +421,6 @@ public class StartupPageWorkspacePanel extends JPanel {
// 选择并新建 // 选择并新建
AtomicReference<Color> borderColorRef = new AtomicReference<>(null); AtomicReference<Color> borderColorRef = new AtomicReference<>(null);
JPanel selectAndCreatePanel = new JPanel() { JPanel selectAndCreatePanel = new JPanel() {
@Override
public JToolTip createToolTip() {
return new ModernToolTip();
}
@Override @Override
protected void paintComponent(Graphics g) { protected void paintComponent(Graphics g) {
@ -451,11 +435,11 @@ public class StartupPageWorkspacePanel extends JPanel {
Color borderColor = borderColorRef.get(); Color borderColor = borderColorRef.get();
if (borderColor != null) { if (borderColor != null) {
g2d.setColor(borderColor); g2d.setColor(borderColor);
g2d.setStroke(new BasicStroke(BORDER_THIN)); FineUIUtils.paintPartRoundButtonBorder(g2d, 0, 0,
FlatUIUtils.setRenderingHints(g2d); this.getWidth(), this.getHeight(),
Path2D path2D = FineUIUtils.createRightRoundRectangle(0, 0, BORDER_THIN, ARC_DIAMETER,
getWidth() - BORDER_THIN, getHeight() - BORDER_THIN, ARC_DIAMETER); FineUIUtils.RIGHT, true
g2d.draw(path2D); );
} }
} }
@ -481,6 +465,7 @@ public class StartupPageWorkspacePanel extends JPanel {
label.setIcon(new LazyIcon("add", 20)); label.setIcon(new LazyIcon("add", 20));
repaintAll(); repaintAll();
} }
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
pageModel.setSelectWorkspaceInfo(workspaceInfo); pageModel.setSelectWorkspaceInfo(workspaceInfo);

8
designer-base/src/test/java/com/fr/design/gui/storybook/components/ButtonStoryBoard.java

@ -3,9 +3,11 @@ package com.fr.design.gui.storybook.components;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UICombinationButton; import com.fr.design.gui.ibutton.UICombinationButton;
import com.fr.design.gui.ibutton.UISaveForbiddenButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.storybook.Story; import com.fr.design.gui.storybook.Story;
import com.fr.design.gui.storybook.StoryBoard; import com.fr.design.gui.storybook.StoryBoard;
import com.fr.design.i18n.Toolkit;
import com.fr.design.style.color.UIToolbarColorButton; import com.fr.design.style.color.UIToolbarColorButton;
import javax.swing.JButton; import javax.swing.JButton;
@ -177,7 +179,9 @@ public class ButtonStoryBoard extends StoryBoard {
.with(it -> setStyle(it, STYLE_PRIMARY)), .with(it -> setStyle(it, STYLE_PRIMARY)),
cell(new UICombinationButton("按钮2", new LazyIcon("triangle_down"))), cell(new UICombinationButton("按钮2", new LazyIcon("triangle_down"))),
cell(new JButton("按钮", new LazyIcon("add"))), cell(new JButton("按钮", new LazyIcon("add"))),
cell(new JButton(new LazyIcon("multi"))) cell(new UICombinationButton(
new UISaveForbiddenButton(Toolkit.i18nText("Fine-Design_Basic_Preview"), new LazyIcon("run").white()),
new UISaveForbiddenButton(new LazyIcon("triangle_down").white()))).with(UICombinationButton::setPrimary)
), ),
row(20, row(20,
cell(new UIToolbarColorButton(new LazyIcon("foreground"))), cell(new UIToolbarColorButton(new LazyIcon("foreground"))),
@ -189,7 +193,7 @@ public class ButtonStoryBoard extends StoryBoard {
); );
} }
public JComponent toolbar(){ public JComponent toolbar() {
JToolBar bar = new JToolBar(); JToolBar bar = new JToolBar();
UIToolbarColorButton foreground = new UIToolbarColorButton(new LazyIcon("foreground")); UIToolbarColorButton foreground = new UIToolbarColorButton(new LazyIcon("foreground"));
bar.add(foreground); bar.add(foreground);

13
designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java

@ -13,8 +13,6 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -27,6 +25,7 @@ import com.fr.stable.Nameable;
import com.fr.write.BuiltInSQLSubmiterProvider; import com.fr.write.BuiltInSQLSubmiterProvider;
import com.fr.write.DBManipulation; import com.fr.write.DBManipulation;
import com.fr.write.WClassSubmiterProvider; import com.fr.write.WClassSubmiterProvider;
import com.fr.design.i18n.Toolkit;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -53,12 +52,12 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
*/ */
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{ return new NameableCreator[]{
new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Submit_Type_Build_In_Sql"), new NameObjectCreator(Toolkit.i18nText("Fine-Design_Report_Submit_Type_Build_In_Sql"),
new LazyIcon("dataLink"), new LazyIcon("dataLink"),
BuiltInSQLSubmiter.class, BuiltInSQLSubmiter.class,
BuildInSQLPane.class), BuildInSQLPane.class),
new NameObjectCreator( new NameObjectCreator(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Submit_Type_Custom"), Toolkit.i18nText("Fine-Design_Report_Submit_Type_Custom"),
new LazyIcon("dataLink"), new LazyIcon("dataLink"),
WClassSubmiter.class, WClassSubmiter.class,
CustomPane.class) CustomPane.class)
@ -194,12 +193,10 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
csjConfigComboBox = new UIComboBox(configTypes.toArray()); csjConfigComboBox = new UIComboBox(configTypes.toArray());
JPanel typePane = new JPanel(new BorderLayout()); JPanel typePane = new JPanel(new BorderLayout());
typePane.add(row(10, typePane.add(row(10, cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), cell(csjConfigComboBox).weight(0.5), flex()).getComponent());
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))),
cell(csjConfigComboBox).weight(0.5)).getComponent());
this.add(column( this.add(column(
cell(FineUIUtils.wrapComponentWithTitle(typePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))), cell(FineUIUtils.wrapComponentWithTitle(typePane, Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))),
cell(customCardPane).weight(1.0)).getComponent()); cell(customCardPane).weight(1.0)).getComponent());
csjConfigComboBox.addItemListener(new ItemListener() { csjConfigComboBox.addItemListener(new ItemListener() {

3
designer-realize/src/main/java/com/fr/start/CarinaDesigner.java

@ -41,6 +41,7 @@ public class CarinaDesigner extends MainDesigner{
* main * main
*/ */
public static void main(String[] args) { public static void main(String[] args) {
installUIDevModeTools();
DesignerStartupContext.getRecorder().start(); DesignerStartupContext.getRecorder().start();
PartitionManager manager = new PartitionManagerImpl(); PartitionManager manager = new PartitionManagerImpl();
StateHubContext.setReady(false); StateHubContext.setReady(false);
@ -66,8 +67,6 @@ public class CarinaDesigner extends MainDesigner{
DesignerStartupContext.getRecorder().stop(); DesignerStartupContext.getRecorder().stop();
SwitchForSwingChecker.initThreadMonitoring(); SwitchForSwingChecker.initThreadMonitoring();
DesignerLatencyMetric.getInstance().start(); DesignerLatencyMetric.getInstance().start();
installUIDevModeTools();
} }
/** /**

Loading…
Cancel
Save