net.sf.latexdraw.glib.views.pst
Class PSTShapeView<S extends IShape>
java.lang.Object
net.sf.latexdraw.glib.views.AbstractView<S>
net.sf.latexdraw.glib.views.AbstractCodeView<S>
net.sf.latexdraw.glib.views.pst.PSTShapeView<S>
- All Implemented Interfaces:
- IAbstractView
- Direct Known Subclasses:
- PSTAxesView, PSTClassicalView, PSTGridView, PSTGroupView, PSTPictureView, PSTTextView
abstract class PSTShapeView<S extends IShape>
- extends AbstractCodeView<S>
Defines a PSTricks view of the LShape 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/15/2008
- Since:
- 3.0
- Author:
- Arnaud BLOUIN
Field Summary |
protected java.util.Set<java.lang.String> |
coloursName
The list of name of the colours added to the generated code. |
Constructor Summary |
protected |
PSTShapeView(S model)
Creates and initialises an abstract PSTricks view. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
coloursName
protected java.util.Set<java.lang.String> coloursName
- The list of name of the colours added to the generated code. Useful when generating
the code to define the colours in the latex document.
PSTShapeView
protected PSTShapeView(S model)
- Creates and initialises an abstract PSTricks view.
- Parameters:
model
- The model to view.
- Throws:
java.lang.IllegalArgumentException
- If the given model is not valid.- Since:
- 3.0
addColour
protected void addColour(java.lang.String name)
- Saves a colour coming from the generated code.
- Parameters:
name
- The name of the generated colour.- Since:
- 3.0
update
public void update()
- Description copied from interface:
IAbstractView
- Updates the view.
updateCache
public abstract void updateCache(IPoint origin,
float ppc)
- Updates the cache.
- Parameters:
origin
- The origin point of the PST drawing.ppc
- The number of point per centimetre.- Since:
- 3.0
getArrowsParametersCode
protected java.lang.StringBuilder getArrowsParametersCode()
- Returns:
- The PST code corresponding to the arrow parameters of the shape. Or null if no arrow.
- Since:
- 3.0
getArrowParametersCode
private java.lang.StringBuilder getArrowParametersCode(IArrow arrow)
- Returns:
- The PST code corresponding to the parameter of the style of the given arrow. The style of the
given arrow must not be NONE.
getArrowsStyleCode
protected java.lang.StringBuilder getArrowsStyleCode()
- Returns:
- The PST code corresponding to the style of the arrows (e.g. {|->}).
- Since:
- 3.0
getShowPointsCode
protected java.lang.StringBuilder getShowPointsCode()
- Returns:
- The PSTricks code of the show-points option or null.
- Since:
- 3.0
getRotationHeaderCode
protected java.lang.StringBuilder getRotationHeaderCode(float ppc,
IPoint position)
- Parameters:
ppc
- The number of pixels per centimetre.position
- The reference point of the PSTricks drawing.
- Returns:
- The header of the PSTricks rotation code.
- Since:
- 3.0
getColourName
protected java.lang.String getColourName(java.awt.Color colour)
- Parameters:
colour
- The colour which name is looking for. If the colour does
not exist yet, it is created.
- Returns:
- The name of a predefined or a newly generated colour.
- Since:
- 3.0
getDoubleBorderCode
protected java.lang.StringBuilder getDoubleBorderCode(float ppc)
- Parameters:
ppc
- The number of pixels per centimetre.
- Returns:
- The PSTricks code of the double border of the shape.
- Since:
- 3.0
getBorderPositionCode
protected java.lang.StringBuilder getBorderPositionCode()
- Returns:
- The PSTricks code of the border position.
- Since:
- 3.0
getLineCode
protected java.lang.StringBuilder getLineCode(float ppc)
- Parameters:
ppc
- The number of pixels per centimetre.
- Returns:
- The PSTricks code of the line style.
- Since:
- 1.7
getFillingPlain
private java.lang.StringBuilder getFillingPlain()
- Returns:
- The PST code of the filling with parameter "plain".
- Since:
- 3.0
getFillingGrad
private java.lang.StringBuilder getFillingGrad()
- Returns:
- The PST code of the filling with parameter "gradient".
- Since:
- 3.0
getFillingHatchings
private java.lang.StringBuilder getFillingHatchings(float ppc)
- Returns:
- The PST code of the filling with parameter "hlines" or "vlines" etc.
- Since:
- 3.0
getFillingCode
protected java.lang.StringBuilder getFillingCode(float ppc)
- Parameters:
ppc
- The number of pixels per centimetre.
- Returns:
- The PSTricks code for the filling of the shape. Null if there is no filling.
- Since:
- 1.7
getShadowCode
protected java.lang.StringBuilder getShadowCode(float ppc)
- Parameters:
ppc
- The number of pixels per centimetre.
- Returns:
- The code of the shape shadow or null if there is no shadow.
- Since:
- 3.0