@ -1,9 +1,11 @@
package com.fr.design.javascript ;
package com.fr.design.javascript ;
import com.fine.theme.utils.FineUIScale ;
import com.fine.theme.utils.FineUIScale ;
import com.fine.theme.utils.FineUIStyle ;
import com.formdev.flatlaf.ui.FlatUIUtils ;
import com.formdev.flatlaf.util.ScaledEmptyBorder ;
import com.fr.base.svg.IconUtils ;
import com.fr.base.svg.IconUtils ;
import com.fr.design.border.UIRoundedBorder ;
import com.fr.design.border.FineBorderFactory ;
import com.fr.design.constants.UIConstants ;
import com.fr.design.gui.autocomplete.AutoCompleteExtraRefreshComponent ;
import com.fr.design.gui.autocomplete.AutoCompleteExtraRefreshComponent ;
import com.fr.design.gui.autocomplete.BasicCompletion ;
import com.fr.design.gui.autocomplete.BasicCompletion ;
import com.fr.design.gui.autocomplete.CompletionCellRenderer ;
import com.fr.design.gui.autocomplete.CompletionCellRenderer ;
@ -54,7 +56,6 @@ import java.awt.Color;
import java.awt.Component ;
import java.awt.Component ;
import java.awt.Cursor ;
import java.awt.Cursor ;
import java.awt.Desktop ;
import java.awt.Desktop ;
import java.awt.Dimension ;
import java.awt.event.ActionEvent ;
import java.awt.event.ActionEvent ;
import java.awt.event.ActionListener ;
import java.awt.event.ActionListener ;
import java.awt.event.FocusAdapter ;
import java.awt.event.FocusAdapter ;
@ -72,7 +73,6 @@ import java.util.ArrayList;
import java.util.Collections ;
import java.util.Collections ;
import java.util.Comparator ;
import java.util.Comparator ;
import java.util.List ;
import java.util.List ;
import java.util.Locale ;
import java.util.concurrent.ExecutionException ;
import java.util.concurrent.ExecutionException ;
public class JSContentWithDescriptionPane extends JSContentPane implements KeyListener {
public class JSContentWithDescriptionPane extends JSContentPane implements KeyListener {
@ -424,27 +424,27 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
JPanel mainPane = new JPanel ( card ) ;
JPanel mainPane = new JPanel ( card ) ;
initHelpDocumentList ( ) ;
initHelpDocumentList ( ) ;
UIScrollPane helpDOCScrollPane = new UIScrollPane ( helpDOCList ) ;
UIScrollPane helpDOCScrollPane = new UIScrollPane ( helpDOCList ) ;
helpDOCScrollPane . setPreferredSize ( new Dimension ( 200 , 200 ) ) ;
helpDOCScrollPane . setPreferredSize ( FineUIScale . createScale Dimension( 200 , 200 ) ) ;
helpDOCScrollPane . setBorder ( null ) ;
helpDOCScrollPane . setBorder ( null ) ;
mainPane . add ( helpDOCScrollPane , DOC_LIST_CARD ) ;
mainPane . add ( helpDOCScrollPane , DOC_LIST_CARD ) ;
UILabel imageLabel = new UILabel ( ) ;
UILabel imageLabel = new UILabel ( ) ;
imageLabel . setIcon ( IconUtils . readIcon ( "com/fr/design/javascript/jsapi/images/connectFailed.svg" ) ) ;
imageLabel . setIcon ( IconUtils . readIcon ( "com/fr/design/javascript/jsapi/images/connectFailed.svg" ) ) ;
imageLabel . setPreferredSize ( new Dimension ( 180 , 65 ) ) ;
imageLabel . setPreferredSize ( FineUIScale . createScale Dimension( 180 , 65 ) ) ;
JPanel imagePane = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
JPanel imagePane = FRGUIPaneFactory . createBorderLayout_S_Pane ( ) ;
imagePane . setBorder ( BorderFactory . create EmptyBorder( 0 , 42 , 0 , 0 ) ) ;
imagePane . setBorder ( new Scaled EmptyBorder( 0 , 42 , 0 , 0 ) ) ;
imagePane . add ( imageLabel ) ;
imagePane . add ( imageLabel ) ;
imagePane . setBackground ( Color . WHITE ) ;
imagePane . setBackground ( Color . WHITE ) ;
UILabel failedLabel = new UILabel ( Toolkit . i18nText ( "Fine-Design_Net_Connect_Failed" ) , 0 ) ;
UILabel failedLabel = new UILabel ( Toolkit . i18nText ( "Fine-Design_Net_Connect_Failed" ) , 0 ) ;
failedLabel . setPreferredSize ( new Dimension ( 180 , 20 ) ) ;
failedLabel . setPreferredSize ( FineUIScale . createScale Dimension( 180 , 20 ) ) ;
UILabel reloadLabel = new UILabel ( Toolkit . i18nText ( "Fine-Design_Basic_Reload" ) , 0 ) ;
UILabel reloadLabel = new UILabel ( Toolkit . i18nText ( "Fine-Design_Basic_Reload" ) , 0 ) ;
reloadLabel . setCursor ( new Cursor ( Cursor . HAND_CURSOR ) ) ;
reloadLabel . setCursor ( new Cursor ( Cursor . HAND_CURSOR ) ) ;
reloadLabel . setPreferredSize ( new Dimension ( 180 , 20 ) ) ;
reloadLabel . setPreferredSize ( FineUIScale . createScale Dimension( 180 , 20 ) ) ;
reloadLabel . setForeground ( Color . blue ) ;
reloadLabel . setForeground ( Color . blue ) ;
JPanel labelPane = FRGUIPaneFactory . createVerticalFlowLayout_Pane ( true , 0 , 0 , 0 ) ;
JPanel labelPane = FRGUIPaneFactory . createVerticalFlowLayout_Pane ( true , 0 , 0 , 0 ) ;
labelPane . setBorder ( BorderFactory . create EmptyBorder( 35 , 45 , 0 , 0 ) ) ;
labelPane . setBorder ( new Scaled EmptyBorder( 35 , 45 , 0 , 0 ) ) ;
labelPane . setBackground ( Color . WHITE ) ;
labelPane . setBackground ( Color . WHITE ) ;
labelPane . add ( imagePane ) ;
labelPane . add ( imagePane ) ;
labelPane . add ( failedLabel ) ;
labelPane . add ( failedLabel ) ;
@ -506,7 +506,7 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
super . getListCellRendererComponent ( list , value , index , isSelected , cellHasFocus ) ;
super . getListCellRendererComponent ( list , value , index , isSelected , cellHasFocus ) ;
if ( value instanceof HelpDocument ) {
if ( value instanceof HelpDocument ) {
this . setText ( ( ( HelpDocument ) value ) . getName ( ) ) ;
this . setText ( ( ( HelpDocument ) value ) . getName ( ) ) ;
this . setForeground ( Color . BLUE ) ;
this . setForeground ( FlatUIUtils . getUIColor ( "brand.normal" , Color . BLUE ) ) ;
}
}
return this ;
return this ;
}
}
@ -545,10 +545,12 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
private void initDescriptionArea ( JPanel descriptionPanel ) {
private void initDescriptionArea ( JPanel descriptionPanel ) {
descriptionTextArea = new UITextArea ( ) ;
descriptionTextArea = new UITextArea ( ) ;
descriptionTextArea . setBorder ( null ) ;
UIScrollPane descriptionScrollPane = new UIScrollPane ( descriptionTextArea ) ;
UIScrollPane descriptionScrollPane = new UIScrollPane ( descriptionTextArea ) ;
descriptionScrollPane . setPreferredSize ( new Dimension ( 300 , 200 ) ) ;
descriptionScrollPane . setBorder ( FineBorderFactory . createWrappedRoundBorder ( ) ) ;
descriptionScrollPane . setPreferredSize ( FineUIScale . createScaleDimension ( 300 , 200 ) ) ;
descriptionPanel . add ( this . createNamePane ( Toolkit . i18nText ( "Fine-Design_Interface_Description" ) , descriptionScrollPane ) , BorderLayout . CENTER ) ;
descriptionPanel . add ( this . createNamePane ( Toolkit . i18nText ( "Fine-Design_Interface_Description" ) , descriptionScrollPane ) , BorderLayout . CENTER ) ;
descriptionTextArea . setBackground ( Color . white ) ;
descriptionTextArea . setBackground ( FlatUIUtils . getUIColor ( "fill.normal" , Color . WHITE ) ) ;
descriptionTextArea . setLineWrap ( true ) ;
descriptionTextArea . setLineWrap ( true ) ;
descriptionTextArea . setWrapStyleWord ( true ) ;
descriptionTextArea . setWrapStyleWord ( true ) ;
descriptionTextArea . setEditable ( false ) ;
descriptionTextArea . setEditable ( false ) ;
@ -581,10 +583,12 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
private void initInterfaceModuleTree ( JPanel interfacePanel ) {
private void initInterfaceModuleTree ( JPanel interfacePanel ) {
moduleTree = new JTree ( ) ;
moduleTree = new JTree ( ) ;
FineUIStyle . setStyle ( moduleTree , FineUIStyle . PURE_TREE ) ;
UIScrollPane moduleTreePane = new UIScrollPane ( moduleTree ) ;
UIScrollPane moduleTreePane = new UIScrollPane ( moduleTree ) ;
moduleTreePane . setBorder ( new UIRoundedBorder ( UIConstants . LINE_COLOR , 1 , UIConstants . ARC ) ) ;
moduleTreePane . setBorder ( FineBorderFactory . createWrappedRoundBorder ( ) ) ;
interfacePanel . add ( this . createNamePane ( Toolkit . i18nText ( "Fine-Design_Module" ) , moduleTreePane ) , BorderLayout . WEST ) ;
interfacePanel . add ( this . createNamePane ( Toolkit . i18nText ( "Fine-Design_Module" ) , moduleTreePane ) , BorderLayout . WEST ) ;
moduleTreePane . setPreferredSize ( new Dimension ( 180 , 200 ) ) ;
moduleTreePane . setPreferredSize ( FineUIScale . createScale Dimension( 180 , 200 ) ) ;
moduleTree . setRootVisible ( false ) ;
moduleTree . setRootVisible ( false ) ;
moduleTree . setShowsRootHandles ( true ) ;
moduleTree . setShowsRootHandles ( true ) ;
@ -648,13 +652,14 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
private void initInterfaceNameList ( JPanel interfacePanel ) {
private void initInterfaceNameList ( JPanel interfacePanel ) {
interfaceNameList = new JList ( new DefaultListModel ( ) ) ;
interfaceNameList = new JList ( new DefaultListModel ( ) ) ;
FineUIStyle . setStyle ( interfaceNameList , FineUIStyle . PURE_LIST ) ;
UIScrollPane interfaceNamePanelScrollPane = new UIScrollPane ( interfaceNameList ) ;
UIScrollPane interfaceNamePanelScrollPane = new UIScrollPane ( interfaceNameList ) ;
interfaceNamePanelScrollPane . setPreferredSize ( new Dimension ( 180 , 200 ) ) ;
interfaceNamePanelScrollPane . setPreferredSize ( FineUIScale . createScale Dimension( 180 , 200 ) ) ;
interfacePanel . add (
interfacePanel . add (
this . createNamePane ( Toolkit . i18nText ( "Fine-Design_Interface" ) + ":" , interfaceNamePanelScrollPane ) ,
this . createNamePane ( Toolkit . i18nText ( "Fine-Design_Interface" ) + ":" , interfaceNamePanelScrollPane ) ,
BorderLayout . CENTER ) ;
BorderLayout . CENTER ) ;
interfaceNamePanelScrollPane . setBorder ( new UIRoundedBorder ( UIConstants . LINE_COLOR , 1 , UIConstants . ARC ) ) ;
interfaceNamePanelScrollPane . setBorder ( FineBorderFactory . createWrappedRoundBorder ( ) ) ;
initInterfaceNameModule ( ) ;
initInterfaceNameModule ( ) ;
initInterfaceNameListSelectionListener ( ) ;
initInterfaceNameListSelectionListener ( ) ;
initInterfaceNameListMouseListener ( ) ;
initInterfaceNameListMouseListener ( ) ;
@ -857,8 +862,8 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
popupMenu = new JPopupMenu ( ) ;
popupMenu = new JPopupMenu ( ) ;
JScrollPane tipsScrollPane = new JScrollPane ( tipsList ) ;
JScrollPane tipsScrollPane = new JScrollPane ( tipsList ) ;
popupMenu . add ( tipsScrollPane ) ;
popupMenu . add ( tipsScrollPane ) ;
tipsScrollPane . setPreferredSize ( new Dimension ( 220 , 146 ) ) ;
tipsScrollPane . setPreferredSize ( FineUIScale . createScale Dimension( 220 , 146 ) ) ;
tipsScrollPane . setBorder ( new UIRoundedBorder ( UIConstants . LINE_COLOR , 1 , UIConstants . ARC ) ) ;
tipsScrollPane . setBorder ( FineBorderFactory . createWrappedRoundBorder ( ) ) ;
}
}
private void popTips ( ) {
private void popTips ( ) {