|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--y.io.ViewPortConfigurator
Convenience class that helps configuring the viewport as it is used
by ImageOutputHandler and other classes.
| Field Summary | |
static byte |
CLIP_GRAPH
Clip type specifier constant. |
static byte |
CLIP_VIEW
Clip type specifier constant. |
static byte |
SIZE_USE_CUSTOM_HEIGHT
Size policy specifier. |
static byte |
SIZE_USE_CUSTOM_WIDTH
Size policy specifier. |
static byte |
SIZE_USE_ORIGINAL
Size policy specifier. |
| Constructor Summary | |
ViewPortConfigurator()
Creates a new instance of ViewPortConfigurator |
|
| Method Summary | |
void |
configure(Graph2DView viewPort)
Setup the viewport of the given view according to the current configuration. |
byte |
getClipType()
Returns the clip type used to cofigure the viewport. |
int |
getCustomHeight()
Returns the custom height of the viewport. |
int |
getCustomWidth()
Returns the custom width of the viewport. |
Graph2D |
getGraph2D()
Returns the reference graph used to configure the viewport. |
Graph2DView |
getGraph2DView()
Returns the reference view used to configure the viewport. |
int |
getMargin()
|
double |
getScalingFactor()
Returns the scaling factor that will be applied to the size of the viewport. |
byte |
getSizeType()
Returns the size type used to cofigure the viewport. |
void |
setClipType(byte clipType)
Sets the clip type used to cofigure the viewport. |
void |
setCustomHeight(int customHeight)
Sets the height of the viewport. |
void |
setCustomWidth(int customWidth)
Sets the width of the viewport. |
void |
setGraph2D(Graph2D graph)
Sets the reference graph used to configure the viewport when clip type ViewPortConfigurator.CLIP_GRAPH is active. |
void |
setGraph2DView(Graph2DView view)
Sets the reference view used to configure the viewport when clip type ViewPortConfigurator.CLIP_VIEW is active. |
void |
setMargin(int margin)
When clip type ViewPortConfigurator.CLIP_GRAPH is being used, then an additionaly margin of the given size
will be added to the size of the viewport.
|
void |
setScalingFactor(double scale)
Sets the scaling factor that will be applied to the size of the viewport. |
void |
setSizeType(byte sizeType)
Sets the size type used to cofigure the viewport. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static byte CLIP_GRAPH
ViewPortConfigurator.setClipType(byte)public static byte CLIP_VIEW
ViewPortConfigurator.setClipType(byte)public static byte SIZE_USE_ORIGINAL
ViewPortConfigurator.CLIP_GRAPH, then
the viewport will have the size of the diagram as it is given in world coordinates.
If the clip type is ViewPortConfigurator.CLIP_VIEW, then
the viewport will have the size of the reference view.
public static byte SIZE_USE_CUSTOM_WIDTH
ViewPortConfigurator.setCustomWidth(int) as the width
of the viewport. The height will be scaled accordingly to avoid distortions.
Invoking this method effectivly invalidates the value set by method ViewPortConfigurator.setCustomHeight(int).
public static byte SIZE_USE_CUSTOM_HEIGHT
ViewPortConfigurator.setCustomHeight(int) as the height
of the viewport. The width will be scaled accordingly to avoid distortions.
Invoking this method effectivly invalidates the value set by method ViewPortConfigurator.setCustomWidth(int).
| Constructor Detail |
public ViewPortConfigurator()
| Method Detail |
public void configure(Graph2DView viewPort)
public void setScalingFactor(double scale)
1.0.
public double getScalingFactor()
ViewPortConfigurator.setScalingFactor(double)public void setMargin(int margin)
ViewPortConfigurator.CLIP_GRAPH is being used, then an additionaly margin of the given size
will be added to the size of the viewport.
By default a margin of size 15 is being used.
public int getMargin()
ViewPortConfigurator.setMargin(int).public void setClipType(byte clipType)
clipType - one of ViewPortConfigurator.CLIP_VIEW or ViewPortConfigurator.CLIP_GRAPH.
By default ViewPortConfigurator.CLIP_GRAPH is set.public byte getClipType()
public void setSizeType(byte sizeType)
sizeType - one of ViewPortConfigurator.SIZE_USE_ORIGINAL, ViewPortConfigurator.SIZE_USE_CUSTOM_WIDTH or ViewPortConfigurator.SIZE_USE_CUSTOM_HEIGHT.
By default ViewPortConfigurator.SIZE_USE_ORIGINAL is set.public byte getSizeType()
public void setCustomWidth(int customWidth)
ViewPortConfigurator.SIZE_USE_CUSTOM_WIDTH is set.
By default a value of 500 is set.
public int getCustomWidth()
public void setCustomHeight(int customHeight)
ViewPortConfigurator.SIZE_USE_CUSTOM_HEIGHT is set.
By default a value of 500 is set.
public int getCustomHeight()
public void setGraph2DView(Graph2DView view)
ViewPortConfigurator.CLIP_VIEW is active.
public void setGraph2D(Graph2D graph)
ViewPortConfigurator.CLIP_GRAPH is active.
public Graph2D getGraph2D()
public Graph2DView getGraph2DView()
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||