public class ManualLayout extends Object implements ImageNodeLayout
Constructor and Description |
---|
ManualLayout() |
Modifier and Type | Method and Description |
---|---|
void |
addDataSet(DataSetLayoutInfoBundle bundle,
Rectangle Position)
Add a dataset to this Layout.
|
void |
datasetChanged(DataSetChangedEvent e)
Inform that there will be a change in the
DataSet s |
void |
datasetsChanged(DataSetsChangedEvent e)
Inform that a Collection of changes coming up in the
DataSet s. |
void |
doLayout()
Produce the layout based on the added DataSets.
|
ColorMap |
getColorsForDataSet(DataSetLink ds)
|
String |
getDataSetLabel(DataSetLink ds)
Get the label for a specific
DataSet used in this layout; |
Vector<DataSetLink> |
getDatasetsInOrder()
Get the DataSets used in this Layout in the order of labeling
|
ManualNodeLayout |
getFinalLayout() |
boolean |
isValid()
Check whether this
AutomaticNodeLayout is valid. |
void |
layoutLegendNode(Collection<NodeData> datacollection,
org.apache.batik.svggen.SVGGraphics2D svg)
Lay out the legend for a specific set of node data
|
void |
layoutNode(Collection<NodeData> datacollection,
org.apache.batik.svggen.SVGGraphics2D svg)
Layout a specific node in a given context.
|
void |
moveBundleToFront(DataSetLayoutInfoBundle bundle)
Move a specific bundle to the front (i.e.
|
boolean |
readLayout(DataSetManager dsm,
ObjectInputStream os,
Object currentobject)
Read a layout object from an
ObjectInputStream given the last object read (which is the first object of the layout) |
void |
removeDataSet(DataSetLayoutInfoBundle bundle)
Remove a dataset represented by the given bundle.
|
void |
setDisplaySize(Rectangle rec)
Set the size of the display.
|
void |
updatePosition(DataSetLayoutInfoBundle bundle,
Rectangle Position)
Update the position of a Dataset in the layoutbundle.
|
void |
updateProperties(DataSetLayoutInfoBundle bundle)
Update the properties of the bundle
|
void |
writeLayout(ObjectOutputStream os)
Write all data that is relevant to restore this nodelayout to a
ObjectOutputStream |
public void updatePosition(DataSetLayoutInfoBundle bundle, Rectangle Position) throws WrongDatasetTypeException
bundle
- the LayoutInfoBundle to usePosition
- The position to updateWrongDatasetTypeException
- If the used dataset is invalid.public void updateProperties(DataSetLayoutInfoBundle bundle) throws WrongDatasetTypeException
bundle
- The bundle to updateWrongDatasetTypeException
- if the Dataset in the bundle is invalid for the bundle.public void addDataSet(DataSetLayoutInfoBundle bundle, Rectangle Position) throws WrongDatasetTypeException
bundle
- The layoutinfo and Dataset to addPosition
- the position to add the layout toWrongDatasetTypeException
- IF the Dataset/Layout don't fit.public void removeDataSet(DataSetLayoutInfoBundle bundle)
bundle
- The bundle containing the layout to removepublic void setDisplaySize(Rectangle rec)
rec
- the position to set the display size to.public void moveBundleToFront(DataSetLayoutInfoBundle bundle)
bundle
- the bundle to move to the front.public ManualNodeLayout getFinalLayout()
public Vector<DataSetLink> getDatasetsInOrder()
ImageNodeLayout
getDatasetsInOrder
in interface ImageNodeLayout
Vector
of DataSet
s in the order they were added during the layout processpublic String getDataSetLabel(DataSetLink ds)
ImageNodeLayout
DataSet
used in this layout;getDataSetLabel
in interface ImageNodeLayout
ds
- the DataSet
to get the label forDataSet
public ColorMap getColorsForDataSet(DataSetLink ds)
ImageNodeLayout
getColorsForDataSet
in interface ImageNodeLayout
ds
- - The requested DatasetColorMap
associated with the DataSet
in this AutomaticNodeLayout
public void layoutNode(Collection<NodeData> datacollection, org.apache.batik.svggen.SVGGraphics2D svg)
ImageNodeLayout
layoutNode
in interface ImageNodeLayout
datacollection
- The data to be used for drawingsvg
- the SVGGraphics2D
to draw inpublic boolean isValid()
ImageNodeLayout
AutomaticNodeLayout
is valid. A Layout is valid, if its ImageNodeContainer
contains
at least one DataSet
.
Thus, by default a newly generated layout is invalid until a DataSet
is added.isValid
in interface ImageNodeLayout
public void writeLayout(ObjectOutputStream os) throws IOException
ImageNodeLayout
ObjectOutputStream
writeLayout
in interface ImageNodeLayout
os
- The ObjectOutputStream
to write the dlayout infromation toIOException
- If errors occur with the given streampublic void doLayout() throws TooManyItemsException, ContainerUnplaceableExcpetion, DimensionMismatchException, WrongDatasetTypeException
ImageNodeLayout
doLayout
in interface ImageNodeLayout
TooManyItemsException
- If there are too many Items to layoutContainerUnplaceableExcpetion
- If a container is not placeableDimensionMismatchException
- If the given dimensions don't fit.WrongDatasetTypeException
- IF the given Dataset does not it to the layoutpublic boolean readLayout(DataSetManager dsm, ObjectInputStream os, Object currentobject) throws IOException
ImageNodeLayout
ObjectInputStream
given the last object read (which is the first object of the layout)readLayout
in interface ImageNodeLayout
dsm
- the DataSetManager
to get information about DataSets from.os
- The ObjectInputStream
to read fromcurrentobject
- The last object read in the ObjectInputStream
provided (the first object of the nodelayout saveIOException
.IOException
- If errors occur with the given streampublic void layoutLegendNode(Collection<NodeData> datacollection, org.apache.batik.svggen.SVGGraphics2D svg)
ImageNodeLayout
layoutLegendNode
in interface ImageNodeLayout
datacollection
- The data to be used for drawingsvg
- the SVGGraphics2D
to draw inpublic void datasetChanged(DataSetChangedEvent e)
DataSetAboutToBeChangedListener
DataSet
sdatasetChanged
in interface DataSetAboutToBeChangedListener
datasetChanged
in interface ImageNodeLayout
e
- the DataSetChangedEvent
to processpublic void datasetsChanged(DataSetsChangedEvent e)
DataSetAboutToBeChangedListener
DataSet
s.datasetsChanged
in interface DataSetAboutToBeChangedListener
datasetsChanged
in interface ImageNodeLayout
e
- the DataSetChangedEvent
to processCopyright © 2018. All rights reserved.