|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.co.ist.mwt.MarginLayoutManager | +--uk.co.ist.mwt.FrameLayoutManager
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 |
Fields inherited from class uk.co.ist.mwt.MarginLayoutManager |
marginHeight,
marginWidth |
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 |
protected java.awt.Component |
getWorkArea(java.awt.Container parent)
Utility method to get the workarea; also ensures that the title component actually *is* a child of the given container and removes the title if it is not. |
void |
layoutContainer(java.awt.Container parent)
Lays out the container. |
protected java.awt.Dimension |
layoutSize(java.awt.Container parent,
boolean minimum)
Utility method to find out the size - preferred or minimum - of the parent managed by this layout |
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 |
getMarginHeight,
getMarginWidth,
setMarginHeight,
setMarginWidth,
sizeOfComponent |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int kShadowIn
public static final int kShadowOut
public static final int kShadowEtchedIn
public static final int kShadowEtchedOut
public static final int kTitleLeft
public static final int kTitleRight
public static final int kTitleCenter
public static final int kTitleBaseline
public static final int kTitleTopAlign
public static final int kTitleBottomAlign
Constructor Detail |
public FrameLayoutManager()
Method Detail |
public void setShadowType(int type)
public int getShadowType()
public void setTitleHorizAlignment(int a)
public int getTitleHorizAlignment()
public void setTitleVertAlignment(int a)
public int getTitleVertAlignment()
public void setTitleHorizSpacing(int space)
public int getTitleHorizSpacing()
protected java.awt.Component getWorkArea(java.awt.Container parent)
parent
- the container this layout is mean to lay outpublic void drawFrameShadow(java.awt.Container parent)
parent
- the component to draw onpublic void drawFrameShadow(java.awt.Container parent, int frameTopY)
parent
- the container to draw onframeTopY
- the y co-ordinate of the top of the frame to be
drawnpublic int findFrameTopPos(java.awt.Container parent)
parent
- the container with the frame layoutpublic int findFrameTopPos(java.awt.Dimension titleSize)
public void layoutContainer(java.awt.Container parent)
parent
- the component which needs to be laid outprotected java.awt.Dimension layoutSize(java.awt.Container parent, boolean minimum)
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
parent
- the component to be laid outMarginLayoutManager.preferredLayoutSize(java.awt.Container)
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
parent
- the component to be laid outMarginLayoutManager.minimumLayoutSize(java.awt.Container)
public void removeLayoutComponent(java.awt.Component comp)
comp
- would be the component to remove.addLayoutComponent(java.lang.String, java.awt.Component)
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
comp
- would be the component to add.name
- would be the name with which to add the component.removeLayoutComponent(java.awt.Component)
public void setTitle(java.awt.Component comp)
public java.awt.Component getTitle()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |