@ -1,19 +1,15 @@
package com.fr.env.detect.ui ;
package com.fr.env.detect.ui ;
import com.fine.theme.light.ui.FineRoundBorder ;
import com.fine.swing.ui.layout.Layouts ;
import com.fine.theme.utils.FineUIStyle ;
import com.fine.theme.utils.FineUIStyle ;
import com.fine.theme.utils.FineUIUtils ;
import com.formdev.flatlaf.util.ScaledEmptyBorder ;
import com.formdev.flatlaf.ui.FlatUIUtils ;
import com.fr.base.svg.IconUtils ;
import com.fr.base.svg.IconUtils ;
import com.fr.design.components.notification.NotificationDialog ;
import com.fr.design.components.notification.NotificationDialog ;
import com.fr.design.components.notification.NotificationDialogProperties ;
import com.fr.design.components.notification.NotificationDialogProperties ;
import com.fr.design.components.notification.NotificationModel ;
import com.fr.design.components.notification.NotificationModel ;
import com.fr.design.components.table.TablePanel ;
import com.fr.design.components.table.TablePanel ;
import com.fr.design.constants.DesignerColor ;
import com.fr.design.constants.UIConstants ;
import com.fr.design.constants.UIConstants ;
import com.fr.design.gui.ibutton.UIButton ;
import com.fr.design.gui.ibutton.UIButton ;
import com.fr.design.gui.ibutton.UIButtonUI ;
import com.fr.design.gui.ibutton.UIToggleButton ;
import com.fr.design.gui.icheckbox.UICheckBox ;
import com.fr.design.gui.icheckbox.UICheckBox ;
import com.fr.design.gui.ilable.UILabel ;
import com.fr.design.gui.ilable.UILabel ;
import com.fr.design.i18n.Toolkit ;
import com.fr.design.i18n.Toolkit ;
@ -21,7 +17,6 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext ;
import com.fr.design.mainframe.DesignerContext ;
import com.fr.design.ui.util.UIUtil ;
import com.fr.design.ui.util.UIUtil ;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.design.utils.gui.GUIPaintUtils ;
import com.fr.env.detect.base.DetectorBridge ;
import com.fr.env.detect.base.DetectorBridge ;
import com.fr.env.detect.base.DetectorUtil ;
import com.fr.env.detect.base.DetectorUtil ;
import com.fr.env.detect.base.EnvDetectorConfig ;
import com.fr.env.detect.base.EnvDetectorConfig ;
@ -30,8 +25,6 @@ import com.fr.env.detect.bean.DetectorStatus;
import com.fr.env.detect.bean.DetectorType ;
import com.fr.env.detect.bean.DetectorType ;
import com.fr.log.FineLoggerFactory ;
import com.fr.log.FineLoggerFactory ;
import com.fr.design.carton.FeedbackToolboxDialog ;
import com.fr.design.carton.FeedbackToolboxDialog ;
import com.fr.stable.ProductConstantsBase ;
import com.fr.stable.StableUtils ;
import org.jetbrains.annotations.NotNull ;
import org.jetbrains.annotations.NotNull ;
import javax.swing.BorderFactory ;
import javax.swing.BorderFactory ;
@ -39,18 +32,15 @@ import javax.swing.ImageIcon;
import javax.swing.JDialog ;
import javax.swing.JDialog ;
import javax.swing.JPanel ;
import javax.swing.JPanel ;
import javax.swing.SwingWorker ;
import javax.swing.SwingWorker ;
import javax.swing.plaf.ButtonUI ;
import java.awt.BorderLayout ;
import java.awt.BorderLayout ;
import java.awt.Color ;
import java.awt.Color ;
import java.awt.Component ;
import java.awt.Component ;
import java.awt.Dimension ;
import java.awt.Dimension ;
import java.awt.Frame ;
import java.awt.Frame ;
import java.awt.Graphics2D ;
import java.awt.Image ;
import java.awt.Image ;
import java.awt.Cursor ;
import java.awt.Cursor ;
import java.awt.event.MouseAdapter ;
import java.awt.event.MouseAdapter ;
import java.awt.event.MouseEvent ;
import java.awt.event.MouseEvent ;
import java.io.File ;
import java.net.URL ;
import java.net.URL ;
import java.util.List ;
import java.util.List ;
import java.util.Map ;
import java.util.Map ;
@ -66,6 +56,7 @@ public class EnvDetectorDialog extends JDialog {
private static final ImageIcon LOADING_ICON = getLoadingIcon ( ) ;
private static final ImageIcon LOADING_ICON = getLoadingIcon ( ) ;
private static final int TIMEOUT = 1000 ;
private static final int TIMEOUT = 1000 ;
private static final int HORIZONTAL_GAP = 8 ;
private static final Color SUCCESS_COLOR = new Color ( 22 , 193 , 83 ) ;
private static final Color SUCCESS_COLOR = new Color ( 22 , 193 , 83 ) ;
private static final Color DETAIL_FONT_COLOR = new Color ( 65 , 155 , 249 ) ;
private static final Color DETAIL_FONT_COLOR = new Color ( 65 , 155 , 249 ) ;
@ -127,6 +118,7 @@ public class EnvDetectorDialog extends JDialog {
/* tailPanel*/
/* tailPanel*/
this . tailPanel = createTailPanel ( ) ;
this . tailPanel = createTailPanel ( ) ;
body . add ( tailPanel , BorderLayout . SOUTH ) ;
body . add ( tailPanel , BorderLayout . SOUTH ) ;
body . setBorder ( new ScaledEmptyBorder ( 10 , 10 , 10 , 10 ) ) ;
add ( body ) ;
add ( body ) ;
@ -145,7 +137,7 @@ public class EnvDetectorDialog extends JDialog {
private JPanel createHeaderPanel ( ) {
private JPanel createHeaderPanel ( ) {
JPanel headerPanel = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
JPanel headerPanel = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
headerPanel . setBorder ( BorderFactory . createEmptyBorder ( 5 , 0 , 12 , 0 ) ) ;
headerPanel . setBorder ( new ScaledEmptyBorder ( 0 , 0 , 10 , 0 ) ) ;
this . detectButton = new UIButton ( buttonStatus . getDesc ( ) ) ;
this . detectButton = new UIButton ( buttonStatus . getDesc ( ) ) ;
FineUIStyle . setStyle ( detectButton , FineUIStyle . STYLE_PRIMARY ) ;
FineUIStyle . setStyle ( detectButton , FineUIStyle . STYLE_PRIMARY ) ;
detectButton . setToolTipText ( buttonStatus . getDesc ( ) ) ;
detectButton . setToolTipText ( buttonStatus . getDesc ( ) ) ;
@ -418,7 +410,7 @@ public class EnvDetectorDialog extends JDialog {
private JPanel createTailPanel ( ) {
private JPanel createTailPanel ( ) {
JPanel tailPanel = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
JPanel tailPanel = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
tailPanel . setBorder ( BorderFactory . createEmptyBorder ( 2 0, 0 , 0 , 0 ) ) ;
tailPanel . setBorder ( new ScaledEmptyBorder ( 1 0, 0 , 0 , 0 ) ) ;
JPanel configPanel = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
JPanel configPanel = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
{
{
@ -434,25 +426,23 @@ public class EnvDetectorDialog extends JDialog {
}
}
tailPanel . add ( configPanel , BorderLayout . WEST ) ;
tailPanel . add ( configPanel , BorderLayout . WEST ) ;
JPanel actionsPanel = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
JPanel actionsPanel = Layouts . row ( HORIZONTAL_GAP ) . getComponent ( ) ;
actionsPanel . setLayout ( FRGUIPaneFactory . createM_BorderLayout ( ) ) ;
{
UIButton confirmButton = new UIButton ( Toolkit . i18nText ( "Fine-Design_Basic_Confirm" ) ) ;
confirmButton . addActionListener ( ( e ) - > {
setVisible ( false ) ;
dispose ( ) ;
// 配置处理
EnvDetectorConfig . getInstance ( ) . setEnabled ( this . detectOpen ) ;
} ) ;
actionsPanel . add ( confirmButton , BorderLayout . WEST ) ;
UIButton cancelButton = new UIButton ( Toolkit . i18nText ( "Fine-Design_Basic_Cancel" ) ) ;
UIButton confirmButton = new UIButton ( Toolkit . i18nText ( "Fine-Design_Basic_Confirm" ) ) ;
cancelButton . addActionListener ( ( e ) - > {
confirmButton . addActionListener ( ( e ) - > {
setVisible ( false ) ;
setVisible ( false ) ;
dispose ( ) ;
dispose ( ) ;
} ) ;
// 配置处理
actionsPanel . add ( cancelButton , BorderLayout . EAST ) ;
EnvDetectorConfig . getInstance ( ) . setEnabled ( this . detectOpen ) ;
}
} ) ;
actionsPanel . add ( confirmButton ) ;
UIButton cancelButton = new UIButton ( Toolkit . i18nText ( "Fine-Design_Basic_Cancel" ) ) ;
cancelButton . addActionListener ( ( e ) - > {
setVisible ( false ) ;
dispose ( ) ;
} ) ;
actionsPanel . add ( cancelButton ) ;
tailPanel . add ( actionsPanel , BorderLayout . EAST ) ;
tailPanel . add ( actionsPanel , BorderLayout . EAST ) ;
return tailPanel ;
return tailPanel ;
}
}