org.math.plot.render
Class AbstractDrawer

java.lang.Object
  extended by org.math.plot.render.AbstractDrawer
Direct Known Subclasses:
AWTDrawer

public abstract class AbstractDrawer
extends Object


Field Summary
protected  double[] base_offset
           
 PlotCanvas canvas
           
protected  Color color
           
protected  Graphics2D comp2D
           
static int CONTINOUS_LINE
           
static int CROSS_DOT
           
static Color DEFAULT_COLOR
           
static int DEFAULT_DOT_RADIUS
           
static Font DEFAULT_FONT
           
static int DEFAULT_LINE_WIDTH
           
protected  boolean[][] dot_pattern
           
protected  int dot_radius
           
static boolean[][] DOT_SQUARE_PATTERN
           
static boolean[][] DOT_TRIANGLE_PATTERN
           
protected  int dot_type
           
static int DOTTED_LINE
           
protected  Font font
           
protected  int line_type
           
protected  int line_width
           
static int PATTERN_DOT
           
static int ROUND_DOT
           
protected  int[] screen_offset
           
protected  double text_angle
           
protected  double text_Eastoffset
           
protected  double text_Northoffset
           
 
Constructor Summary
AbstractDrawer(PlotCanvas _canvas)
           
 
Method Summary
abstract  void dilate(int[] screenOrigin, double[] screenRatio)
          Plot ActionMode : dilatation of the plot
 void drawCoordinate(double[] pC)
           
abstract  void drawDot(double... pC)
           
abstract  void drawLine(double[]... pC)
           
abstract  void drawLineBase(double[]... rC)
           
abstract  void drawPolygon(double[]... pC)
           
abstract  void drawText(String label, double... pC)
           
abstract  void drawTextBase(String label, double... rC)
           
abstract  void fillPolygon(double[]... pC)
           
 double[] getBaseOffset()
           
 Color getColor()
           
 boolean[][] getDotPattern()
           
 int getDotRadius()
           
 int getDotType()
           
 Font getFont()
           
 int[] getScreenOffset()
           
 double getTextAngle()
           
 double[] getTextOffset()
           
 void initGraphics(Graphics2D _comp2D)
          Method used to initialize drawer to DEFAULT values
abstract  int[] project(double... pC)
          Returns the screen coordinates coresponding to plot coordinates Used to test if mouse is pointing on a plot.
abstract  int[] projectBase(double... rC)
          Returns the screen coordinates coresponding to plot coordinates Used to test if mouse is pointing on a plot.
abstract  void resetBaseProjection()
          Method used to reinitialize the plot when the base has changed (bounds or scale)
 void setBaseOffset(double... _boffset)
           
 void setColor(Color c)
           
 void setDotPattern(boolean[][] _dot_pattern)
           
 void setDotRadius(int _dot_radius)
           
 void setDotType(int _dot_type)
           
 void setFont(Font f)
           
 void setLineType(int _line_type)
           
 void setLineWidth(int _line_width)
           
 void setScreenOffset(int... _soffset)
           
 void setTextAngle(double _angle)
           
 void setTextOffset(double _cornerEast, double _cornerNorth)
           
static boolean[][] stringToPattern(String empty, String... c)
           
static boolean[] stringToPattern(String empty, String c)
           
abstract  void translate(int... t)
          Plot ActionMode : translation of the plot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

canvas

public PlotCanvas canvas

comp2D

protected Graphics2D comp2D

ROUND_DOT

public static final int ROUND_DOT
See Also:
Constant Field Values

CROSS_DOT

public static final int CROSS_DOT
See Also:
Constant Field Values

PATTERN_DOT

public static final int PATTERN_DOT
See Also:
Constant Field Values

CONTINOUS_LINE

public static final int CONTINOUS_LINE
See Also:
Constant Field Values

DOTTED_LINE

public static final int DOTTED_LINE
See Also:
Constant Field Values

DEFAULT_DOT_RADIUS

public static final int DEFAULT_DOT_RADIUS
See Also:
Constant Field Values

DEFAULT_LINE_WIDTH

public static final int DEFAULT_LINE_WIDTH
See Also:
Constant Field Values

DOT_TRIANGLE_PATTERN

public static final boolean[][] DOT_TRIANGLE_PATTERN

DOT_SQUARE_PATTERN

public static final boolean[][] DOT_SQUARE_PATTERN

DEFAULT_FONT

public static final Font DEFAULT_FONT

DEFAULT_COLOR

public static final Color DEFAULT_COLOR

font

protected Font font

text_Eastoffset

protected double text_Eastoffset

text_Northoffset

protected double text_Northoffset

text_angle

protected double text_angle

color

protected Color color

base_offset

protected double[] base_offset

screen_offset

protected int[] screen_offset

dot_type

protected int dot_type

dot_radius

protected int dot_radius

dot_pattern

protected boolean[][] dot_pattern

line_type

protected int line_type

line_width

protected int line_width
Constructor Detail

AbstractDrawer

public AbstractDrawer(PlotCanvas _canvas)
Method Detail

initGraphics

public void initGraphics(Graphics2D _comp2D)
Method used to initialize drawer to DEFAULT values


resetBaseProjection

public abstract void resetBaseProjection()
Method used to reinitialize the plot when the base has changed (bounds or scale)


setColor

public void setColor(Color c)

setFont

public void setFont(Font f)

setTextOffset

public void setTextOffset(double _cornerEast,
                          double _cornerNorth)

setTextAngle

public void setTextAngle(double _angle)

setDotType

public void setDotType(int _dot_type)

setDotRadius

public void setDotRadius(int _dot_radius)

setDotPattern

public void setDotPattern(boolean[][] _dot_pattern)

setLineType

public void setLineType(int _line_type)

setLineWidth

public void setLineWidth(int _line_width)

setBaseOffset

public void setBaseOffset(double... _boffset)

setScreenOffset

public void setScreenOffset(int... _soffset)

getColor

public Color getColor()

getFont

public Font getFont()

getTextOffset

public double[] getTextOffset()

getTextAngle

public double getTextAngle()

getDotType

public int getDotType()

getDotRadius

public int getDotRadius()

getDotPattern

public boolean[][] getDotPattern()

getBaseOffset

public double[] getBaseOffset()

getScreenOffset

public int[] getScreenOffset()

project

public abstract int[] project(double... pC)
Returns the screen coordinates coresponding to plot coordinates Used to test if mouse is pointing on a plot.

Parameters:
pC - plot ccordinates to project in screen
Returns:
scrren coordinates

projectBase

public abstract int[] projectBase(double... rC)
Returns the screen coordinates coresponding to plot coordinates Used to test if mouse is pointing on a plot.

Parameters:
pC - plot ccordinates to project in screen
Returns:
scrren coordinates

translate

public abstract void translate(int... t)
Plot ActionMode : translation of the plot

Parameters:
t - mouse translation in pixels

dilate

public abstract void dilate(int[] screenOrigin,
                            double[] screenRatio)
Plot ActionMode : dilatation of the plot

Parameters:
screenOrigin - mouse initial position
screenRatio - mouse final position relative to plot panel size

drawCoordinate

public void drawCoordinate(double[] pC)

drawText

public abstract void drawText(String label,
                              double... pC)

drawTextBase

public abstract void drawTextBase(String label,
                                  double... rC)

drawLineBase

public abstract void drawLineBase(double[]... rC)

drawLine

public abstract void drawLine(double[]... pC)

drawDot

public abstract void drawDot(double... pC)

drawPolygon

public abstract void drawPolygon(double[]... pC)

fillPolygon

public abstract void fillPolygon(double[]... pC)

stringToPattern

public static boolean[][] stringToPattern(String empty,
                                          String... c)

stringToPattern

public static boolean[] stringToPattern(String empty,
                                        String c)