Package java.awt

Examples of java.awt.LayoutManager


   * @param h the test harness to use
   */
  private void testInvalidLayout(TestHarness h)
  {
    JRootPane rp = new JRootPane();
    LayoutManager l = rp.getLayout();
    JPanel p = new JPanel();
    p.setPreferredSize(new Dimension(100, 100));
    rp.setContentPane(p);
    h.check(l.preferredLayoutSize(rp), new Dimension(100, 100));
    p.setPreferredSize(new Dimension(200, 200));
    h.check(l.preferredLayoutSize(rp), new Dimension(200, 200));
  }
View Full Code Here


  public boolean isMoveable() {
    CompositeAdapter parentAdapter = (CompositeAdapter) getParentAdapter();
    if (parentAdapter != null) {
      Component comp = parentAdapter.getWidget();
      if (comp instanceof Container) {
        LayoutManager layoutMgr = ((Container) comp).getLayout();
        if (layoutMgr == null)
          return true;
      }
      return parentAdapter.isChildMoveable(getWidget());
    } else {
View Full Code Here

    }
    return bean;
  }

  public static LayoutAdapter getLayoutAdapter(Container container) {
    LayoutManager layout = container.getLayout();
    Class<?> layoutClass = layout.getClass();
    while (layoutClass != null) {
      IConfigurationElement config = layoutAdapters.get(layoutClass.getName());
      if (config != null) {
        try {
          LayoutAdapter layoutAdapter = (LayoutAdapter) config.createExecutableExtension("class");
View Full Code Here

  public boolean isDefaultLayout() {
    CompositeAdapter ca = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    return ca.getDefaultLayout()==getLayoutClass();
  }
  public boolean isPropertyChanged() {
    LayoutManager layout = container.getLayout();
    IStructuredSelection iss = new StructuredSelection(layout);
    IWidgetPropertyDescriptor[] layoutProperties = getLayoutProperties();
    for(IWidgetPropertyDescriptor property:layoutProperties){
      if(property.isPropertySet(null, iss))
        return true;
View Full Code Here

public void installUI(JComponent c) {
    super.installUI(c);
    taskPane = (JXTaskPaneContainer)c;
    installDefaults();
   
    LayoutManager manager = taskPane.getLayout();
   
    if (manager == null || manager instanceof UIResource) {
        taskPane.setLayout(createDefaultLayout());
    }
  }
View Full Code Here

        return fontMetrics.stringWidth(object.toString());
    }

    @Override
    protected LayoutManager createLayoutManager() {
        return new LayoutManager() {
            public void addLayoutComponent(String name, Component comp) {
                throw new UnsupportedOperationException("This operation is not supported.");
            }

            public void removeLayoutComponent(Component comp) {
View Full Code Here

            Dimension size = ui.getMinimumSize(this);
            if (size != null) {
                return new Dimension(size);
            }
        }
        LayoutManager layout = getLayout();
        if (layout != null) {
            return layout.minimumLayoutSize(this);
        }

        return new Dimension();
    }
View Full Code Here

            Dimension size = ui.getMaximumSize(this);
            if (size != null) {
                return new Dimension(size);
            }
        }
        LayoutManager layout = getLayout();
        if (layout != null && layout instanceof LayoutManager2) {
            return ((LayoutManager2)layout).maximumLayoutSize(this);
        }
        return new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
    }
View Full Code Here

            setVisible(false);
        }
    }

    public void pack() {
        final LayoutManager layout = getLayout();
        if (layout != null) {
            layout.layoutContainer(this);
        }
    }
View Full Code Here

            Dimension size = ui.getMinimumSize(this);
            if (size != null) {
                return new Dimension(size);
            }
        }
        LayoutManager layout = getLayout();
        if (layout != null) {
            return layout.minimumLayoutSize(this);
        }
        return new Dimension();
    }
View Full Code Here

TOP

Related Classes of java.awt.LayoutManager

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.