Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class uk.co.ist.mwt.ClipLayout

java.lang.Object
  |
  +--uk.co.ist.mwt.ClipLayout

public class ClipLayout
extends java.lang.Object
implements java.awt.LayoutManager, ScrollConstants
A ClipLayout is used to lay out a Panel contained in a ScrolledPanel; this Panel is used as a clipping window by the ScrolledPanel. It is not really for use outside this package, but has been made public in case someone finds a use for it... NB. only the first child is used; all others are disregarded.


Method Summary
void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds the specified component with the specified name to the layout.
int getChildPlacement()
          Gets the placement of the child for when the size of the child is smaller than the parent container.
java.awt.Scrollbar getHSB()
          Gets the horizontal scroll bar for this clipping layout.
java.awt.Scrollbar getVSB()
          Gets the vertical scroll bar for this clipping layout.
int getXOffset()
          Gets the X offset
int getYOffset()
          Gets the Y offset
boolean hsbNeeded(java.awt.Container clipWindow, java.awt.Dimension pSz)
          Function to see if the horizontal scroll bar will be needed (eg. if the container passed in is wider than the child)
void layoutContainer(java.awt.Container parent)
          Lays out the container .
java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Calculates the minimum dimensions for the specified panel given the components in the specified parent container.
java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Calculates the preferred dimensions for the specified panel given the components in the specified parent container.
void removeLayoutComponent(java.awt.Component comp)
          Removes the specified component from the layout.
void scrollLeft(int delta)
          Tell the clipping region to scroll (pan) left by a certain increment.
void scrollUp(int delta)
          Tell the clipping region to scroll (pan) up by a certain increment.
void setChildPlacement(int newPlacement)
          Sets the placement of the child for when the size of the child is smaller than the parent container.
void setHSB(java.awt.Scrollbar hsb)
          Sets the horizontal scroll bar for this clipping layout.
void setVSB(java.awt.Scrollbar vsb)
          Sets the vertical scroll bar for this clipping layout.
void setXOffset(int newX)
          Sets the X offset; newX must be in the range 0..100, where 0 means that the child's LHS is at the LHS of the clipping window, and 100 means that the child's RHS is at the RHS of the clipping window
void setYOffset(int newY)
          Sets the Y offset; newY must be in the range 0..100, where 0 means that the child's top is at the top of the clipping window, and 100 means that the child's bottom is at the bottom of the clipping window
boolean vsbNeeded(java.awt.Container clipWindow, java.awt.Dimension pSz)
          Function to see if the vertical scroll bar will be needed (eg. if the container passed in is taller than the child)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Method Detail

setChildPlacement

public void setChildPlacement(int newPlacement)
Sets the placement of the child for when the size of the child is smaller than the parent container.

getChildPlacement

public int getChildPlacement()
Gets the placement of the child for when the size of the child is smaller than the parent container.

setXOffset

public void setXOffset(int newX)
Sets the X offset; newX must be in the range 0..100, where 0 means that the child's LHS is at the LHS of the clipping window, and 100 means that the child's RHS is at the RHS of the clipping window
Parameters:
newX - the new value
See Also:
getXOffset, setYOffset, getYOffset, scrollUp, scrollLeft

getXOffset

public int getXOffset()
Gets the X offset
See Also:
setXOffset

setYOffset

public void setYOffset(int newY)
Sets the Y offset; newY must be in the range 0..100, where 0 means that the child's top is at the top of the clipping window, and 100 means that the child's bottom is at the bottom of the clipping window
Parameters:
newY - the new value
See Also:
getYOffset, setXOffset, getXOffset, scrollUp, scrollLeft

getYOffset

public int getYOffset()
Gets the Y offset
See Also:
setYOffset

scrollUp

public void scrollUp(int delta)
Tell the clipping region to scroll (pan) up by a certain increment. The allowable offsets are 0..100, and this is added to the current vertical offset. If the resulting value is out of range, it is cropped to the nearest bound.
Parameters:
delta - the amount by which to pan. Can be negative.
See Also:
setXOffset, setYOffset, scrollLeft

scrollLeft

public void scrollLeft(int delta)
Tell the clipping region to scroll (pan) left by a certain increment. The allowable offsets are 0..100, and this is added to the current horizontal offset. If the resulting value is out of range, it is cropped to the nearest bound.
Parameters:
delta - the amount by which to pan. Can be negative.
See Also:
setXOffset, setYOffset, scrollUp

setHSB

public void setHSB(java.awt.Scrollbar hsb)
Sets the horizontal scroll bar for this clipping layout. This is used to set the page increment to appropriate values, and if left as the default null will cause no problems.
Parameters:
vsb - the new horizontal scroll bar
See Also:
getHSB

getHSB

public java.awt.Scrollbar getHSB()
Gets the horizontal scroll bar for this clipping layout.
See Also:
setHSB

setVSB

public void setVSB(java.awt.Scrollbar vsb)
Sets the vertical scroll bar for this clipping layout. This is used to set the page increment to appropriate values, and if left as the default null will cause no problems.
Parameters:
vsb - the new vertical scroll bar
See Also:
getVSB

getVSB

public java.awt.Scrollbar getVSB()
Gets the vertical scroll bar for this clipping layout.
See Also:
setVSB

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Calculates the preferred dimensions for the specified panel given the components in the specified parent container.
Specified by:
preferredLayoutSize(java.awt.Container) in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
minimumLayoutSize

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Calculates the minimum dimensions for the specified panel given the components in the specified parent container.
Specified by:
minimumLayoutSize(java.awt.Container) in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
preferredLayoutSize

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the container .
Specified by:
layoutContainer(java.awt.Container) in interface java.awt.LayoutManager
Parameters:
parent - the component which needs to be laid out

vsbNeeded

public boolean vsbNeeded(java.awt.Container clipWindow,
                         java.awt.Dimension pSz)
Function to see if the vertical scroll bar will be needed (eg. if the container passed in is taller than the child)
Parameters:
clipWindow - the container whose layout this ClipLayout is
pSz - this clipWindow's size.

hsbNeeded

public boolean hsbNeeded(java.awt.Container clipWindow,
                         java.awt.Dimension pSz)
Function to see if the horizontal scroll bar will be needed (eg. if the container passed in is wider than the child)
Parameters:
clipWindow - the container whose layout this ClipLayout is
pSz - this clipWindow's size.

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Adds the specified component with the specified name to the layout.
Specified by:
addLayoutComponent(java.lang.String, java.awt.Component) in interface java.awt.LayoutManager
Parameters:
name - the component name
comp - the component to be added

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout.
Specified by:
removeLayoutComponent(java.awt.Component) in interface java.awt.LayoutManager
Parameters:
comp - the component to be removed

Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD