Browse Source

REPORT-38778 修改接口描述。添加了SnapChat的工厂

feature/big-screen
Yuan.Wang 4 years ago
parent
commit
80b9c03c0f
  1. 9
      designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java
  2. 15
      designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java
  3. 13
      designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java
  4. 21
      designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java

9
designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java

@ -1,17 +1,20 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import javax.swing.JWindow;
/** /**
* @Author: Yuan.Wang * @Author: Yuan.Wang
* @Date: 2020/10/9 * @Date: 2020/10/9
* 只关心Window的显示和隐藏操作时可以实现该接口
*/ */
public interface PromptWindow { public interface PromptWindow {
/** /**
* 显示弹窗 * 显示弹窗
* */ */
void showWindow(); void showWindow();
/** /**
* 藏弹窗 * 藏弹窗
* */ */
void hideWindow(); void hideWindow();
} }

15
designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java

@ -5,6 +5,7 @@ import com.fr.design.gui.imenu.UIScrollMenu;
import com.fr.design.notification.AbstractSnapChat; import com.fr.design.notification.AbstractSnapChat;
import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatConfig; import com.fr.design.notification.SnapChatConfig;
import com.fr.design.notification.SnapChatFactory;
import com.fr.design.notification.SnapChatKey; import com.fr.design.notification.SnapChatKey;
import javax.swing.JMenu; import javax.swing.JMenu;
@ -20,21 +21,11 @@ import java.awt.image.BufferedImage;
* created by Harrison on 2020/03/16 * created by Harrison on 2020/03/16
**/ **/
public class SnapChatMenuDef extends MenuDef implements SnapChat { public class SnapChatMenuDef extends MenuDef implements SnapChat {
private SnapChatKey uniqueKey; private SnapChatKey uniqueKey;
private SnapChatMenuUI menuUI = new SnapChatMenuUI(this); private SnapChatMenuUI menuUI = new SnapChatMenuUI(this);
private SnapChat snapChat = new AbstractSnapChat() { private SnapChat snapChat = SnapChatFactory.createSnapChat(true, uniqueKey);
@Override
public SnapChatKey key() {
return uniqueKey;
}
@Override
public boolean defaultStatus() {
return true;
}
};
public SnapChatMenuDef(String name, SnapChatKey uniqueKey) { public SnapChatMenuDef(String name, SnapChatKey uniqueKey) {
super(name); super(name);
this.uniqueKey = uniqueKey; this.uniqueKey = uniqueKey;

13
designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java

@ -5,6 +5,7 @@ import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.notification.AbstractSnapChat; import com.fr.design.notification.AbstractSnapChat;
import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatConfig; import com.fr.design.notification.SnapChatConfig;
import com.fr.design.notification.SnapChatFactory;
import com.fr.design.notification.SnapChatKey; import com.fr.design.notification.SnapChatKey;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -16,17 +17,7 @@ public abstract class SnapChatUpdateAction extends UpdateAction implements SnapC
private SnapChatKey uniqueKey; private SnapChatKey uniqueKey;
private SnapChat snapChat = new AbstractSnapChat() { private SnapChat snapChat = SnapChatFactory.createSnapChat(false, uniqueKey);
@Override
public SnapChatKey key() {
return uniqueKey;
}
@Override
public boolean defaultStatus() {
return false;
}
};
public SnapChatUpdateAction(SnapChatKey uniqueKey) { public SnapChatUpdateAction(SnapChatKey uniqueKey) {
this.uniqueKey = uniqueKey; this.uniqueKey = uniqueKey;

21
designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java

@ -0,0 +1,21 @@
package com.fr.design.notification;
/**
* @Author: Yuan.Wang
* @Date: 2020/10/10
*/
public class SnapChatFactory {
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey) {
return new AbstractSnapChat() {
@Override
public boolean defaultStatus() {
return defaultStatus;
}
@Override
public SnapChatKey key() {
return snapChatKey;
}
};
}
}
Loading…
Cancel
Save