private static void useProgressBarHelper(Container parent, JComponent add, JComponent remove) { GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1.7; parent.remove(remove); parent.add(add,c); parent.validate(); parent.repaint(); }
protected void removePanel () { Container parent = this.getParent(); parent.remove(this); parent.validate(); parent.repaint(); }
protected void removePanel () { Container parent = this.getParent(); parent.remove(this); parent.validate(); parent.repaint(); }
@Override public void actionPerformed(ActionEvent e) { float r = funcr.getValue(count); int x = (int) (origin.x + (int) radius * Math.sin(r)); int y= (int) (origin.y + (int) radius * Math.cos(r)); Point p = new Point(x,y); Rectangle r1 = comp.getBounds(); comp.setLocation(p); // r1 stores the union of the bounds before/after the animated step Rectangle r2 = comp.getBounds(); r1.add(r2); comp.getParent().getParent().repaint(r1.x,r1.y,r1.width,r1.height); //repaint(r1); // comp.getParent().invalidate(); // comp.repaint(); if (count == repeatCount) count = 0; else count++; } }
private void moveToStep(final Step newStep) { remove(panelForCurrentStep()); currentStep = newStep; if (currentStep.isAllowCommit()) { commitButton.setText(CheckStyleBundle.message("config.file.okay.text")); commitButton.setToolTipText(CheckStyleBundle.message("config.file.okay.text")); } else { commitButton.setText(CheckStyleBundle.message("config.file.next.text")); commitButton.setToolTipText(CheckStyleBundle.message("config.file.next.text")); } previousButton.setEnabled(currentStep.isAllowPrevious()); commitButton.setEnabled(currentStep.isAllowNext() || currentStep.isAllowCommit()); getContentPane().add(panelForCurrentStep(), BorderLayout.CENTER); getContentPane().validate(); getContentPane().repaint(); }
public void setMouseOver(boolean mouseOver) { if (this.mouseOver != mouseOver) { if (this.mouseOver) { globalMouseExited(); } else { globalMouseEntered(); } Rectangle r = getBounds(); this.getTopLevelAncestor().repaint(r.x, r.y, r.width, r.height); } this.mouseOver = mouseOver; }
@Override public void actionPerformed(ActionEvent e){ if ( count <= repeatCount){ int x = (int) tfuncx.getValue(count); int y = (int) tfuncy.getValue(count); count++; Rectangle r1 = comp.getBounds(); comp.setActualLocation(x,y); Rectangle r2 = comp.getBounds(); r1.add(r2); Container c = comp.getParent(); if (c != null){ c.getParent().getParent().repaint(r1.x,r1.y,r1.width,r1.height); } }else{ timer.stop(); } }
@Override public void componentMoved(ComponentEvent e) { Rectangle r = getBounds(); updateBounds(); r.add(getBounds()); if (getTopLevelAncestor() != null) getTopLevelAncestor().repaint(r.x,r.y,r.width,r.height); }
@Override public void actionPerformed(ActionEvent e) { if (isRunning()) { Rectangle r = sklComponent.getBounds(); //setActualLocation((int) x, (int) y); animate(); r.add(sklComponent.getBounds()); if (sklComponent.getTopLevelAncestor() != null) { sklComponent.getTopLevelAncestor().repaint(r.x, r.y, r.width, r.height); } } else { timer.stop(); if (looping) { start(); } else { animationRunning = false; if (listener != null) { listener.animationCompleted(); } } } } }
parent.repaint();
public void setOpacity(float opacity) { if (opacity > 0) { setVisible(true); } else { setVisible(false); } this.opacity = opacity; for (Visual sklComp : getFollowers()) { sklComp.setOpacity(opacity); } // if (shadowRenderer != null){ // shadowRenderer.createShadowImage(); // } Rectangle r = getBounds(); if (getTopLevelAncestor() != null) //getTopLevelAncestor().repaint(r.x,r.y,r.width,r.height); // for some reason the whole thing needs to be repainted otherwise the // shadow of other compoments looks weird { getTopLevelAncestor().repaint(); } // public void changeOpacityTo(float targetOpacity){ // OpacityAnimator anim = new OpacityAnimator(this, opacity,targetOpacity); // anim.start(); // } }
@Override public void updateComponent() { setForeground(colorFront); Rectangle dirtyBounds = getBounds(); if (from != null && to != null) { source = from.getCenter(); destination = to.getCenter(); } Rectangle r = new Rectangle(getSource()); r.add(getDestination()); r.grow(10, 10); setActualBounds(r); dirtyBounds.add(getBounds()); if (getTopLevelAncestor() != null) { getTopLevelAncestor().repaint(dirtyBounds.x, dirtyBounds.y, dirtyBounds.width, dirtyBounds.height); } if (hasComponents) { updateVisibility(); } }
public void removeServer(JMeterServerPanel jMeterServerPanel) { serversList.remove(jMeterServerPanel); getParent().repaint(); } }
@Override public void mouseDragged(MouseEvent e) { slider.getParent().repaint(); } });
public static void repaintAll(Container root) { root.repaint(); for(int i = 0; i < root.getComponentCount(); i++){ final Component component = root.getComponent(i); if(component instanceof Container){ repaintAll((Container) component); } else{ component.repaint(); } } }
BasicInternalFrameUI ui = (BasicInternalFrameUI)internalFrame.getUI(); Container north = (Container)ui.getNorthPane(); north.remove(0); north.validate(); north.repaint();
open.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AssignToTransientPanel((JPanel) new NewAlbum()); Container content = mainFrame.getContentPane(); content.removeAll(); content.add(transientPanel); content.validate(); content.repaint(); } });
public void add(String stringValue) { JMeterServerPanel panel = new JMeterServerPanel(stringValue, this); serversList.add(panel); add(panel); getParent().repaint(); }
private void updateFrame() { FileFrame frame = getFrame(); // Revalidate, pack and repaint should be called in this order frame.setTitle(this.getTitle()); imageViewerImpl.revalidate(); frame.pack(); frame.getContentPane().repaint(); }