方磊
3 years ago
3 changed files with 66 additions and 4 deletions
@ -0,0 +1,46 @@ |
|||||||
|
package com.fr.design.gui.frpane; |
||||||
|
|
||||||
|
import com.fr.base.BaseUtils; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
|
||||||
|
import javax.swing.Icon; |
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.BorderLayout; |
||||||
|
import java.awt.Point; |
||||||
|
import java.awt.event.MouseAdapter; |
||||||
|
import java.awt.event.MouseEvent; |
||||||
|
|
||||||
|
public abstract class ClosableBubbleFloatPane<T> extends UIBubbleFloatPane<T> { |
||||||
|
public ClosableBubbleFloatPane(int arrowPosition, Point arrowPoint, BasicBeanPane<T> contentPane) { |
||||||
|
super(arrowPosition, arrowPoint, contentPane); |
||||||
|
} |
||||||
|
|
||||||
|
public ClosableBubbleFloatPane(int arrowPosition, Point arrowPoint, BasicBeanPane<T> contentPane, int width, int height) { |
||||||
|
super(arrowPosition, arrowPoint, contentPane, width, height); |
||||||
|
} |
||||||
|
|
||||||
|
protected void initAWTEventListener() { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public boolean forceLockFocus() { |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
protected JPanel initTopOptionMenu() { |
||||||
|
JPanel menu = new JPanel(new BorderLayout()); |
||||||
|
Icon icon = BaseUtils.readIcon("/com/fr/design/images/buttonicon/close_icon.png"); |
||||||
|
UILabel label = new UILabel(icon); |
||||||
|
label.addMouseListener(new MouseAdapter() { |
||||||
|
@Override |
||||||
|
public void mouseClicked(MouseEvent e) { |
||||||
|
showDialog.setVisible(false); |
||||||
|
updateContentPane(); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
menu.add(label, BorderLayout.EAST); |
||||||
|
return menu; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue