org.jplot2d.layout
Class GridLayoutDirector
- java.lang.Object
-
- org.jplot2d.layout.SimpleLayoutDirector
-
- org.jplot2d.layout.GridLayoutDirector
-
- All Implemented Interfaces:
- LayoutDirector
public class GridLayoutDirector extends SimpleLayoutDirector
Subplots are placed side-bye-side. The plot space are distributed to subplots according to ratio of their preferedContentSize.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jplot2d.layout.SimpleLayoutDirector
SimpleLayoutDirector.AxesInPlot
-
-
Constructor Summary
Constructors Constructor and Description GridLayoutDirector()Create a GridLayoutDirector with 0 horizontal gap and 0 vertical gap.GridLayoutDirector(double hgap, double vgap)Create a GridLayoutDirector with the given horizontal gap and vertical gap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetHGap()java.awt.geom.Dimension2DgetPreferredContentSize(PlotEx plot)Calculate the preferred content size of the given plot.doublegetVGap()voidinvalidateLayout(PlotEx plot)Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.voidlayout(PlotEx plot)Layout the plot.-
Methods inherited from class org.jplot2d.layout.SimpleLayoutDirector
getConstraint, getPreferredSize, remove, setConstraint, toString
-
-
-
-
Constructor Detail
-
GridLayoutDirector
public GridLayoutDirector()
Create a GridLayoutDirector with 0 horizontal gap and 0 vertical gap.
-
GridLayoutDirector
public GridLayoutDirector(double hgap, double vgap)Create a GridLayoutDirector with the given horizontal gap and vertical gap.- Parameters:
hgap- the horizontal gapvgap- the vertical gap
-
-
Method Detail
-
getHGap
public double getHGap()
-
getVGap
public double getVGap()
-
invalidateLayout
public void invalidateLayout(PlotEx plot)
Description copied from interface:LayoutDirectorInvalidates the layout, indicating that if the layout manager has cached information it should be discarded.- Specified by:
invalidateLayoutin interfaceLayoutDirector- Overrides:
invalidateLayoutin classSimpleLayoutDirector- Parameters:
plot- the plot has been invalidate.
-
layout
public void layout(PlotEx plot)
Description copied from interface:LayoutDirectorLayout the plot. Normally the plot contents size is calculated by subtracting margin from plot size. If the plot has contents size constraint, the plot size is calculated by adding margin to plot content size.- Specified by:
layoutin interfaceLayoutDirector- Overrides:
layoutin classSimpleLayoutDirector
-
getPreferredContentSize
public java.awt.geom.Dimension2D getPreferredContentSize(PlotEx plot)
Description copied from class:SimpleLayoutDirectorCalculate the preferred content size of the given plot. The default implementation returns the plot.getPreferredContentSize(), which can be override by subclass to consider nested subplots. The returned size may benullif there is no enough information to derive a value.- Specified by:
getPreferredContentSizein interfaceLayoutDirector- Overrides:
getPreferredContentSizein classSimpleLayoutDirector- Returns:
- the preferred content size
-
-
DMelt 3.0 © DataMelt by jWork.ORG