Package org.eclipse.birt.chart.render
Class DeferredCache
- java.lang.Object
-
- org.eclipse.birt.chart.render.DeferredCache
-
- All Implemented Interfaces:
java.lang.Comparable<DeferredCache>
public final class DeferredCache extends java.lang.Object implements java.lang.Comparable<DeferredCache>
This class implements deferred rendering capability for chart.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.List<java.lang.Object>al3Dstatic intFLUSH_3Dstatic intFLUSH_ALLstatic intFLUSH_CONNECTION_LINEstatic intFLUSH_LABLEstatic intFLUSH_LINEstatic intFLUSH_MARKERstatic intFLUSH_PLANEstatic intFLUSH_PLANE_SHADOW
-
Constructor Summary
Constructors Constructor Description DeferredCache(IDeviceRenderer idr, Chart c, int cacheIndex)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectionLine(LineRenderEvent lre)Adds marker connection line rendering event to cache.voidaddLabel(TextRenderEvent tre)Adds text rendering event to cache.voidaddLine(LineRenderEvent lre)Adds line rendering event to cache.voidaddMarker(PrimitiveRenderEvent pre, int iInstruction, double iMarkerSize, int zOrder)Adds marker rendering event to cache.voidaddModel(WrappedInstruction wi)Adds wrapped rendering event to cache.java.lang.ObjectaddPlane(PrimitiveRenderEvent pre, int iInstruction)Adds rendering Plane event to cache.java.lang.ObjectaddPlane(PrimitiveRenderEvent pre, int iInstruction, int zorder_hint)voidaddPlaneShadow(PrimitiveRenderEvent pre, int iInstruction)Adds rendering Plane event to cache.voidaddPlaneShadow(PrimitiveRenderEvent pre, int iInstruction, int zorder_hint)intcompareTo(DeferredCache other)DeferredCachederiveNewDeferredCache()Create a new instance ofDeverredCacheaccording to current device render and chart model.voidflush()Flush the cache, perform all pending rendering tasks.voidflushOptions(int options)Flush the cache of specified types.java.util.List<LineRenderEvent>getAllConnectionLines()Returns all cached connection lines.java.util.List<TextRenderEvent>getAllLabels()Returns all cached labels.java.util.List<MarkerInstruction>getAllMarkers()Returns all cached markers.DeferredCachegetParentDeferredCache()booleanisTransposed()voidprocess3DEvent(Engine3D engine, double xOffset, double yOffset)Pre-process all the 3D rendering events.voidsetAntialiasing(boolean antialiasing)Enables if all 3D polygons in current deferred cache need antialiasing.voidsetParentDeferredCache(DeferredCache dc)voidsetPlanesComparator(java.util.Comparator<?> cp)voidsetPlaneShadowsComparator(java.util.Comparator<?> cp)
-
-
-
Field Detail
-
FLUSH_PLANE
public static final int FLUSH_PLANE
- See Also:
- Constant Field Values
-
FLUSH_LINE
public static final int FLUSH_LINE
- See Also:
- Constant Field Values
-
FLUSH_MARKER
public static final int FLUSH_MARKER
- See Also:
- Constant Field Values
-
FLUSH_LABLE
public static final int FLUSH_LABLE
- See Also:
- Constant Field Values
-
FLUSH_3D
public static final int FLUSH_3D
- See Also:
- Constant Field Values
-
FLUSH_PLANE_SHADOW
public static final int FLUSH_PLANE_SHADOW
- See Also:
- Constant Field Values
-
FLUSH_CONNECTION_LINE
public static final int FLUSH_CONNECTION_LINE
- See Also:
- Constant Field Values
-
FLUSH_ALL
public static final int FLUSH_ALL
- See Also:
- Constant Field Values
-
al3D
public java.util.List<java.lang.Object> al3D
-
-
Constructor Detail
-
DeferredCache
public DeferredCache(IDeviceRenderer idr, Chart c, int cacheIndex)
The constructor.
-
-
Method Detail
-
addPlane
public java.lang.Object addPlane(PrimitiveRenderEvent pre, int iInstruction)
Adds rendering Plane event to cache.- Parameters:
pre- As of now, supported types are RectanguleRenderEvent and PolygonRenderEvent
-
addPlane
public java.lang.Object addPlane(PrimitiveRenderEvent pre, int iInstruction, int zorder_hint)
-
addPlaneShadow
public void addPlaneShadow(PrimitiveRenderEvent pre, int iInstruction)
Adds rendering Plane event to cache. This Plane is usually a shadow or depth, and will be in the lower z-order- Parameters:
pre- As of now, supported types are RectanguleRenderEvent and PolygonRenderEvent
-
addPlaneShadow
public void addPlaneShadow(PrimitiveRenderEvent pre, int iInstruction, int zorder_hint)
-
addModel
public void addModel(WrappedInstruction wi)
Adds wrapped rendering event to cache. Never use this for 3D rendering event.
-
addLine
public void addLine(LineRenderEvent lre)
Adds line rendering event to cache.
-
addConnectionLine
public void addConnectionLine(LineRenderEvent lre)
Adds marker connection line rendering event to cache.
-
addLabel
public void addLabel(TextRenderEvent tre)
Adds text rendering event to cache.
-
addMarker
public void addMarker(PrimitiveRenderEvent pre, int iInstruction, double iMarkerSize, int zOrder)
Adds marker rendering event to cache.
-
flush
public void flush() throws ChartExceptionFlush the cache, perform all pending rendering tasks.- Throws:
ChartException
-
flushOptions
public void flushOptions(int options) throws ChartExceptionFlush the cache of specified types.- Parameters:
options- types- Throws:
ChartException- Since:
- 2.2
- See Also:
FLUSH_3D,FLUSH_LABLE,FLUSH_LINE,FLUSH_MARKER,FLUSH_PLANE
-
process3DEvent
public void process3DEvent(Engine3D engine, double xOffset, double yOffset)
Pre-process all the 3D rendering events. This must be called beforeflush().
-
isTransposed
public boolean isTransposed()
- Returns:
- Returns if current rendering context is transposed.
-
getAllConnectionLines
public java.util.List<LineRenderEvent> getAllConnectionLines()
Returns all cached connection lines.- Returns:
- all cached connection lines.
-
getAllMarkers
public java.util.List<MarkerInstruction> getAllMarkers()
Returns all cached markers.- Returns:
- all cached markers.
-
getAllLabels
public java.util.List<TextRenderEvent> getAllLabels()
Returns all cached labels.- Returns:
- all cached labels.
-
setPlaneShadowsComparator
public void setPlaneShadowsComparator(java.util.Comparator<?> cp)
-
setPlanesComparator
public void setPlanesComparator(java.util.Comparator<?> cp)
-
deriveNewDeferredCache
public DeferredCache deriveNewDeferredCache()
Create a new instance ofDeverredCacheaccording to current device render and chart model.- Returns:
- Since:
- 2.6.2
-
getParentDeferredCache
public DeferredCache getParentDeferredCache()
-
setParentDeferredCache
public void setParentDeferredCache(DeferredCache dc)
-
setAntialiasing
public void setAntialiasing(boolean antialiasing)
Enables if all 3D polygons in current deferred cache need antialiasing.- Parameters:
antialiasing-
-
compareTo
public int compareTo(DeferredCache other)
- Specified by:
compareToin interfacejava.lang.Comparable<DeferredCache>
-
-