hades
4 years ago
17 changed files with 67 additions and 244 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