public class IlvSubgraphCorrectionBarycenterFixed extends Object implements IlvSubgraphCorrectionInterface, IlvPersistentObject
If you use a Recursive Layout (see IlvRecursiveLayout
) on a
nested graph and all subgraphs are laid out completely, and the layout
mode of all layouts is not incremental, then you do not need to
install any subgraph correction at the Recursive Layout. However, in
the following situations, it is useful to install this subgraph
correction strategy:
IlvGraphLayout.isFixed(Object)
).IlvTreeLayout.setIncrementalMode(boolean)
or IlvHierarchicalLayout.setIncrementalMode(boolean)
).
IlvGrapher
are used, the layout of the
subgraph affects the bounding box of the subgraph. The subgraph may
appear at a completely different position after layout, even though no
layout of the parent graph was performed that contains the subgraph as
a node, and even though IlvManager.moveObject(IlvGraphic,
double, double, boolean)
was never called for the subgraph. The
reason for this effect is simply the internal bounding box mechanism
of IlvGrapher
. This effect is very unfortunate in the
situations that were described above. By installing this subgraph
correction strategy, this effect is eliminated because the subgraphs
are moved back to their old barycenter after layout.IlvRecursiveLayout.setSubgraphCorrectionInterface(IlvSubgraphCorrectionInterface)
Constructor and Description |
---|
IlvSubgraphCorrectionBarycenterFixed()
Creates a new
IlvSubgraphCorrectionBarycenterFixed . |
IlvSubgraphCorrectionBarycenterFixed(IlvInputStream stream)
Creates a new
IlvSubgraphCorrectionBarycenterFixed from
an IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
void |
correct(Object subgraph,
IlvGraphLayout layout,
IlvRect boundingBox,
boolean redraw)
Corrects the subgraph position by moving its center to the center of
the input bounding box.
|
void |
write(IlvOutputStream stream)
Writes the object to the output stream.
|
public IlvSubgraphCorrectionBarycenterFixed()
IlvSubgraphCorrectionBarycenterFixed
.public IlvSubgraphCorrectionBarycenterFixed(IlvInputStream stream) throws IlvReadFileException
IlvSubgraphCorrectionBarycenterFixed
from
an IlvInputStream
.
stream
- The input stream.IlvReadFileException
- if an error occurs while
reading.IlvReadFileException
public void correct(Object subgraph, IlvGraphLayout layout, IlvRect boundingBox, boolean redraw)
IlvRecursiveLayout
) immediately after the layout of the
subgraph has finished.
correct
in interface IlvSubgraphCorrectionInterface
subgraph
- The subgraph that has been laid out.layout
- The layout that has been performed on the subgraph.boundingBox
- The former bounding box of the subgraph at the point
in time before the layout.redraw
- The redraw flag passed to the layout.IlvRecursiveLayout.setSubgraphCorrectionInterface(IlvSubgraphCorrectionInterface)
public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
stream
- The output stream.IOException
- thrown when an exception occurs
during the write operation for this object.IOException
- thrown when an exception occurs during
the write operation for this object.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.