@ -85,6 +85,8 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE;
* 创建组件事件
* 创建组件事件
* /
* /
public class CreateComponentAction extends UpdateAction {
public class CreateComponentAction extends UpdateAction {
private static final double MAX_WIDTH = 960 . 0 ;
private static final double MAX_HEIGHT = 540 . 0 ;
ShareUIAspect aspect ;
ShareUIAspect aspect ;
/ * *
/ * *
* 等待时间 500 ms .
* 等待时间 500 ms .
@ -123,6 +125,11 @@ public class CreateComponentAction extends UpdateAction {
return ;
return ;
}
}
if ( isBeyondMaxSize ( sharedTriple . getRight ( ) ) ) {
showErrMsgDialog ( Toolkit . i18nText ( "Fine-Design_Share_Widget_Size_Error_Tip" ) ) ;
return ;
}
Widget widget = sharedTriple . getLeft ( ) ;
Widget widget = sharedTriple . getLeft ( ) ;
try {
try {
@ -410,4 +417,20 @@ public class CreateComponentAction extends UpdateAction {
}
}
return paras ;
return paras ;
}
}
private boolean isBeyondMaxSize ( Rectangle rec ) {
double width = rec . getWidth ( ) ;
double height = rec . getHeight ( ) ;
return width > 0 & & height > 0 & & ( width > MAX_WIDTH | | height > MAX_HEIGHT ) ;
}
private void showErrMsgDialog ( String err ) {
FineJOptionPane . showMessageDialog (
DesignerContext . getDesignerFrame ( ) ,
err ,
Toolkit . i18nText ( "Fine-Design_Basic_Tool_Tips" ) ,
ERROR_MESSAGE ,
IOUtils . readIcon ( "/com/fr/base/images/share/Information_Icon_warning_normal_32x32.png" )
) ;
}
}
}