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.FrameLayoutManager

java.lang.Object
  |
  +--uk.co.ist.mwt.MarginLayoutManager
        |
        +--uk.co.ist.mwt.FrameLayoutManager

public class FrameLayoutManager
extends MarginLayoutManager
A FrameLayoutManager mimics a Motif XmFrame widget; it is not related to the AWT Frame component. Unlike the other Motif emulation widgets in this package, it cannot really be used simply as a layout manager, as the shadows with which it encloses its work area must be drawn every time its container is repainted; this means that any container to which it is attached must call its drawFrameShadow method during repaint; there is a FramedPanel Panel subclass which does this.


Field Summary
static int kShadowEtchedIn
          Constant to specify that the frame should appear to have an etched line surrounding it
static int kShadowEtchedOut
          Constant to specify that the frame should have a raised line surrounding it.
static int kShadowIn
          Constant to specify that the frame should appear sunken into the surrounds
static int kShadowOut
          Constant to specify that the frame should appear as if it is a raised area in the surrounds
static int kTitleBaseline
          Constant to specify that the title Component should be placed so that top shadow line of the frame comes up to the baseline of the text in the title (not implemented)
static int kTitleBottomAlign
          Constant to specify that the title Component should be placed so that top shadow line of the frame comes up to the bottom of the component
static int kTitleCenter
          Constant to specify that the title Component should be in the center of the frame or that it should be placed so that the top shadow line of the frame comes halfway up
static int kTitleLeft
          Constant to specify that the title Component should be on the left of the frame
static int kTitleRight
          Constant to specify that the title Component should be on the right of the frame
static int kTitleTopAlign
          Constant to specify that the title Component should be placed so that top shadow line of the frame comes up to the top of the title component
 
Constructor Summary
FrameLayoutManager()
          Constructor; just set some defaults
 
Method Summary
void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds a component to the layout manager's records.
void drawFrameShadow(java.awt.Container parent)
          Draws the frame shadow in the parent container passed in
void drawFrameShadow(java.awt.Container parent, int frameTopY)
          Draw the shadows which surround the frame's work area, assuming the Y position of the top is /frameTopY/.
int findFrameTopPos(java.awt.Container parent)
          Utility function to find the correct y co-ordinate for the top of a frame
int findFrameTopPos(java.awt.Dimension titleSize)
          Finds out the position at which the top of the frame should go
int getShadowType()
          Accessor for getting the type of shadowing the frame should use
java.awt.Component getTitle()
          Gets the title component for the layout manager
int getTitleHorizAlignment()
          Accessor for getting the title's horizontal alignment
int getTitleHorizSpacing()
          Accessor for getting the title's horizontal spacing
int getTitleVertAlignment()
          Accessor for getting the title's vertical alignment
void layoutContainer(java.awt.Container parent)
          Lays out the container.
java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Method to find the minimum size of the parent container with this layout
java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Method to find the preferred size of the parent container with this layout
void removeLayoutComponent(java.awt.Component comp)
          Removes a component from the layout manager's records.
void setShadowType(int type)
          Accessor for setting the type of shadowing the frame should use
void setTitle(java.awt.Component comp)
          Sets the title component for the layout manager
void setTitleHorizAlignment(int a)
          Accessor for setting the title's horizontal alignment
void setTitleHorizSpacing(int space)
          Accessor for setting the title's horizontal spacing
void setTitleVertAlignment(int a)
          Accessor for setting the title's vertical alignment
 
Methods inherited from class uk.co.ist.mwt.MarginLayoutManager
addLayoutComponent, getMarginHeight, getMarginWidth, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, setMarginHeight, setMarginWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

kShadowIn

public static final int kShadowIn
Constant to specify that the frame should appear sunken into the surrounds

kShadowOut

public static final int kShadowOut
Constant to specify that the frame should appear as if it is a raised area in the surrounds

kShadowEtchedIn

public static final int kShadowEtchedIn
Constant to specify that the frame should appear to have an etched line surrounding it

kShadowEtchedOut

public static final int kShadowEtchedOut
Constant to specify that the frame should have a raised line surrounding it.

kTitleLeft

public static final int kTitleLeft
Constant to specify that the title Component should be on the left of the frame

kTitleRight

public static final int kTitleRight
Constant to specify that the title Component should be on the right of the frame

kTitleCenter

public static final int kTitleCenter
Constant to specify that the title Component should be in the center of the frame or that it should be placed so that the top shadow line of the frame comes halfway up

kTitleBaseline

public static final int kTitleBaseline
Constant to specify that the title Component should be placed so that top shadow line of the frame comes up to the baseline of the text in the title (not implemented)

kTitleTopAlign

public static final int kTitleTopAlign
Constant to specify that the title Component should be placed so that top shadow line of the frame comes up to the top of the title component

kTitleBottomAlign

public static final int kTitleBottomAlign
Constant to specify that the title Component should be placed so that top shadow line of the frame comes up to the bottom of the component
Constructor Detail

FrameLayoutManager

public FrameLayoutManager()
Constructor; just set some defaults
Method Detail

setShadowType

public void setShadowType(int type)
Accessor for setting the type of shadowing the frame should use

getShadowType

public int getShadowType()
Accessor for getting the type of shadowing the frame should use

setTitleHorizAlignment

public void setTitleHorizAlignment(int a)
Accessor for setting the title's horizontal alignment

getTitleHorizAlignment

public int getTitleHorizAlignment()
Accessor for getting the title's horizontal alignment

setTitleVertAlignment

public void setTitleVertAlignment(int a)
Accessor for setting the title's vertical alignment

getTitleVertAlignment

public int getTitleVertAlignment()
Accessor for getting the title's vertical alignment

setTitleHorizSpacing

public void setTitleHorizSpacing(int space)
Accessor for setting the title's horizontal spacing

getTitleHorizSpacing

public int getTitleHorizSpacing()
Accessor for getting the title's horizontal spacing

drawFrameShadow

public void drawFrameShadow(java.awt.Container parent)
Draws the frame shadow in the parent container passed in
Parameters:
parent - the component to draw on

drawFrameShadow

public void drawFrameShadow(java.awt.Container parent,
                            int frameTopY)
Draw the shadows which surround the frame's work area, assuming the Y position of the top is /frameTopY/.
Parameters:
parent - the container to draw on
frameTopY - the y co-ordinate of the top of the frame to be drawn

findFrameTopPos

public int findFrameTopPos(java.awt.Container parent)
Utility function to find the correct y co-ordinate for the top of a frame
Parameters:
parent - the container with the frame layout

findFrameTopPos

public int findFrameTopPos(java.awt.Dimension titleSize)
Finds out the position at which the top of the frame should go

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the container.
Overrides:
layoutContainer in class MarginLayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Method to find the minimum size of the parent container with this layout
Overrides:
minimumLayoutSize in class MarginLayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Method to find the preferred size of the parent container with this layout
Overrides:
preferredLayoutSize in class MarginLayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Removes a component from the layout manager's records.
Parameters:
comp - would be the component to remove.
Overrides:
removeLayoutComponent in class MarginLayoutManager
See Also:
addLayoutComponent

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Adds a component to the layout manager's records.
Parameters:
comp - would be the component to add.
name - would be the name with which to add the component.
Overrides:
addLayoutComponent in class MarginLayoutManager
See Also:
removeLayoutComponent

setTitle

public void setTitle(java.awt.Component comp)
Sets the title component for the layout manager

getTitle

public java.awt.Component getTitle()
Gets the title component for the layout manager

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