|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjpicedt.graphic.view.DefaultViewFactory
public class DefaultViewFactory
This is the default factory used to create a View for a given Element ; should be used when one wants to render all Element's attributes ; otherwise subclass with your own ViewFactory and override :
Nested Class Summary | |
---|---|
class |
DefaultViewFactory.AbstractCurveView
a View for rendering any concrete implementation of jpicedt.graphic.model.AbstractCurve |
class |
DefaultViewFactory.EllipseView
a View for rendering ellipses defined by a parallelogram |
protected class |
DefaultViewFactory.LeafElementView
a View for rendering leaf-elements ; implements attributes caching, and shape rendering. |
class |
DefaultViewFactory.ParallelogramView
a View for rendering parallelograms |
class |
DefaultViewFactory.PicNodeConnectionView
a View for rendering any concrete implementation of jpicedt.graphic.model.PicNodeConnection This view is responsible for painting the edge only! Nodes are rendered with their own view (provided they were added to the drawing at some early point...) |
class |
DefaultViewFactory.TextView
a View for rendering Text's from TextLayout's |
class |
DefaultViewFactory.TextViewHybrid
a View for rendering Text's based on bitmaps (when available) or TextLayout (when image not available) |
Field Summary | |
---|---|
static String |
KEY_TEXT_FONT
key used to fetch the font family value from a Properties object |
static Font |
TEXT_FONT_DEFAULT
default font used to display text with TextView |
protected static float |
TEXT_FONT_SCALE
scaling factor to be applied to the default font before rendering, so as to compensate for zoom factor |
protected static Font |
textFont
font used to display text strings with TextView |
Constructor Summary | |
---|---|
DefaultViewFactory()
|
Method Summary | |
---|---|
static void |
configure(Properties preferences)
Configure static fields using the given Properties object |
protected Arrow |
createArrow(PicAttributeSet set,
PicAttributeName direction)
|
protected Paint |
createPaintForInterior(PicAttributeSet set)
Returns a Paint object from the given attributes, that is suited for painting the interior of a shape. |
protected Paint |
createPaintForOutline(PicAttributeSet set)
Returns a Paint object from the given attributes, that is suited for painting an outline, or null if LINE_STYLE is NONE. |
protected Stroke |
createStroke(PicAttributeSet set)
|
View |
createView(Element element)
|
static void |
main(String[] arg)
for debugging purpose |
protected void |
paintHatches(Graphics2D g,
PicAttributeSet set,
Shape shape)
paint hatches (vlines,...) depending on the FILL_STYLE attributes of the given set. |
protected void |
paintOverStrike(Graphics2D g,
PicAttributeSet set,
Shape shape)
paint overstrike depending on the OVER_STRIKE attribute and rel. |
protected void |
paintShadow(Graphics2D g,
PicAttributeSet set,
Shape shape)
paint shadow depending on the SHADOW attribute and rel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Font TEXT_FONT_DEFAULT
public static String KEY_TEXT_FONT
protected static final float TEXT_FONT_SCALE
protected static Font textFont
Constructor Detail |
---|
public DefaultViewFactory()
Method Detail |
---|
public static void main(String[] arg)
public static void configure(Properties preferences)
properties
- used to read shared parameters
If null, default values are used.public View createView(Element element)
createView
in interface ViewFactory
protected Stroke createStroke(PicAttributeSet set)
protected Paint createPaintForOutline(PicAttributeSet set)
All currently supported attributes for painting an outline are rendered. It's up to subclassers to adapt this behavior to their need (probably by restricting it).
protected Paint createPaintForInterior(PicAttributeSet set)
The returned object depends on the FILL_STYLE and FILL_COLOR attributes of the given set:
jpicedt.graphic.model.PicObjectConstants
) for painting the interior of shapes
are rendered. [pending] gradient (need to add some attributes).
protected void paintHatches(Graphics2D g, PicAttributeSet set, Shape shape)
shape
- used to clip the hatch (ie the shape the calling view must render)protected void paintShadow(Graphics2D g, PicAttributeSet set, Shape shape)
shape
- the Shape under which to drop a shadowset
- used to fetch the shadow attributesprotected void paintOverStrike(Graphics2D g, PicAttributeSet set, Shape shape)
shape
- the Shape to overstrikeset
- used to fetch the overstrike attributesprotected Arrow createArrow(PicAttributeSet set, PicAttributeName direction)
direction
- LEFT_ARROW or RIGHT_ARROW
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |