Class ContainerLayout
- java.lang.Object
-
- idare.imagenode.Interfaces.Layout.ContainerLayout
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractArrayContainerLayout
,MultiArrayContainerLayout
public abstract class ContainerLayout extends Object implements Serializable
Classes implementing this interface need to be able to generate a layout when provided with an area to generate the layout- Author:
- Thomas Pfau
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Rectangle
layoutarea
-
Constructor Summary
Constructors Constructor Description ContainerLayout()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
createLayout(NodeData data, Rectangle area, String DataSetLabel, DataSetLayoutProperties props)
Create the Layout for a given set of data, in a specified area using a specified Label for the underlying Dataset.static Double[]
determineDisplayRange(Double[] valuerange)
This function allows to get a Range of minimal and maximal values based on a valuerange to determine suitable axes.Rectangle
getLayoutArea()
Get the area assigned to this layout container (in theIMAGENODEPROPERTIES
.IMAGEWIDTH //IMAGENODEPROPERTIES
.IMAGEHEIGHT) range.abstract void
LayoutDataForNode(NodeData data, org.apache.batik.svggen.SVGGraphics2D context, boolean Legend, ColorMap coloring)
Layout the Data according to the previously generated layoutstatic Double[]
roundToCommonOrder(Double lowvalue, Double highvalue)
Round the number to the numbers Order.static Double
roundToOrder(Double value, boolean up)
Round the number to the numbers Order.protected abstract void
setupLayout(NodeData data, Rectangle area, String DataSetLabel, DataSetLayoutProperties props)
Setup the layout specific positions and data.abstract void
updateLabel(String DatasetLabel)
Update the Label used in this Layout.
-
-
-
Field Detail
-
layoutarea
protected Rectangle layoutarea
-
-
Method Detail
-
createLayout
public final void createLayout(NodeData data, Rectangle area, String DataSetLabel, DataSetLayoutProperties props) throws WrongDatasetTypeException
Create the Layout for a given set of data, in a specified area using a specified Label for the underlying Dataset.- Parameters:
data
- The nodeData to use to set up the layout.area
- the area in which to create the layoutDataSetLabel
- the label of the corresponding Dataset to display somewhere in the area.props
- the properties to use (commonly those from which theContainerLayout
was created)- Throws:
WrongDatasetTypeException
- If an incompatible data set type was used
-
setupLayout
protected abstract void setupLayout(NodeData data, Rectangle area, String DataSetLabel, DataSetLayoutProperties props) throws WrongDatasetTypeException
Setup the layout specific positions and data.- Parameters:
data
- The nodeData to use to set up the layout.area
- the area in which to create the layoutDataSetLabel
- the label of the corresponding Dataset to display somewhere in the area.props
- the properties to use (commonly those from which theContainerLayout
was created)- Throws:
WrongDatasetTypeException
- If an incompatible data set type was used
-
LayoutDataForNode
public abstract void LayoutDataForNode(NodeData data, org.apache.batik.svggen.SVGGraphics2D context, boolean Legend, ColorMap coloring)
Layout the Data according to the previously generated layout- Parameters:
data
- the data to layoutcontext
- the graphics context in which to draw the layoutLegend
- whether this is a layout for the legend or not.coloring
- The ColorMap to use for the layout
-
updateLabel
public abstract void updateLabel(String DatasetLabel)
Update the Label used in this Layout.- Parameters:
DatasetLabel
- The new label to be used for theDataSet
-
determineDisplayRange
public static final Double[] determineDisplayRange(Double[] valuerange)
This function allows to get a Range of minimal and maximal values based on a valuerange to determine suitable axes.- Parameters:
valuerange
- the range of values (length 2, min and max value)- Returns:
- Values which are suitable to plot the data range in.
-
roundToCommonOrder
public static final Double[] roundToCommonOrder(Double lowvalue, Double highvalue)
Round the number to the numbers Order. Either rounding up or down. e.g. 5 rounded up is 10; 101 rounded up is 200 etc.- Parameters:
lowvalue
- the lower value to create a common Orderhighvalue
- the upper value to create a common Order.- Returns:
- the rounded values.
-
roundToOrder
public static final Double roundToOrder(Double value, boolean up)
Round the number to the numbers Order. Either rounding up or down. e.g. 5 rounded up is 10; 101 rounded up is 200 etc.- Parameters:
value
- the value to roundup
- whether to round up or down.- Returns:
- the rounded values.
-
getLayoutArea
public Rectangle getLayoutArea()
Get the area assigned to this layout container (in theIMAGENODEPROPERTIES
.IMAGEWIDTH //IMAGENODEPROPERTIES
.IMAGEHEIGHT) range.- Returns:
- a rectangle which should have x,y,width,height < 0 x + width < IMAGEWIDTH, and y+height < IMAGEHEIGHT
-
-