|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.document.render.AbstractListenableRenderSettings com.levigo.jadice.document.render.BaseRenderSettings
public class BaseRenderSettings
The BaseRenderSettings, as their name implies, control the most fundamental properties of a rendering. in particular, they include geometry, layering and clipping.
Nested Class Summary | |
---|---|
static class |
BaseRenderSettings.Clipping
An enumeration describing what kind of clipping is applied before rendering a part of the model (which usually starts at the page level). |
static class |
BaseRenderSettings.Rotation
An enumeration of type safe rotation values. |
Field Summary | |
---|---|
static String |
ALL_LAYERS_ENABLED
Identifier key for all-layer enabled state change, used within a RenderSettingsEvent to recognize the kind of change which happen. |
static String |
CLIPPING
Identifier key for a clipping type change. |
static String |
DEVICE_RESOLUTION
Identifier key for a change of the device resolution, used within a RenderSettingsEvent to recognize the kind of change which happen. |
static String |
LAYER_ENABLED
Identifier key for a layer enabled state change, used within a RenderSettingsEvent to recognize the kind of change which happen. |
static String |
ROTATION
Identifier key for a rotation change, used within a RenderSettingsEvent to
recognize the kind of change which happen. |
static String |
ZOOM
Identifier key for a zoom change, used within a RenderSettingsEvent to recognize
the kind of change which happen. |
Constructor Summary | |
---|---|
BaseRenderSettings()
|
Method Summary | |
---|---|
double |
baseToDevice(double value)
Utility method: convert base units to device units and apply zoom factor |
int |
baseToDevice(int value)
Utility method: convert base units to device units and apply zoom factor |
BaseRenderSettings |
createSnapshot()
Creates and returns a snapshot copy of this settings instance. |
double |
deviceToBase(double value)
Utility method: convert device units to base units and unapply zoom factor |
int |
deviceToBase(int value)
Utility method: convert device units to base units and unapply zoom factor |
void |
disableAllLayers()
Disables the rendering of all standard layers provided by the DocumentLayer class and
explicit enabled layers (defined by a call of
setDocumentLayerEnabled(DocumentLayer, boolean) with a true boolean parameter). |
void |
enableAllLayers()
Enables the rendering of all standard layers provided by the DocumentLayer class and
explicit disabled layers (defined by a call of
setDocumentLayerEnabled(DocumentLayer, boolean) with a false boolean parameter). |
boolean |
equals(Object obj)
|
AffineTransform |
getAffineTransform()
Gets the affine transform for this render context, useful for converting from document to device space. |
AffineTransform |
getAffineTransform(Dimension2D srcSize)
Gets the affine transform for this render setting, useful for converting from document to device space. |
BaseRenderSettings.Clipping |
getClipping()
Return the clipping type. |
int |
getDeviceResolution()
Gets the device resolution. |
AffineTransform |
getInverseTransform(Dimension2D pageSize)
Gets the inverse affine transform for this render context, useful for converting from device to document space. |
List<DocumentLayer> |
getOrderedAndActiveLayers(Collection<DocumentLayer> candidateLayers)
Returns a collection of candidate layers in an ordering suitable for rendering. |
BaseRenderSettings.Rotation |
getRotation()
Gets the rotation angle. |
float |
getZoom()
Gets the zoom factor. |
int |
getZoomFactor()
Deprecated. Please consider using the getZoom() method instead. Note though, that you
will need to multiply its return value by 100 in order to obtain a percent value.
This method has been deprecated, because the integer-granularity may introduce
rounding-errors which may be unacceptable in certain situations. |
int |
hashCode()
|
boolean |
isDocumentLayerEnabled(DocumentLayer layer)
Returns whether layer class should be rendered or not. |
void |
setClipping(BaseRenderSettings.Clipping clipping)
Set the clipping type. |
void |
setDeviceResolution(int deviceResolution)
Sets the device resolution. |
void |
setDocumentLayerEnabled(DocumentLayer layer,
boolean value)
Sets a flag whether document layer of given class should be rendered or not. |
void |
setRotation(BaseRenderSettings.Rotation r)
Sets the rotation angle. |
void |
setZoom(float zoomFactor)
Sets the zoom factor. |
void |
setZoomFactor(int zoomFactor)
Deprecated. Please consider using the setZoom(float) method instead. Note though, that
you will need to divide your argument value by 100. This method has been
deprecated, because the integer-granularity may introduce rounding-errors which may
be unacceptable in certain situations. |
void |
update(String propertyName,
RenderSettings other,
Object... details)
Updates this instance property specified by given property name with the value provided by the other processing setting. |
Methods inherited from class com.levigo.jadice.document.render.AbstractListenableRenderSettings |
---|
fireChanged, getSettingsChangeHandler, setSettingsChangeHandler |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LAYER_ENABLED
RenderSettingsEvent
to recognize the kind of change which happen.
setDocumentLayerEnabled(DocumentLayer, boolean)
,
isDocumentLayerEnabled(DocumentLayer)
,
Constant Field Valuespublic static final String ALL_LAYERS_ENABLED
RenderSettingsEvent
to recognize the kind of change which happen.
public static final String ROTATION
RenderSettingsEvent
to
recognize the kind of change which happen.
setRotation(Rotation)
,
getRotation()
,
Constant Field Valuespublic static final String ZOOM
RenderSettingsEvent
to recognize
the kind of change which happen.
setZoom(float)
,
getZoom()
,
Constant Field Valuespublic static final String CLIPPING
setClipping(Clipping)
,
getClipping()
,
Constant Field Valuespublic static final String DEVICE_RESOLUTION
RenderSettingsEvent
to recognize the kind of change which happen.
Constructor Detail |
---|
public BaseRenderSettings()
Method Detail |
---|
public void setDocumentLayerEnabled(DocumentLayer layer, boolean value)
layer
- Document layer.value
- Flagpublic void enableAllLayers()
DocumentLayer
class and
explicit disabled layers (defined by a call of
setDocumentLayerEnabled(DocumentLayer, boolean)
with a false boolean parameter).
Standard layers provided by the DocumentLayer
class are:
setDocumentLayerEnabled(DocumentLayer, boolean)
is
advised.
public void disableAllLayers()
DocumentLayer
class and
explicit enabled layers (defined by a call of
setDocumentLayerEnabled(DocumentLayer, boolean)
with a true boolean parameter).
Standard layers provided by the DocumentLayer
class are:
setDocumentLayerEnabled(DocumentLayer, boolean)
is
advised.
public boolean isDocumentLayerEnabled(DocumentLayer layer)
layer
-
public List<DocumentLayer> getOrderedAndActiveLayers(Collection<DocumentLayer> candidateLayers)
DocumentLayer.compareTo(DocumentLayer)
method.
candidateLayers
-
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public BaseRenderSettings createSnapshot()
public BaseRenderSettings.Rotation getRotation()
BaseRenderSettings.Rotation
public void setRotation(BaseRenderSettings.Rotation r)
r
- The rotation angle to set See also BaseRenderSettings.Rotation
@Deprecated public int getZoomFactor()
getZoom()
method instead. Note though, that you
will need to multiply its return value by 100 in order to obtain a percent value.
This method has been deprecated, because the integer-granularity may introduce
rounding-errors which may be unacceptable in certain situations.
@Deprecated public void setZoomFactor(int zoomFactor)
setZoom(float)
method instead. Note though, that
you will need to divide your argument value by 100. This method has been
deprecated, because the integer-granularity may introduce rounding-errors which may
be unacceptable in certain situations.
zoomFactor
- The zoomFactor to setpublic float getZoom()
getZoomFactor()
, this method returns an actual
factor, i.e. a value of 1.0f corresponds a 1:1 rendering.
public void setZoom(float zoomFactor)
setZoomFactor(int)
, this method takes an actual
factor, i.e. a value of 1.0f corresponds a 1:1 rendering.
zoomFactor
- The zoomFactor to setpublic int getDeviceResolution()
public void setDeviceResolution(int deviceResolution)
deviceResolution
- The device resolution to setpublic int baseToDevice(int value)
value
- value in base units
public double baseToDevice(double value)
value
- value in base units
public int deviceToBase(int value)
value
- value in device units
public double deviceToBase(double value)
value
- value in device units
public AffineTransform getAffineTransform()
public AffineTransform getAffineTransform(Dimension2D srcSize)
srcSize
- the size of the object to be rendered in source (document) coordinates.
public AffineTransform getInverseTransform(Dimension2D pageSize)
pageSize
- the pages size in base units
public void update(String propertyName, RenderSettings other, Object... details)
RenderSettings
propertyName
- the name of the property to update. Update supported properties have unique
property identifier provided by the specific render settings implementation.other
- the processing setting which provide the new property value. Therefore the other
processing setting have to be of the same type as this instance.details
- (optional) if some describing details are necessary to do a specific update, the
details parameter will transport this informationspublic BaseRenderSettings.Clipping getClipping()
public void setClipping(BaseRenderSettings.Clipping clipping)
clipping
- the clipping type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |