com.smartwerkz.jupload.classic.ui.views.thumbnail
Class IconLayout

java.lang.Object
  extended by com.smartwerkz.jupload.classic.ui.views.thumbnail.IconLayout
All Implemented Interfaces:
java.awt.LayoutManager

public class IconLayout
extends java.lang.Object
implements java.awt.LayoutManager

Layout for sizing components into a getItemLength() * getItemLength() square. The squares are shown in rows and the Container is supposed to be only vertically scrollable.

Author:
Dominik Seifert

Constructor Summary
IconLayout(java.awt.Dimension itemSize, int distance)
          Creates a new Layout for an Image view
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
           
 java.awt.Dimension getItemSize()
           
 void layoutContainer(java.awt.Container cont)
          is always called before the Container is displayed and gives the possibility to re-arrange the components in it
 java.awt.Dimension minimumLayoutSize(java.awt.Container cont)
           
 java.awt.Dimension preferredLayoutSize(java.awt.Container cont)
          equals either the area of the container or if greater, the sufficient area to show all pictures
 void removeLayoutComponent(java.awt.Component comp)
          Is called when a component is removed from the corresponding container of this Layout instance.
 void setItemSize(java.awt.Dimension size)
          Sets the item size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IconLayout

public IconLayout(java.awt.Dimension itemSize,
                  int distance)
Creates a new Layout for an Image view

Parameters:
itemSize - the size of any component of this layout
distance - the void between all elements
Method Detail

setItemSize

public void setItemSize(java.awt.Dimension size)
Sets the item size

Parameters:
size - the new size

getItemSize

public java.awt.Dimension getItemSize()
Returns:
the current item size

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container cont)
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
cont - the container to which this layout has been added
Returns:
a dimension indicating the least size that should always stay visible

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container cont)
equals either the area of the container or if greater, the sufficient area to show all pictures

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
cont - the container to which this layout has been added
Returns:
the dimension which is needed to show everything

layoutContainer

public void layoutContainer(java.awt.Container cont)
is always called before the Container is displayed and gives the possibility to re-arrange the components in it

Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
cont - the container to which this layout has been added

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
name -
comp -
See Also:
LayoutManager.addLayoutComponent(String, java.awt.Component)

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Is called when a component is removed from the corresponding container of this Layout instance.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - a component which is currently being removed from its Container


Copyright © 2007 smartwerkz.com. All Rights Reserved.