public static void updateComponentTreeUI(final Component component) {
    updateComponentTreeUILevel(component);

    component.invalidate();
    component.validate();
    component.repaint();
  }
Esempio n. 2
0
    /** Resets the <code>Popup</code> to an initial state. */
    void reset(Component owner, Component contents, int ownerX, int ownerY) {
      super.reset(owner, contents, ownerX, ownerY);

      Component component = getComponent();

      component.setLocation(ownerX, ownerY);
      rootPane.getContentPane().add(contents, BorderLayout.CENTER);
      contents.invalidate();
      component.validate();
      pack();
    }
Esempio n. 3
0
    /** Resets the <code>Popup</code> to an initial state. */
    void reset(Component owner, Component contents, int ownerX, int ownerY) {
      super.reset(owner, contents, ownerX, ownerY);

      JComponent component = (JComponent) getComponent();

      component.setOpaque(contents.isOpaque());
      component.setLocation(ownerX, ownerY);
      component.add(contents, BorderLayout.CENTER);
      contents.invalidate();
      pack();
    }
Esempio n. 4
0
 public static void resizeColumnToFit(
     PRManFrame frame, TableView view, TableColumn tc, JTable table) {
   int cIdx = table.getColumnModel().getColumnIndex(tc.getIdentifier());
   int width = tc.getWidth();
   for (int iCnt = 0; iCnt < table.getRowCount(); iCnt++) {
     if (view == null
         || !frame.isDescriptionResourceRow(view.tableModel.getModelRowForIndex(iCnt))) {
       Component comp =
           table
               .getCellRenderer(iCnt, cIdx)
               .getTableCellRendererComponent(
                   table, table.getValueAt(iCnt, cIdx), true, false, iCnt, cIdx);
       comp.invalidate();
       comp.validate();
       int cpw = comp.getPreferredSize().width;
       width = Math.max(width, cpw);
     }
   }
   tc.setPreferredWidth(width);
 }
Esempio n. 5
0
  /*
   *  Restores this frame's bounds and visibility
   *  from its class preferences.
   *
   *  @see	#restoreAllFromPrefs()
   */
  private void restoreFromPrefs() {
    String sizeVal = classPrefs.get(KEY_SIZE, null);
    String locVal = classPrefs.get(KEY_LOCATION, null);
    String visiVal = classPrefs.get(KEY_VISIBLE, null);
    Rectangle r = c.getBounds();
    //		Insets		i		= getInsets();

    // System.err.println( "this "+getClass().getName()+ " visi = "+visiVal );

    Dimension dim = stringToDimension(sizeVal);
    if ((dim == null) || alwaysPackSize()) {
      pack();
      dim = c.getSize();
    }

    r.setSize(dim);
    Point p = stringToPoint(locVal);
    if (p != null) {
      r.setLocation(p);
      c.setBounds(r);
    } else {
      c.setSize(dim);
      final Point2D prefLoc = getPreferredLocation();
      wh.place(this, (float) prefLoc.getX(), (float) prefLoc.getY());
      //			if( shouldBeCentered() ) setLocationRelativeTo( null );
    }
    c.invalidate();
    //		if( alwaysPackSize() ) {
    //			pack();
    //		} else {
    c.validate();
    //		}
    //		lim.queue( this );
    if ((visiVal != null) && restoreVisibility()) {
      setVisible(new Boolean(visiVal).booleanValue());
    }
  }
Esempio n. 6
0
 /** Calculates the dimensions. If they've changed, invalidates the component */
 void recalcDimensions() {
   int wOld = getIconWidth();
   int hOld = getIconHeight();
   calcDimensions();
   if (wOld != getIconWidth() || hOld != getIconHeight()) fComponent.invalidate();
 }
 /**
  * Invalidates the layout of this window.
  *
  * @see Component#invalidate()
  */
 public void invalidate() {
   window.invalidate();
 }