public synchronized void removeAll() { if (sprites != null) { sprites.removeAll(); } if (desktop != null) { desktop.getContentPane().clear(); } }
public void pointerPressed(double x, double y) { if (desktop != null) { LComponent[] cs = desktop.getContentPane().getComponents(); for (int i = 0; i < cs.length; i++) { if (cs[i] instanceof LButton) { LButton btn = ((LButton) cs[i]); if (btn != null && btn.isVisible()) { if (btn.intersects((int) x, (int) y)) { btn.doClick(); } } } else if (cs[i] instanceof LPaper) { LPaper paper = ((LPaper) cs[i]); if (paper != null && paper.isVisible()) { if (paper.intersects((int) x, (int) y)) { paper.doClick(); } } } } } click(); }
public void removeAll() { sprites.removeAll(); desktop.getContentPane().clear(); }
/** * 检查窗体默认对象中是否包含指定组件 * * @param comp * @return */ public boolean contains(LComponent comp) { return desktop.getContentPane().contains(comp); }