Package java.awt

Examples of java.awt.Component


    }

    if (e.getSource() instanceof Component)
    {
      currentSource = e.getSource();
      final Component c = (Component) e.getSource();
      final Dimension d = c.getMaximumSize();
      final Dimension s = c.getSize();
      if (s.width > d.width)
      {
        s.width = d.width;
      }
      if (s.height > d.height)
      {
        s.height = d.height;
      }
      c.setSize(s);
      currentSource = null;
    }

  }
View Full Code Here


    synchronized (parent.getTreeLock())
    {
      final Insets insets = parent.getInsets();
      if (parent.getComponentCount() > 0)
      {
        final Component component = parent.getComponent(0);
        final Dimension d = component.getPreferredSize();
        return new Dimension(
            (int) d.getWidth() + insets.left + insets.right,
            (int) d.getHeight() + insets.top + insets.bottom
        );
      }
View Full Code Here

    synchronized (parent.getTreeLock())
    {
      final Insets insets = parent.getInsets();
      if (parent.getComponentCount() > 0)
      {
        final Component component = parent.getComponent(0);
        final Dimension d = component.getMinimumSize();
        return new Dimension(d.width + insets.left + insets.right,
            d.height + insets.top + insets.bottom);
      }
      else
      {
View Full Code Here

    {
      if (parent.getComponentCount() > 0)
      {
        final Insets insets = parent.getInsets();
        final Dimension parentSize = parent.getSize();
        final Component component = parent.getComponent(0);
        final Dimension componentSize = component.getPreferredSize();
        final int xx = insets.left + (
            Math.max((parentSize.width - insets.left - insets.right
                - componentSize.width) / 2, 0)
        );
        final int yy = insets.top + (
            Math.max((parentSize.height - insets.top - insets.bottom
                - componentSize.height) / 2, 0));
        component.setBounds(xx, yy, componentSize.width,
            componentSize.height);
      }
    }

  }
View Full Code Here

    public void setFont(Font font) {
        Font fontNormal = DcSettings.getFont(DcRepository.Settings.stSystemFontNormal);
        Font fontSystem = DcSettings.getFont(DcRepository.Settings.stSystemFontNormal);       
       
        super.setFont(fontNormal);
        Component component;
        Component subComponent;
        for (int i = 0; i < getComponents().length; i++) {
            component = getComponents()[i];
            if (component instanceof JPanel) {
               
                for (int j = 0; j < ((JPanel) component).getComponents().length; j++) {
                    subComponent = ((JPanel) component).getComponents()[j];
                    if (subComponent instanceof JLabel)
                        subComponent.setFont(fontSystem);
                    else
                        subComponent.setFont(fontNormal);
                }
            }
        }
    }    
View Full Code Here

                ListCellRenderer renderer = list.getCellRenderer();
       
                if (renderer != null) {
                    for(int index = 0; index < dataModelSize; index++) {
                        Object value = dataModel.getElementAt(index);
                        Component c = renderer.getListCellRendererComponent(list, value, index, false, false);
                        rendererPane.add(c);
                        Dimension cellSize = c.getPreferredSize();
                        int column = index%columnsPerRow;
                        int row    = index/columnsPerRow;
                        if (fixedCellWidth == -1)
                            cellWidths[column] = Math.max(cellWidths[column], cellSize.width);
                       
View Full Code Here

       
                if (renderer != null) {
                    Dimension[] cellDims = new Dimension[nItems];
                    for(int index = 0; index < nItems; index++) {
                        Object value = dataModel.getElementAt(index);
                        Component c = renderer.getListCellRendererComponent(list, value, index, false, false);
                        rendererPane.add(c);
                        cellDims[index] = c.getPreferredSize();
                    }
   
                    //Reduce until all widhts on all rows fit
                    maxColumns = cellDims.length > 0 ? getMaxItemsBasedOnFirstRow(cellDims, width) : 0;
                    int index = maxColumns;
View Full Code Here

        //**********************************************************
        //Main panel
        //**********************************************************
        setLayout(Layout.getGBL());
       
        Component c = vdQuickPane != null ? vdQuickPane : panelResult;
        add(    c, Layout.getGBC( 0, 1, 3, 1, 100.0, 100.0
               ,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
                new Insets(5, 5, 5, 5), 0, 0));
       
        if (actionPanel != null)
View Full Code Here

              DcObject dco = vc.getSelectedItem();
             
              // item gotten via "getSelectedItem" is not loaded fully (!)
              dco.reload();
                ViewPopupMenu menu = new ViewPopupMenu(dco, view.getType(), view.getIndex());
                Component component = (Component) vc;
                menu.setInvoker(component);
                menu.show(component, e.getX(), e.getY());
            }
        }
View Full Code Here

  private void refreshReportController(final ReportController newReportController)
  {
    for (int i = 0; i < outerReportControllerHolder.getComponentCount(); i++)
    {
      final Component maybeSplitPane = outerReportControllerHolder.getComponent(i);
      if (maybeSplitPane instanceof JSplitPane)
      {
        final JSplitPane splitPane = (JSplitPane) maybeSplitPane;
        reportControllerSliderSize = splitPane.getDividerLocation();
        break;
View Full Code Here

TOP

Related Classes of java.awt.Component

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.