public Component getComponentAt(int x, int y) { getLayout().layoutContainer(this); Component result = super.getComponentAt(x,y); System.err.println("getComponentAt " + x + "," + y + " returning " + result.getName()); return result; }
public Component getComponentAt(int x, int y) { getLayout().layoutContainer(this); Component result = super.getComponentAt(x,y); System.err.println("getComponentAt " + x + "," + y + " returning " + result.getName()); return result; }
public Component getComponentAt(int x, int y) { getLayout().layoutContainer(this); Component result = super.getComponentAt(x, y); System.err.println("getComponentAt " + x + "," + y + " returning " + result.getName()); return result; }
public void handleInitialInputEvent(InputEvent e) { System.err.println("HandleInitialInputEvent"); getLayout().layoutContainer(this); if (e instanceof MouseEvent) { Point p = SwingUtilities.convertPoint((JComponent) e.getSource(), ((MouseEvent) e).getPoint(), this); Component c = getComponentAt(p); if (c instanceof JRadioButton) { ((JRadioButton) c).setSelected(true); c.requestFocus(); fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, InplaceEditor.COMMAND_SUCCESS)); } } else { Component[] c = getComponents(); for (int i = 0; i < c.length; i++) { if (c[i] instanceof JRadioButton) { if (((JRadioButton) c[i]).isSelected()) { c[i].requestFocusInWindow(); } } } } }
public void handleInitialInputEvent(InputEvent e) { System.err.println("HandleInitialInputEvent"); getLayout().layoutContainer(this); if (e instanceof MouseEvent) { Point p = SwingUtilities.convertPoint( (JComponent)e.getSource(), ((MouseEvent) e).getPoint(), this); Component c = getComponentAt(p); if (c instanceof JRadioButton) { ((JRadioButton) c).setSelected(true); c.requestFocus(); fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, InplaceEditor.COMMAND_SUCCESS)); } } else { Component[] c = getComponents(); for (int i=0; i < c.length; i++) { if (c[i] instanceof JRadioButton) { if (((JRadioButton) c[i]).isSelected()) { c[i].requestFocusInWindow(); } } } } }
public void handleInitialInputEvent(InputEvent e) { System.err.println("HandleInitialInputEvent"); getLayout().layoutContainer(this); if (e instanceof MouseEvent) { Point p = SwingUtilities.convertPoint( (JComponent)e.getSource(), ((MouseEvent) e).getPoint(), this); Component c = getComponentAt(p); if (c instanceof JRadioButton) { ((JRadioButton) c).setSelected(true); c.requestFocus(); fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, InplaceEditor.COMMAND_SUCCESS)); } } else { Component[] c = getComponents(); for (int i=0; i < c.length; i++) { if (c[i] instanceof JRadioButton) { if (((JRadioButton) c[i]).isSelected()) { c[i].requestFocusInWindow(); } } } } }
public void paint (Graphics g) { if (isShowing()) { super.paint(g); } else { getLayout().layoutContainer(this); Component[] c = getComponents(); Color col = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0,0, getWidth(),getHeight()); for (int i=0; i < c.length; i++) { Rectangle r = c[i].getBounds(); if (g.hitClip(r.x, r.y,r.width,r.height)) { Graphics g2 = g.create(r.x, r.y, r.width, r.height); try { c[i].paint(g2); } finally { g2.dispose(); } } } if (getBorder() != null) { super.paintBorder(g); } } finally { g.setColor(col); } } }
public void paint(Graphics g) { if (isShowing()) { super.paint(g); } else { getLayout().layoutContainer(this); Component[] c = getComponents(); Color col = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0, 0, getWidth(), getHeight()); for (int i = 0; i < c.length; i++) { Rectangle r = c[i].getBounds(); if (g.hitClip(r.x, r.y, r.width, r.height)) { Graphics g2 = g.create(r.x, r.y, r.width, r.height); try { c[i].paint(g2); } finally { g2.dispose(); } } } if (getBorder() != null) { super.paintBorder(g); } } finally { g.setColor(col); } } }
public void paint (Graphics g) { if (isShowing()) { super.paint(g); } else { getLayout().layoutContainer(this); Component[] c = getComponents(); Color col = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0,0, getWidth(),getHeight()); for (int i=0; i < c.length; i++) { Rectangle r = c[i].getBounds(); if (g.hitClip(r.x, r.y,r.width,r.height)) { Graphics g2 = g.create(r.x, r.y, r.width, r.height); try { c[i].paint(g2); } finally { g2.dispose(); } } } if (getBorder() != null) { super.paintBorder(g); } } finally { g.setColor(col); } } }