Browse Source

REPORT-72073 alphafine,使用技巧交互效果修改

release/11.0
hades 2 years ago
parent
commit
7b933ae848
  1. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java
  2. 59
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
  3. 4
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/light_yellow_bulb.svg
  4. 4
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/yellow_bulb.svg

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java

@ -191,7 +191,9 @@ public class AlphaFineConstants {
public static final Icon BULB_ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/bulb.svg");
public static final Icon BLUE_BULB_ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/blue_bulb.svg");
public static final Icon YELLOW_BULB_ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/yellow_bulb.svg");
public static final Icon LIGHT_YELLOW_BULB_ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/light_yellow_bulb.svg");
public static final String HOT_SEARCH = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot_Search");

59
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java

@ -33,6 +33,7 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.PluginSearchManager
import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import java.awt.BorderLayout;
@ -66,8 +67,11 @@ import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.SwingConstants;
import javax.swing.Timer;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
/**
* @author hades
@ -241,13 +245,10 @@ public class AlphaFineFrame extends JFrame {
topRightPane.setBackground(Color.WHITE);
JPanel tipPane = new JPanel(new BorderLayout());
tipPane.setBackground(Color.WHITE);
String toolTip = AlphaFineShortCutUtil.getDisplayShortCut(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Short_Cut", DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getShortcuts()));
tipIconLabel = new UILabel(AlphaFineConstants.BULB_ICON);
tipIconLabel.addMouseListener(tipMouseListener);
tipIconLabel.setToolTipText(toolTip);
useTipLabel = new UILabel(SKILLS);
useTipLabel.addMouseListener(tipMouseListener);
useTipLabel.setToolTipText(toolTip);
useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6);
tipPane.add(tipIconLabel, BorderLayout.WEST);
tipPane.add(useTipLabel, BorderLayout.CENTER);
@ -264,19 +265,63 @@ public class AlphaFineFrame extends JFrame {
private MouseAdapter tipMouseListener = new MouseAdapter() {
private JPopupMenu popupMenu;
@Override
public void mouseEntered(MouseEvent e) {
useTipLabel.setForeground(UIConstants.FLESH_BLUE);
tipIconLabel.setIcon(AlphaFineConstants.BLUE_BULB_ICON);
tipIconLabel.setIcon(AlphaFineConstants.YELLOW_BULB_ICON);
}
@Override
public void mouseExited(MouseEvent e) {
useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6);
tipIconLabel.setIcon(AlphaFineConstants.BULB_ICON);
if (popupMenu == null || !popupMenu.isShowing()) {
useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6);
tipIconLabel.setIcon(AlphaFineConstants.BULB_ICON);
}
}
@Override
public void mousePressed(MouseEvent e) {
useTipLabel.setForeground(UIConstants.FLESH_BLUE);
tipIconLabel.setIcon(AlphaFineConstants.LIGHT_YELLOW_BULB_ICON);
popupMenu = createTipPop();
GUICoreUtils.showPopupMenu(popupMenu, e.getComponent(), e.getComponent().getX() - 60, e.getComponent().getY() + 20);
}
};
private JPopupMenu createTipPop() {
JPanel panel = new JPanel(new BorderLayout());
String toolTip = AlphaFineShortCutUtil.getDisplayShortCut(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Short_Cut", DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getShortcuts()));
UILabel label = new UILabel(toolTip);
label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8);
label.setBackground(Color.WHITE);
panel.add(label);
panel.setBackground(Color.WHITE);
JPopupMenu popupMenu = new JPopupMenu();
popupMenu.setBorder(BorderFactory.createEmptyBorder(20, 5, 10, 5));
popupMenu.add(panel);
popupMenu.setBackground(Color.WHITE);
popupMenu.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
// do nothing
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
useTipLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6);
tipIconLabel.setIcon(AlphaFineConstants.BULB_ICON);
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
// do nothing
}
});
return popupMenu;
}
private JPanel createSearchPane() {
JPanel searchPane = new JPanel(new BorderLayout());
searchPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));

4
designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/light_yellow_bulb.svg

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="5.40283" y="12.9943" width="5.16667" height="1.20556" rx="0.602778" fill="#FBB03B" fill-opacity="0.7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.40234 9.68892V10.506C4.10652 9.66092 3.25 8.19854 3.25 6.53611C3.25 3.92043 5.37043 1.8 7.98611 1.8C10.6018 1.8 12.7222 3.92043 12.7222 6.53611C12.7222 8.1985 11.8657 9.66084 10.57 10.5059V11.2724C10.57 11.748 10.1845 12.1335 9.70888 12.1335H6.26443C5.78885 12.1335 5.40332 11.748 5.40332 11.2724V9.64432C5.40267 9.65911 5.40234 9.67398 5.40234 9.68892ZM7.22753 3.55733C7.34074 3.8092 7.22833 4.10516 6.97646 4.21837C6.22719 4.55514 5.67439 5.25006 5.53469 6.08273C5.489 6.35507 5.23119 6.5388 4.95885 6.49311C4.68652 6.44742 4.50278 6.18961 4.54847 5.91727C4.74465 4.74793 5.51914 3.77702 6.56649 3.30627C6.81836 3.19306 7.11432 3.30546 7.22753 3.55733ZM5.71997 7.5277C5.60631 7.27603 5.31015 7.16416 5.05848 7.27782C4.80682 7.39148 4.69494 7.68763 4.8086 7.9393C4.83113 7.98918 4.85479 8.03844 4.87955 8.08703C5.00491 8.33308 5.30599 8.43092 5.55204 8.30556C5.79809 8.1802 5.89593 7.87911 5.77057 7.63306C5.7529 7.59839 5.73603 7.56326 5.71997 7.5277Z" fill="#FBB03B" fill-opacity="0.7"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

4
designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/yellow_bulb.svg

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="5.40283" y="12.9943" width="5.16667" height="1.20556" rx="0.602778" fill="#FBB03B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.40234 9.68892V10.506C4.10652 9.66092 3.25 8.19854 3.25 6.53611C3.25 3.92043 5.37043 1.8 7.98611 1.8C10.6018 1.8 12.7222 3.92043 12.7222 6.53611C12.7222 8.1985 11.8657 9.66084 10.57 10.5059V11.2724C10.57 11.748 10.1845 12.1335 9.70888 12.1335H6.26443C5.78885 12.1335 5.40332 11.748 5.40332 11.2724V9.64432C5.40267 9.65911 5.40234 9.67398 5.40234 9.68892ZM7.22753 3.55733C7.34074 3.8092 7.22833 4.10516 6.97646 4.21837C6.22719 4.55514 5.67439 5.25006 5.53469 6.08273C5.489 6.35507 5.23119 6.5388 4.95885 6.49311C4.68652 6.44742 4.50278 6.18961 4.54847 5.91727C4.74465 4.74793 5.51914 3.77702 6.56649 3.30627C6.81836 3.19306 7.11432 3.30546 7.22753 3.55733ZM5.71997 7.5277C5.60631 7.27603 5.31015 7.16416 5.05848 7.27782C4.80682 7.39148 4.69494 7.68763 4.8086 7.9393C4.83113 7.98918 4.85479 8.03844 4.87955 8.08703C5.00491 8.33308 5.30599 8.43092 5.55204 8.30556C5.79809 8.1802 5.89593 7.87911 5.77057 7.63306C5.7529 7.59839 5.73603 7.56326 5.71997 7.5277Z" fill="#FBB03B"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Loading…
Cancel
Save