net.sf.latexdraw.glib.views.Java2D.impl
Class LRectangularView<S extends IRectangularShape>

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.LRectangularView<S>
All Implemented Interfaces:
IAbstractView, IViewShape, Pickable
Direct Known Subclasses:
LEllipseView, LRectangleView, LRhombusView, LTriangleView

abstract class LRectangularView<S extends IRectangularShape>
extends LShapeView<S>

Defines a view of the IRectangularView 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.

03/01/2010

Since:
3.0
Author:
Arnaud BLOUIN

Field Summary
 
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 LRectangularView(S model)
          Initialises a rectangular view.
 
Method Summary
protected  double getBorderGap()
           
protected static void getRotatedRectangle(double tlx, double tly, double width, double height, double angle, IPoint gravityCentre, IPoint tl, IPoint br)
          Gives the top-left and the bottom-right points of the rotated rectangle.
protected abstract  void setRectangularShape(java.awt.geom.Path2D path, double tlx, double tly, double width, double height)
          Creates a rectangular shape in the given path using the given information.
 void updateBorder()
          Update the border of the shape view.
protected  void updateDblePathInside()
          Updates the borders of the double boundary when position is inside.
protected  void updateDblePathMiddle()
          Updates the borders of the double boundary when position is middle.
protected  void updateDblePathOutside()
          Updates the borders of the double boundary when position is outside.
private  void updateGeneralPath(double gap)
          Update the path of the rectangular shape.
protected  void updateGeneralPathInside()
          Updates the borders of the shape as inside borders.
protected  void updateGeneralPathMiddle()
          Updates the borders of the shape as middle borders.
protected  void updateGeneralPathOutside()
          Updates the borders of the shape as outside borders.
 
Methods inherited from class net.sf.latexdraw.glib.views.Java2D.impl.LShapeView
beginRotation, contains, contains, endRotation, flush, getBorder, getPath, getPicker, getRotatedShape2D, getRotatedShape2D, getStroke, getStrokeThickness, intersects, paint, paintArrows, paintBorders, paintFilling, paintShadow, paintShowPointsDots, paintShowPointsLines, update, updatePath, updatePathArrows
 
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
 

Constructor Detail

LRectangularView

protected LRectangularView(S model)
Initialises a rectangular view.

Parameters:
model - The rectangular model.
Since:
3.0
Method Detail

getBorderGap

protected double getBorderGap()

getRotatedRectangle

protected static void getRotatedRectangle(double tlx,
                                          double tly,
                                          double width,
                                          double height,
                                          double angle,
                                          IPoint gravityCentre,
                                          IPoint tl,
                                          IPoint br)
Gives the top-left and the bottom-right points of the rotated rectangle.

Parameters:
tlx - The top-left x-coordinate of the rectangle to rotate.
tly - The top-left y-coordinate of the rectangle to rotate.
width - The width of the rectangle to rotate.
height - The height of the rectangle to rotate.
angle - The rotation angle.
gravityCentre - The gravity centre used for the rotation.
tl - The resulting top-left point. Must not be null.
br - The resulting bottom-right point. Must not be null.
Since:
3.0

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<S extends IRectangularShape>

updateGeneralPathInside

protected void updateGeneralPathInside()
Description copied from class: LShapeView
Updates the borders of the shape as inside borders.

Specified by:
updateGeneralPathInside in class LShapeView<S extends IRectangularShape>

updateGeneralPathMiddle

protected void updateGeneralPathMiddle()
Description copied from class: LShapeView
Updates the borders of the shape as middle borders.

Specified by:
updateGeneralPathMiddle in class LShapeView<S extends IRectangularShape>

updateGeneralPathOutside

protected void updateGeneralPathOutside()
Description copied from class: LShapeView
Updates the borders of the shape as outside borders.

Specified by:
updateGeneralPathOutside in class LShapeView<S extends IRectangularShape>

updateGeneralPath

private void updateGeneralPath(double gap)
Update the path of the rectangular shape.

Parameters:
gap - The value removed from the height and the width of the shape. Can equal 0.
Since:
3.0

setRectangularShape

protected abstract void setRectangularShape(java.awt.geom.Path2D path,
                                            double tlx,
                                            double tly,
                                            double width,
                                            double height)
Creates a rectangular shape in the given path using the given information. The path is not cleared.

Parameters:
path - The path to fill.
tlx - The X-coordinate of the top-left of the rectangular shape to draw.
tly - The Y-coordinate of the top-left of the rectangular shape to draw.
width - The width of the rectangular shape.
height - The height of the rectangular shape.
Since:
3.0

updateDblePathInside

protected void updateDblePathInside()
Description copied from class: LShapeView
Updates the borders of the double boundary when position is inside.

Specified by:
updateDblePathInside in class LShapeView<S extends IRectangularShape>

updateDblePathMiddle

protected void updateDblePathMiddle()
Description copied from class: LShapeView
Updates the borders of the double boundary when position is middle.

Specified by:
updateDblePathMiddle in class LShapeView<S extends IRectangularShape>

updateDblePathOutside

protected void updateDblePathOutside()
Description copied from class: LShapeView
Updates the borders of the double boundary when position is outside.

Specified by:
updateDblePathOutside in class LShapeView<S extends IRectangularShape>