@ -33,6 +33,7 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory ;
import javax.swing.BorderFactory ;
import javax.swing.JComponent ;
import javax.swing.JComponent ;
import javax.swing.JPanel ;
import javax.swing.JPanel ;
import javax.swing.SwingUtilities ;
import javax.swing.border.Border ;
import javax.swing.border.Border ;
import java.awt.BorderLayout ;
import java.awt.BorderLayout ;
import java.awt.Color ;
import java.awt.Color ;
@ -776,10 +777,16 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
}
}
int extraX = ( int ) ( ( bounds . x + bounds . width + SelectedPopupDialog . OFFSET_X ) * designer . getScale ( ) ) ;
int extraX = ( int ) ( ( bounds . x + bounds . width + SelectedPopupDialog . OFFSET_X ) * designer . getScale ( ) ) ;
int extraY = ( int ) ( bounds . y * designer . getScale ( ) ) ;
int extraY = ( int ) ( bounds . y * designer . getScale ( ) ) ;
popup . setLocation ( designer . getLocationOnScreen ( ) . x + designer . getPaintX ( ) + extraX , designer . getLocationOnScreen ( ) . y + designer . getPaintY ( ) + extraY ) ;
// 放到事件尾部执行
popup . updatePane ( designer ) ;
SwingUtilities . invokeLater ( new Runnable ( ) {
popup . setVisible ( selected & & accept & & popup . hasVisibleButtons ( ) & & popup . isCanVisible ( ) ) ;
@Override
popup . setRelativeBounds ( bounds ) ;
public void run ( ) {
popup . setLocation ( designer . getLocationOnScreen ( ) . x + designer . getPaintX ( ) + extraX , designer . getLocationOnScreen ( ) . y + designer . getPaintY ( ) + extraY ) ;
popup . updatePane ( designer ) ;
popup . setVisible ( selected & & accept & & popup . hasVisibleButtons ( ) & & popup . isCanVisible ( ) ) ;
popup . setRelativeBounds ( bounds ) ;
}
} ) ;
}
}
/ * *
/ * *