Package charva.awt

Examples of charva.awt.Component


    {
  super.setForeground(color_);

  Enumeration<Component> e = _menuItems.elements();
  while (e.hasMoreElements()) {
      Component c = e.nextElement();
      if (c.getForeground() == null)
        c.setForeground(color_);
  }
    }
View Full Code Here


    {
  super.setBackground(color_);

  Enumeration<Component> e = _menuItems.elements();
  while (e.hasMoreElements()) {
      Component c = e.nextElement();
      if (c.getBackground() == null)
    c.setBackground(color_);
  }
    }
View Full Code Here

     * Overrides the minimumSize() method of Container.
     */
    public Dimension minimumSize() {

        Dimension size = new Dimension();
        Component view = getViewport().getView();
        if (view instanceof Scrollable) {
            Scrollable s = (Scrollable) view;
            size.setSize(s.getPreferredScrollableViewportSize());
        } else {
            size.setSize(view.getSize());
        }

        // Set the size of the viewport(s) as well
        setViewportExtents(size);

View Full Code Here

        _contentPane.setLayout(new BorderLayout());
    }

   
    protected void processPaintEvent(PaintEvent  event) {
        Component source = (Component) event.getSource();
        if (!source.isTotallyObscured()) {
            //if(source instanceof JViewport || source instanceof JTextArea){
//                source.draw();
//                requestSync();
//            }else{
                super.processPaintEvent(event);
View Full Code Here

  TabButton tb = (TabButton) _tabs.elementAt(index_);
  tb.setSelected(true);

  /* Add the newly-selected component to the container.
   */
  Component selected = (Component) _tabComponents.elementAt(index_);
  super.add(selected);
  super.validate();
  //_layoutMgr.doLayout(this);

  _selectedIndex = index_;
View Full Code Here

   */
  int width = 0;
  int height = 0;
  Enumeration<Component> e = _tabComponents.elements();
  while (e.hasMoreElements()) {
      Component c = e.nextElement();
      Dimension size = c.minimumSize();
      if (size.width > width)
    width = size.width;
      if (size.height > height)
    height = size.height;
  }
View Full Code Here

  }

  /* Now draw the selected component.
   */
  if (_selectedIndex != -1) {
      Component component =
    (Component) _tabComponents.elementAt(_selectedIndex);

      /* Note that we draw the component even if isVisible() would be
       * false; it doesn't make sense to make a component invisible
       * in a JTabbedPane.
       */
      component.draw(toolkit);
  }
    }
View Full Code Here

    /** Removes the tab and component which corresponds to the specified
     * index.
     */
    public void remove(int index) {
  //save this just in case
  Component selected = (Component) _tabComponents.elementAt(0);
  _tabComponents.remove(index);
  super.remove((Component) _tabs.elementAt(index));
  _tabs.remove(index);

  if (getSelectedIndex() == index) {
View Full Code Here

        Dimension size = new Dimension(0, 0);

        Component[] components = container_.getComponents();
        for (int i = 0; i < components.length; i++) {
            Component c = components[ i];
            Dimension d = c.minimumSize();
            if (_axis == X_AXIS) {
                size.width += d.width;
                if (d.height > size.height) size.height = d.height;
            } else {
                size.height += d.height;
View Full Code Here

        Component[] components = container_.getComponents();
        int hoffset = container_.getInsets().left;
        int voffset = container_.getInsets().top;
        for (int i = 0; i < components.length; i++) {

            Component c = components[ i];

            /*
             * Get the contained container to lay itself out at its preferred
             * size.
             */
            if (c instanceof Container) {
                Container cont = (Container) c;
                cont.setSize(cont.minimumSize());
                cont.doLayout();
            }

            Dimension componentsize = c.getSize();
            if (_axis == X_AXIS) {
                float alignment = c.getAlignmentY();
                if (alignment == Component.TOP_ALIGNMENT)
                    voffset = container_.getInsets().top;
                else if (alignment == Component.CENTER_ALIGNMENT) {
                    voffset = (containersize.height - componentsize.height) / 2;
                } else if (alignment == Component.BOTTOM_ALIGNMENT) {
                    voffset = containersize.height
                            - container_.getInsets().bottom
                            - componentsize.height;
                }
                c.setLocation(hoffset, voffset);
                hoffset += componentsize.width;
            } else {
                float alignment = c.getAlignmentX();
                if (alignment == Component.LEFT_ALIGNMENT)
                    hoffset = container_.getInsets().left;
                else if (alignment == Component.CENTER_ALIGNMENT) {
                    hoffset = (containersize.width - componentsize.width) / 2;
                } else if (alignment == Component.RIGHT_ALIGNMENT) {
                    hoffset = containersize.width
                            - container_.getInsets().right
                            - componentsize.width;
                }
                c.setLocation(hoffset, voffset);
                voffset += componentsize.height;
            }
        }
    }
View Full Code Here

TOP

Related Classes of charva.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.