|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.io.ViewPortConfigurator
public class 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 configure 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 configure the viewport. |
void |
setClipType(byte clipType)
Sets the clip type used to configure 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 CLIP_GRAPH is active. |
void |
setGraph2DView(Graph2DView view)
Sets the reference view used to configure the viewport when clip type CLIP_VIEW is active. |
void |
setMargin(int margin)
When clip type CLIP_GRAPH is being used, then an additional 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 configure 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
setClipType(byte)public static byte CLIP_VIEW
setClipType(byte)public static byte SIZE_USE_ORIGINAL
CLIP_GRAPH, then
the viewport will have the size of the diagram as it is given in world coordinates.
If the clip type is CLIP_VIEW, then
the viewport will have the size of the reference view.
public static byte SIZE_USE_CUSTOM_WIDTH
setCustomWidth(int) as the width
of the viewport. The height will be scaled accordingly to avoid distortions.
Invoking this method effectively invalidates the value set by method setCustomHeight(int).
public static byte SIZE_USE_CUSTOM_HEIGHT
setCustomHeight(int) as the height
of the viewport. The width will be scaled accordingly to avoid distortions.
Invoking this method effectively invalidates the value set by method setCustomWidth(int).
| Constructor Detail |
|---|
public ViewPortConfigurator()
| Method Detail |
|---|
public void configure(Graph2DView viewPort)
public void setScalingFactor(double scale)
1.0.
java.lang.IllegalArgumentException - if scale is not positivepublic double getScalingFactor()
setScalingFactor(double)public void setMargin(int margin)
CLIP_GRAPH is being used, then an additional 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()
setMargin(int).public void setClipType(byte clipType)
clipType - one of CLIP_VIEW or CLIP_GRAPH.
By default CLIP_GRAPH is set.public byte getClipType()
public void setSizeType(byte sizeType)
sizeType - one of SIZE_USE_ORIGINAL, SIZE_USE_CUSTOM_WIDTH or SIZE_USE_CUSTOM_HEIGHT.
By default SIZE_USE_ORIGINAL is set.public byte getSizeType()
public void setCustomWidth(int customWidth)
SIZE_USE_CUSTOM_WIDTH is set.
By default a value of 500 is set.
java.lang.IllegalArgumentException - if customWidth is not positivepublic int getCustomWidth()
public void setCustomHeight(int customHeight)
SIZE_USE_CUSTOM_HEIGHT is set.
By default a value of 500 is set.
java.lang.IllegalArgumentException - if customHeight is not positivepublic int getCustomHeight()
public void setGraph2DView(Graph2DView view)
CLIP_VIEW is active.
public void setGraph2D(Graph2D graph)
CLIP_GRAPH is active.
public Graph2D getGraph2D()
public Graph2DView getGraph2DView()
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||