Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- addLayoutComponent(String, Component)
- removeLayoutComponent(Component)
- minimumLayoutSize(Container)
- preferredLayoutSize(Container)
- layoutContainer(Container)
- addLayoutComponent(Component, Object)
- maximumLayoutSize(Container)
- getLayoutAlignmentX(Container)
- getLayoutAlignmentY(Container)
- invalidateLayout(Container)
- areWidthsUniform()
- getVerticalGap()
- getExternalPadLeft()
- getExternalPadRight()
- getExternalPadTop()
- getExternalPadBottom()
- getInternalPadX()
- getInternalPadY()
- setUniformWidths(boolean)
- setVerticalGap(int)
- setExternalPadLeft(int)
- setExternalPadRight(int)
- setExternalPadTop(int)
- setExternalPadBottom(int)
- setInternalPadX(int)
- setInternalPadY(int)
Class VerticalFlowLayout
java.lang.Object
cnuphys.splot.edit.VerticalFlowLayout
- All Implemented Interfaces:
LayoutManager
,LayoutManager2
,Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new VerticalFlowLayout.VerticalFlowLayout
(boolean uniformWidths, int vGap) Constructs a new VerticalFlowLayout with your own width sizing type and vertical gap values. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayoutComponent
(Component comp, Object constraints) Adds the specified component to the layout, using the specified constraint object.void
addLayoutComponent
(String name, Component comp) Adds the specified component to the layout.boolean
See if the widths are set to uniform.int
Returns the bottom external vertical padding.int
Returns the left external horizontal padding.int
Returns the right external horizontal padding.int
Returns the top external vertical padding.int
Get the internal horizontal padding.int
Get the internal vertical padding.float
getLayoutAlignmentX
(Container target) Returns the alignment along the x axis.float
getLayoutAlignmentY
(Container target) Returns the alignment along the y axis.int
Get the vertical gap value.void
invalidateLayout
(Container target) Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.void
layoutContainer
(Container parent) Layout the components within the specified containermaximumLayoutSize
(Container target) Returns the maximum size of this component.minimumLayoutSize
(Container parent) Gets the minimum dimensions needed to lay out the component contained in the specified target container.preferredLayoutSize
(Container parent) Gets the preferred dimensions for this layout given the components in the specified target container.void
Remove the specified component.void
setExternalPadBottom
(int padding) Set the bottom external vertical padding.void
setExternalPadLeft
(int padding) Set the left external horizontal padding.void
setExternalPadRight
(int padding) Set the right external horizontal padding.void
setExternalPadTop
(int padding) Set the top external vertical padding.void
setInternalPadX
(int padding) Set the internal horizontal padding.void
setInternalPadY
(int padding) Set the internal vertical padding.void
setUniformWidths
(boolean uniformWidths) Set the uniform width flag.void
setVerticalGap
(int vGap) Set the vertical gap value.
-
Field Details
-
Constructor Details
-
VerticalFlowLayout
public VerticalFlowLayout()Constructs a new VerticalFlowLayout. -
VerticalFlowLayout
public VerticalFlowLayout(boolean uniformWidths, int vGap) Constructs a new VerticalFlowLayout with your own width sizing type and vertical gap values.- Parameters:
uniformWidths
- size the widths of the component to be uniform or notvGap
- vertical gap
-
-
Method Details
-
addLayoutComponent
Adds the specified component to the layout.- Specified by:
addLayoutComponent
in interfaceLayoutManager
- Parameters:
name
- this is ignoredcomp
- the component to be added- Throws:
IllegalArgumentException
- Invalid component or constraint.
-
removeLayoutComponent
Remove the specified component.- Specified by:
removeLayoutComponent
in interfaceLayoutManager
- Parameters:
comp
- the component to be removed- Throws:
IllegalArgumentException
- Invalid component.
-
minimumLayoutSize
Gets the minimum dimensions needed to lay out the component contained in the specified target container.- Specified by:
minimumLayoutSize
in interfaceLayoutManager
- Parameters:
parent
- the Container on which to do the layout- Returns:
- minimum layout size
- See Also:
-
preferredLayoutSize
Gets the preferred dimensions for this layout given the components in the specified target container.- For the horizontal size, this will go through all of the components and get the widest one and add the external and internal horizontal paddings.
- For the vertical size, this will add up the heights of all of the components and add in the internal and external vertical paddings.
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
- Parameters:
parent
- the Container on which to do the layout- Returns:
- preferred preferred layout size
- See Also:
-
layoutContainer
Layout the components within the specified container- Specified by:
layoutContainer
in interfaceLayoutManager
- Parameters:
parent
- the container that is being layed out- See Also:
-
addLayoutComponent
Adds the specified component to the layout, using the specified constraint object.- Specified by:
addLayoutComponent
in interfaceLayoutManager2
- Parameters:
comp
- the component to be addedconstraints
- where/how the component is added to the layout.
-
maximumLayoutSize
Returns the maximum size of this component.- Specified by:
maximumLayoutSize
in interfaceLayoutManager2
- See Also:
-
getLayoutAlignmentX
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.- Specified by:
getLayoutAlignmentX
in interfaceLayoutManager2
-
getLayoutAlignmentY
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.- Specified by:
getLayoutAlignmentY
in interfaceLayoutManager2
-
invalidateLayout
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.- Specified by:
invalidateLayout
in interfaceLayoutManager2
-
areWidthsUniform
public boolean areWidthsUniform()See if the widths are set to uniform.- Returns:
- uniform width flag
-
getVerticalGap
public int getVerticalGap()Get the vertical gap value.- Returns:
- vertical gap
-
getExternalPadLeft
public int getExternalPadLeft()Returns the left external horizontal padding. This is the space between the widest component in the column and the left edge.- Returns:
- Left external horizontal padding.
-
getExternalPadRight
public int getExternalPadRight()Returns the right external horizontal padding. This is the space between the widest component in the column and the left right edge.- Returns:
- Right external horizontal padding.
-
getExternalPadTop
public int getExternalPadTop()Returns the top external vertical padding. This is the space between the top component and the top edge.- Returns:
- Top external vertical padding.
-
getExternalPadBottom
public int getExternalPadBottom()Returns the bottom external vertical padding. This is the space between the bottom component and the bottom edge.- Returns:
- Bottom external vertical padding.
-
getInternalPadX
public int getInternalPadX()Get the internal horizontal padding. This is a simple way to grow the horizontal preferred size of all of the components by a certain amount. It works great on buttons, because their preferred size is usually not wide enough to look good.- Returns:
- internal horizontal padding
-
getInternalPadY
public int getInternalPadY()Get the internal vertical padding. This is a simple way to grow the vertical preferred size of all of the components by a certain amount. It works great on buttons, because their preferred size is usually too short.- Returns:
- internal vertical padding
-
setUniformWidths
public void setUniformWidths(boolean uniformWidths) Set the uniform width flag. If you set this to true, the alignment value is ignored.- Parameters:
uniformWidths
-- true = make all the widths uniform (sizing to match the widest)
- false = let all components take their various preferred widths
-
setVerticalGap
public void setVerticalGap(int vGap) Set the vertical gap value.- Parameters:
vGap
- vertical gap
-
setExternalPadLeft
public void setExternalPadLeft(int padding) Set the left external horizontal padding. This is the space between the widest component in the column and the edge.- Parameters:
padding
- the amount of padding in pixels.
-
setExternalPadRight
public void setExternalPadRight(int padding) Set the right external horizontal padding. This is the space between the widest component in the column and the edge.- Parameters:
padding
- the amount of padding in pixels.
-
setExternalPadTop
public void setExternalPadTop(int padding) Set the top external vertical padding. This is the space between the top and the top edge.- Parameters:
padding
- the amount of padding in pixels.
-
setExternalPadBottom
public void setExternalPadBottom(int padding) Set the bottom external vertical padding. This is the space between the bottom and the bottom edge.- Parameters:
padding
- the amount of padding in pixels.
-
setInternalPadX
public void setInternalPadX(int padding) Set the internal horizontal padding. This is a simple way to grow the horizontal preferred size of all of the components by a certain amount. It works great on buttons, because their preferred size is usually not wide enough to look good.- Parameters:
padding
- internal horizontal padding
-
setInternalPadY
public void setInternalPadY(int padding) Set the internal vertical padding. This is a simple way to grow the vertical preferred size of all of the components by a certain amount. It works great on buttons, because their preferred size is usually too short.- Parameters:
padding
- internal vertical padding
-