net.miginfocom.swing
Class SwingContainerWrapper

java.lang.Object
  extended by net.miginfocom.swing.SwingComponentWrapper
      extended by net.miginfocom.swing.SwingContainerWrapper
All Implemented Interfaces:
ComponentWrapper, ContainerWrapper

public final class SwingContainerWrapper
extends SwingComponentWrapper
implements ContainerWrapper


Field Summary
 
Fields inherited from interface net.miginfocom.layout.ComponentWrapper
TYPE_BUTTON, TYPE_CHECK_BOX, TYPE_COMBO_BOX, TYPE_CONTAINER, TYPE_IMAGE, TYPE_LABEL, TYPE_LIST, TYPE_PANEL, TYPE_PROGRESS_BAR, TYPE_SCROLL_BAR, TYPE_SCROLL_PANE, TYPE_SEPARATOR, TYPE_SLIDER, TYPE_SPINNER, TYPE_TABLE, TYPE_TEXT_AREA, TYPE_TEXT_FIELD, TYPE_TREE, TYPE_UNKNOWN, TYPE_UNSET
 
Constructor Summary
SwingContainerWrapper(Container c)
           
 
Method Summary
 int getComponentCount()
          Returns the number of components that this parent has.
 ComponentWrapper[] getComponents()
          Returns the components of the container that wrapper is wrapping.
 int getComponetType(boolean disregardScrollPane)
          Returns the type of component that this wrapper is wrapping.
 Object getLayout()
          Returns the LayoutHandler (in Swing terms) that is handling the layout of this container.
 int getLayoutHashCode()
          Returns a hash code that should be reasonably different for anything that might change the layout.
 boolean isLeftToRight()
          Returns if this container is using left-to-right component ordering.
 void paintDebugCell(int x, int y, int width, int height)
          Paints a cell to indicate where it is.
 
Methods inherited from class net.miginfocom.swing.SwingComponentWrapper
equals, getBaseline, getComponent, getHeight, getHorizontalScreenDPI, getLinkId, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getParent, getPixelUnitFactor, getPreferredHeight, getPreferredWidth, getScreenHeight, getScreenLocationX, getScreenLocationY, getScreenWidth, getVerticalScreenDPI, getVisualPadding, getWidth, getX, getY, hasBaseline, hashCode, isMaxSizeSetOn1_4, isVisible, isVisualPaddingEnabled, paintDebugOutline, setBounds, setMaxSizeSetOn1_4, setVisualPaddingEnabled
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.miginfocom.layout.ComponentWrapper
getBaseline, getComponent, getHeight, getHorizontalScreenDPI, getLinkId, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getParent, getPixelUnitFactor, getPreferredHeight, getPreferredWidth, getScreenHeight, getScreenLocationX, getScreenLocationY, getScreenWidth, getVerticalScreenDPI, getVisualPadding, getWidth, getX, getY, hasBaseline, isVisible, paintDebugOutline, setBounds
 

Constructor Detail

SwingContainerWrapper

public SwingContainerWrapper(Container c)
Method Detail

getComponents

public ComponentWrapper[] getComponents()
Description copied from interface: ContainerWrapper
Returns the components of the container that wrapper is wrapping.

Specified by:
getComponents in interface ContainerWrapper
Returns:
The components of the container that wrapper is wrapping. Never null.

getComponentCount

public int getComponentCount()
Description copied from interface: ContainerWrapper
Returns the number of components that this parent has.

Specified by:
getComponentCount in interface ContainerWrapper
Returns:
The number of components that this parent has.

getLayout

public Object getLayout()
Description copied from interface: ContainerWrapper
Returns the LayoutHandler (in Swing terms) that is handling the layout of this container. If there exist no such class the method should return the same as ComponentWrapper.getComponent(), which is the container itself.

Specified by:
getLayout in interface ContainerWrapper
Returns:
The layout handler instance. Never null.

isLeftToRight

public final boolean isLeftToRight()
Description copied from interface: ContainerWrapper
Returns if this container is using left-to-right component ordering.

Specified by:
isLeftToRight in interface ContainerWrapper
Returns:
If this container is using left-to-right component ordering.

paintDebugCell

public final void paintDebugCell(int x,
                                 int y,
                                 int width,
                                 int height)
Description copied from interface: ContainerWrapper
Paints a cell to indicate where it is.

Specified by:
paintDebugCell in interface ContainerWrapper
Parameters:
x - The x coordinate to start the drwaing.
y - The x coordinate to start the drwaing.
width - The width to draw/fill
height - The height to draw/fill

getComponetType

public int getComponetType(boolean disregardScrollPane)
Description copied from interface: ComponentWrapper
Returns the type of component that this wrapper is wrapping.

This method can be invoked often so the result should be cached.

NOTE! This is misspelled. Keeping it that way though since this is only used by developers who port MigLayout.

Specified by:
getComponetType in interface ComponentWrapper
Overrides:
getComponetType in class SwingComponentWrapper
Parameters:
disregardScrollPane - Is true any wrapping scroll pane should be disregarded and the type of the scrolled component should be returned.
Returns:
The type of component that this wrapper is wrapping. E.g. ComponentWrapper.TYPE_LABEL.

getLayoutHashCode

public int getLayoutHashCode()
Description copied from interface: ComponentWrapper
Returns a hash code that should be reasonably different for anything that might change the layout. This value is used to know if the component layout needs to clear any caches.

Specified by:
getLayoutHashCode in interface ComponentWrapper
Overrides:
getLayoutHashCode in class SwingComponentWrapper
Returns:
A hash code that should be reasonably different for anything that might change the layout. Returns -1 if the widget is disposed.


Copyright © 2007-2011. All Rights Reserved.