Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jpicedt.graphic.view
Class DefaultViewFactory  view DefaultViewFactory download DefaultViewFactory.java

java.lang.Object
  extended byjpicedt.graphic.view.DefaultViewFactory
All Implemented Interfaces:
jpicedt.graphic.model.PicObjectConstants, ViewFactory

public class DefaultViewFactory
extends java.lang.Object
implements ViewFactory, jpicedt.graphic.model.PicObjectConstants

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 :

Since:
jPicEdt 1.3.2

Nested Class Summary
 class DefaultViewFactory.CompositeView
          a CompositeView is a graphic representation of a BranchElement
 class DefaultViewFactory.CubicBezierView
          A view for rendering cubic splines
 class DefaultViewFactory.EllipseView
          a View to render PicEllipse
protected  class DefaultViewFactory.LeafElementView
          a View for rendering leaf-elements ; implements attributes caching, and shape rendering.
 class DefaultViewFactory.PolygonView
          a View for rendering polygons
 class DefaultViewFactory.QuadBezierView
          A view for rendering quad splines
 class DefaultViewFactory.RectangleView
          a View for rendering rectangles
 class DefaultViewFactory.TextView
          a View for rendering Text's
 
Field Summary
static java.lang.String KEY_TEXT_FONT
          key used to fetch the font family value from a Properties object
static java.awt.Font TEXT_FONT_DEFAULT
          default font used to display text with TextView
protected static java.awt.Font textFont
          font used to display text strings with TextView
 
Fields inherited from interface jpicedt.graphic.model.PicObjectConstants
CROSSHATCH, CROSSHATCH_FILLED, DASH_OPAQUE, DASH_TRANSPARENT, DASH1, DASH2, DASH3, DASHED, DIMEN, DOT_SEP, DOT_SEP1, DOT_SEP2, DOT_SEP3, DOTTED, DOUBLE_COLOR, DOUBLE_LINE, DOUBLE_SEP, FILL_COLOR, FILL_STYLE, HATCH_ANGLE, HATCH_COLOR, HATCH_SEP, HATCH_WIDTH, HLINES, HLINES_FILLED, INNER, LEFT_ARROW, LINE_COLOR, LINE_STYLE, LINE_WIDTH, MaxAttributeNameIndex, MIDDLE, NONE, OUTER, POLYGON_DOTS, POLYGON_SOLID, POLYGON_STYLE, PS_POINT, RIGHT_ARROW, SHADOW, SHADOW_ANGLE, SHADOW_COLOR, SHADOW_SIZE, SOLID, VLINES, VLINES_FILLED
 
Constructor Summary
DefaultViewFactory()
           
 
Method Summary
private  void _paintHatches(java.awt.Graphics2D g, jpicedt.graphic.model.PicAttributeSet set, double angle, java.awt.geom.Rectangle2D clip)
           
static void configure(java.util.Properties preferences)
          Configure static fields using the given Properties object
protected  jpicedt.graphic.model.Arrow createArrow(jpicedt.graphic.model.PicAttributeSet set, jpicedt.graphic.model.PicAttributeName direction)
           
protected  java.awt.Shape createDotsForPolygons(jpicedt.graphic.model.PicAttributeSet set)
           
protected  java.awt.Paint createPaintForInterior(jpicedt.graphic.model.PicAttributeSet set)
           
protected  java.awt.Paint createPaintForOutline(jpicedt.graphic.model.PicAttributeSet set)
           
protected  java.awt.Stroke createStroke(jpicedt.graphic.model.PicAttributeSet set)
           
 View createView(jpicedt.graphic.model.Element element)
           
static void main(java.lang.String[] arg)
           
protected  void paintHatches(java.awt.Graphics2D g, jpicedt.graphic.model.PicAttributeSet set, java.awt.Shape shape)
          paint hatches (vlines,...) depending on the FILL_STYLE attributes of the given set.
protected  void paintShadow(java.awt.Graphics2D g, jpicedt.graphic.model.PicAttributeSet set, java.awt.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

TEXT_FONT_DEFAULT

public static java.awt.Font TEXT_FONT_DEFAULT
default font used to display text with TextView


KEY_TEXT_FONT

public static java.lang.String KEY_TEXT_FONT
key used to fetch the font family value from a Properties object


textFont

protected static java.awt.Font textFont
font used to display text strings with TextView

Constructor Detail

DefaultViewFactory

public DefaultViewFactory()
Method Detail

main

public static void main(java.lang.String[] arg)

configure

public static void configure(java.util.Properties preferences)
Configure static fields using the given Properties object


createView

public View createView(jpicedt.graphic.model.Element element)
Specified by:
createView in interface ViewFactory

createStroke

protected java.awt.Stroke createStroke(jpicedt.graphic.model.PicAttributeSet set)

createPaintForOutline

protected java.awt.Paint createPaintForOutline(jpicedt.graphic.model.PicAttributeSet set)

createPaintForInterior

protected java.awt.Paint createPaintForInterior(jpicedt.graphic.model.PicAttributeSet set)

createDotsForPolygons

protected java.awt.Shape createDotsForPolygons(jpicedt.graphic.model.PicAttributeSet set)

paintHatches

protected void paintHatches(java.awt.Graphics2D g,
                            jpicedt.graphic.model.PicAttributeSet set,
                            java.awt.Shape shape)
paint hatches (vlines,...) depending on the FILL_STYLE attributes of the given set. Factory that don't paint hatches should override to do nothing.


_paintHatches

private void _paintHatches(java.awt.Graphics2D g,
                           jpicedt.graphic.model.PicAttributeSet set,
                           double angle,
                           java.awt.geom.Rectangle2D clip)

paintShadow

protected void paintShadow(java.awt.Graphics2D g,
                           jpicedt.graphic.model.PicAttributeSet set,
                           java.awt.Shape shape)
paint shadow depending on the SHADOW attribute and rel. Factory that don't paint shadow should override to do nothing.


createArrow

protected jpicedt.graphic.model.Arrow createArrow(jpicedt.graphic.model.PicAttributeSet set,
                                                  jpicedt.graphic.model.PicAttributeName direction)