Browse Source
* commit 'ed0aa27a7a663e950e20c4364e082a5912a8e836': REPORT-61306 设计器缩放时,显示通知的弹窗未跟随设计器内部界面,而是固定显示在右侧 REPORT-60887 MAC OS x电脑上 编辑按钮飘移feature/10.0
superman
3 years ago
4 changed files with 70 additions and 2 deletions
@ -0,0 +1,47 @@ |
|||||||
|
package com.fr.design.designer.ui; |
||||||
|
|
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.Iterator; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 把弹窗统一管理起来 防止出现异常情况下游离的弹窗 |
||||||
|
* |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2021/11/02 |
||||||
|
*/ |
||||||
|
public class PopupDialogContext { |
||||||
|
|
||||||
|
private static List<SelectedPopupDialog> dialogs = new ArrayList<>(); |
||||||
|
|
||||||
|
public static void add(SelectedPopupDialog selectedPopupDialog) { |
||||||
|
if (dialogs.contains(selectedPopupDialog)) { |
||||||
|
return; |
||||||
|
} |
||||||
|
dialogs.add(selectedPopupDialog); |
||||||
|
} |
||||||
|
|
||||||
|
public static void remove(SelectedPopupDialog selectedPopupDialog) { |
||||||
|
dialogs.remove(selectedPopupDialog); |
||||||
|
} |
||||||
|
|
||||||
|
public static void checkSelectedPop(XCreator creator) { |
||||||
|
Iterator<SelectedPopupDialog> iterator = dialogs.iterator(); |
||||||
|
List<SelectedPopupDialog> removedDialog = new ArrayList<>(); |
||||||
|
while (iterator.hasNext()) { |
||||||
|
SelectedPopupDialog dialog = iterator.next(); |
||||||
|
if (dialog.isVisible() && creator != dialog.getCreator()) { |
||||||
|
iterator.remove(); |
||||||
|
removedDialog.add(dialog); |
||||||
|
} |
||||||
|
} |
||||||
|
for (SelectedPopupDialog dialog : removedDialog) { |
||||||
|
dialog.setVisible(false); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue