net.sf.latexdraw.glib.views.Java2D.impl
Class LAxesView

java.lang.Object
  extended by net.sf.latexdraw.glib.views.AbstractView<S>
      extended by net.sf.latexdraw.glib.views.Java2D.impl.LShapeView<S>
          extended by net.sf.latexdraw.glib.views.Java2D.impl.LStandardGridView<IAxes>
              extended by net.sf.latexdraw.glib.views.Java2D.impl.LAxesView
All Implemented Interfaces:
IAbstractView, IViewShape, Pickable

 class LAxesView
extends LStandardGridView<IAxes>

Defines a view of the IAxes model.

This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

04/12/2008

Since:
3.0
Author:
Arnaud BLOUIN

Field Summary
static double GAP_LABEL
          The interval between the labels and the axes.
protected  java.awt.geom.Path2D pathTicks
          The path containing the data to paint concerning the ticks of the axes.
 
Fields inherited from class net.sf.latexdraw.glib.views.Java2D.impl.LStandardGridView
fontMetrics, pathLabels
 
Fields inherited from class net.sf.latexdraw.glib.views.Java2D.impl.LShapeView
arrows, border, path
 
Fields inherited from class net.sf.latexdraw.glib.views.AbstractView
shape
 
Constructor Summary
protected LAxesView(IAxes model)
           
 
Method Summary
private  boolean isElementPaintable(int val, boolean showOrigin, boolean noArrow1, boolean noArrow2, double min, double max, int i)
           
 void paint(java.awt.Graphics2D g)
          Draws the shape within a Java2D graphics.
protected  void paintArrows(java.awt.Graphics2D g, boolean asShadow)
          Paints the arrows of the shape.
 void updateBorder()
          Update the border of the shape view.
 void updatePath()
          Updates the path of the shape.
protected  void updatePathArrows()
          Updates the path of the view of the arrows.
protected  void updatePathAxes()
          Updates the general path of the view by drawing the axis of the shape.
protected  void updatePathFrame()
          Updates the general path of the view by drawing the frame of the shape.
protected  void updatePathLabels(double gapx, double gapy)
          Updates the labels path by drawing the labels of the X/Y-axis.
private  void updatePathLabelsX(IAxes.PlottingStyle ticksDisplay, IAxes.TicksStyle ticksStyle, double gapx, java.awt.font.FontRenderContext frc)
          Updates the labels path by drawing the labels of the X-axis.
private  void updatePathLabelsY(IAxes.PlottingStyle ticksDisplay, IAxes.TicksStyle ticksStyle, double gapy, java.awt.font.FontRenderContext frc)
          Updates the labels path by drawing the labels of the Y-axis.
private  void updatePathTicks(double gapx, double gapy)
          Updates the ticks path by drawing the ticks of the X/Y-axis.
private  void updatePathTicksX(double gapx, IAxes.TicksStyle ticksStyle, double tickLgth)
          Updates the ticks path by drawing the ticks of the X-axis.
private  void updatePathTicksY(double gapy, IAxes.TicksStyle ticksStyle, double tickLgth)
          Updates the ticks path by drawing the ticks of the Y-axis.
 
Methods inherited from class net.sf.latexdraw.glib.views.Java2D.impl.LStandardGridView
contains, flush, intersects, update, updateDblePathInside, updateDblePathMiddle, updateDblePathOutside, updateFonts, updateGeneralPathInside, updateGeneralPathMiddle, updateGeneralPathOutside, updateText
 
Methods inherited from class net.sf.latexdraw.glib.views.Java2D.impl.LShapeView
beginRotation, contains, endRotation, getBorder, getPath, getPicker, getRotatedShape2D, getRotatedShape2D, getStroke, getStrokeThickness, paintBorders, paintFilling, paintShadow, paintShowPointsDots, paintShowPointsLines
 
Methods inherited from class net.sf.latexdraw.glib.views.AbstractView
getShape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.latexdraw.glib.views.IAbstractView
getShape
 

Field Detail

GAP_LABEL

public static final double GAP_LABEL
The interval between the labels and the axes.

See Also:
Constant Field Values

pathTicks

protected java.awt.geom.Path2D pathTicks
The path containing the data to paint concerning the ticks of the axes.

Constructor Detail

LAxesView

protected LAxesView(IAxes model)
Method Detail

updatePathTicksX

private void updatePathTicksX(double gapx,
                              IAxes.TicksStyle ticksStyle,
                              double tickLgth)
Updates the ticks path by drawing the ticks of the X-axis.


updatePathTicksY

private void updatePathTicksY(double gapy,
                              IAxes.TicksStyle ticksStyle,
                              double tickLgth)
Updates the ticks path by drawing the ticks of the Y-axis.


updatePathTicks

private void updatePathTicks(double gapx,
                             double gapy)
Updates the ticks path by drawing the ticks of the X/Y-axis.


updatePathLabelsY

private void updatePathLabelsY(IAxes.PlottingStyle ticksDisplay,
                               IAxes.TicksStyle ticksStyle,
                               double gapy,
                               java.awt.font.FontRenderContext frc)
Updates the labels path by drawing the labels of the Y-axis.


updatePathLabelsX

private void updatePathLabelsX(IAxes.PlottingStyle ticksDisplay,
                               IAxes.TicksStyle ticksStyle,
                               double gapx,
                               java.awt.font.FontRenderContext frc)
Updates the labels path by drawing the labels of the X-axis.


isElementPaintable

private boolean isElementPaintable(int val,
                                   boolean showOrigin,
                                   boolean noArrow1,
                                   boolean noArrow2,
                                   double min,
                                   double max,
                                   int i)
Returns:
True if a ticks or a label corresponding to the given parameter can be painted.

updatePathLabels

protected void updatePathLabels(double gapx,
                                double gapy)
Updates the labels path by drawing the labels of the X/Y-axis.


updatePathFrame

protected void updatePathFrame()
Updates the general path of the view by drawing the frame of the shape.


updatePathAxes

protected void updatePathAxes()
Updates the general path of the view by drawing the axis of the shape.


updatePath

public void updatePath()
Description copied from interface: IViewShape
Updates the path of the shape.

Specified by:
updatePath in interface IViewShape
Overrides:
updatePath in class LShapeView<IAxes>

updatePathArrows

protected void updatePathArrows()
Description copied from class: LShapeView
Updates the path of the view of the arrows.

Overrides:
updatePathArrows in class LShapeView<IAxes>

paint

public void paint(java.awt.Graphics2D g)
Description copied from interface: IViewShape
Draws the shape within a Java2D graphics.

Specified by:
paint in interface IViewShape
Overrides:
paint in class LShapeView<IAxes>
Parameters:
g - The graphics where the shape must be drawn.

paintArrows

protected void paintArrows(java.awt.Graphics2D g,
                           boolean asShadow)
Description copied from class: LShapeView
Paints the arrows of the shape.

Overrides:
paintArrows in class LShapeView<IAxes>

updateBorder

public void updateBorder()
Description copied from interface: IViewShape
Update the border of the shape view.

Specified by:
updateBorder in interface IViewShape
Overrides:
updateBorder in class LShapeView<IAxes>