|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.fr.design.mainframe.share.ui.block; |
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
import com.fr.base.GraphHelper; |
|
|
|
|
import com.fr.base.iofile.attr.SharableAttrMark; |
|
|
|
|
import com.fr.design.base.mode.DesignModeContext; |
|
|
|
@ -38,8 +39,10 @@ import org.jetbrains.annotations.Nullable;
|
|
|
|
|
|
|
|
|
|
import javax.swing.Action; |
|
|
|
|
import javax.swing.Icon; |
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.JPopupMenu; |
|
|
|
|
import javax.swing.UIManager; |
|
|
|
|
import java.awt.AlphaComposite; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
@ -57,6 +60,7 @@ import java.awt.dnd.DnDConstants;
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
import java.awt.font.FontRenderContext; |
|
|
|
|
import java.awt.font.LineMetrics; |
|
|
|
|
import java.awt.geom.Dimension2D; |
|
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
|
import java.util.UUID; |
|
|
|
@ -224,7 +228,10 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
|
|
|
|
|
} |
|
|
|
|
if (!widget.isCompatibleWithCurrentEnv()) { |
|
|
|
|
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Share_Drag_And_Make_Incompatible_Component_Tip") |
|
|
|
|
Toolkit.i18nText("Fine-Design_Share_Drag_And_Make_Incompatible_Component_Tip"), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Error"), |
|
|
|
|
JOptionPane.ERROR_MESSAGE, |
|
|
|
|
UIManager.getIcon("OptionPane.errorIcon") |
|
|
|
|
); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -293,17 +300,17 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
|
|
|
|
|
double canvasH = coverDim.getHeight(); |
|
|
|
|
|
|
|
|
|
g2d.setColor(new Color(0.0F, 0.0F, 0.0F, 0.4F)); |
|
|
|
|
GraphHelper.fillRect(g2d, canvasX, canvasY, canvasW, canvasH - 16); |
|
|
|
|
GraphHelper.fillRect(g2d, canvasX, canvasY, canvasW, canvasH); |
|
|
|
|
|
|
|
|
|
g2d.setColor(new Color(0.0F, 0.0F, 0.0F, 0.5F)); |
|
|
|
|
GraphHelper.fillRect(g2d, canvasX, canvasH - 16, canvasW, 16); |
|
|
|
|
|
|
|
|
|
String tipText = Toolkit.i18nText("Fine-Design_Share_Incompatible_Version_Tip"); |
|
|
|
|
Font tipFont = FRFont.getInstance().deriveFont(8F); |
|
|
|
|
Font tipFont = FRContext.getDefaultValues().getFRFont().deriveFont(8.0F); |
|
|
|
|
FontRenderContext frc = g2d.getFontRenderContext(); |
|
|
|
|
double tipTextWidth = GraphHelper.stringWidth(tipText, tipFont, frc); |
|
|
|
|
Dimension2D dim = GraphHelper.stringDimensionWithRotation(tipText, tipFont, 0, frc); |
|
|
|
|
double tipTextHeight = dim.getHeight(); |
|
|
|
|
LineMetrics metrics = tipFont.getLineMetrics(tipText, frc); |
|
|
|
|
double tipTextHeight = metrics.getHeight(); |
|
|
|
|
g2d.setColor(Color.WHITE); |
|
|
|
|
g2d.setFont(tipFont); |
|
|
|
|
GraphHelper.drawString(g2d, tipText, canvasX + (canvasW - tipTextWidth) / 2.0F, canvasY + canvasH - (16 - tipTextHeight) / 2.0F); |
|
|
|
|