Yuan.Wang
4 years ago
16 changed files with 65 additions and 251 deletions
@ -1,49 +0,0 @@
|
||||
package com.fr.design.mainframe.widget.topxcreator; |
||||
|
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.mainframe.CoverReportPane; |
||||
|
||||
import java.awt.*; |
||||
import java.awt.event.MouseEvent; |
||||
|
||||
/** |
||||
* @Author: Yuan.Wang |
||||
* @Date: 2020/8/26 |
||||
*/ |
||||
public class TopXCreator extends BasicTopXCreator { |
||||
|
||||
private final CoverReportPane coverPanel; |
||||
|
||||
public TopXCreator(XCreator creator) { |
||||
super(creator); |
||||
coverPanel = new CoverReportPane(); |
||||
init(); |
||||
} |
||||
|
||||
private void init() { |
||||
coverPanel.setSize(getSize()); |
||||
coverPanel.setVisible(false); |
||||
add(coverPanel); |
||||
} |
||||
|
||||
|
||||
protected void resetSize(Rectangle bounds) { |
||||
coverPanel.setSize(getSize()); |
||||
} |
||||
|
||||
/** |
||||
* 设置是否显示蒙层 |
||||
* */ |
||||
public void displayCoverPane(boolean visible) { |
||||
coverPanel.setVisible(visible); |
||||
} |
||||
|
||||
/** |
||||
* 依据鼠标事件和visible设置是否显示蒙层 |
||||
* */ |
||||
public void displayCoverPane(MouseEvent event, boolean visible) { |
||||
boolean isVisible = visible && getBounds().contains(event.getX(), event.getY()); |
||||
coverPanel.setVisible(isVisible); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue