public class IlvSubgraphCorrectionBoundsFixed extends IlvSubgraphCorrectionBarycenterFixed
IlvGrapherAdapter
and the subgraph is an instance
of IlvGraphic
. Otherwise it behaves like IlvSubgraphCorrectionBarycenterFixed
.
While the strategy IlvSubgraphCorrectionBarycenterFixed
only
affects the position of the subgraph, this strategy potentially
affects the zoom level of the subgraph as well.
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)
).
If subgraphs of type 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 bounds after layout.
IlvRecursiveLayout.setSubgraphCorrectionInterface(IlvSubgraphCorrectionInterface)
Constructor and Description |
---|
IlvSubgraphCorrectionBoundsFixed()
Creates a new
IlvSubgraphCorrectionBoundsFixed . |
IlvSubgraphCorrectionBoundsFixed(IlvInputStream stream)
Creates a new
IlvSubgraphCorrectionBoundsFixed from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
void |
correct(Object subgraph,
IlvGraphLayout layout,
IlvRect boundingBox,
boolean redraw)
Corrects the subgraph bounds by trying to reshape the subgraph to the
input bounding box.
|
void |
write(IlvOutputStream stream)
Writes the object to the output stream.
|
public IlvSubgraphCorrectionBoundsFixed()
IlvSubgraphCorrectionBoundsFixed
.public IlvSubgraphCorrectionBoundsFixed(IlvInputStream stream) throws IlvReadFileException
IlvSubgraphCorrectionBoundsFixed
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)
IlvGrapher
that permit or forbid movements or zoom level changes.
This is called by the Recursive Layout (see IlvRecursiveLayout
) immediately after the layout of the subgraph has
finished.
correct
in interface IlvSubgraphCorrectionInterface
correct
in class IlvSubgraphCorrectionBarycenterFixed
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
write
in class IlvSubgraphCorrectionBarycenterFixed
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.