http://www.jpicedt.org

jpicedt.graphic.model
Class TextEditable

java.lang.Object
  extended by jpicedt.graphic.model.AbstractElement
      extended by jpicedt.graphic.model.TextEditable
All Implemented Interfaces:
Element, ActionFactory
Direct Known Subclasses:
PicText

public abstract class TextEditable
extends AbstractElement

An abstract class for Element's that have a textual representation, and [pending:removed as of 1.3.2] whose text can be graphically edited

Since:
jPicEdt 1.3.1
Version:
$Id: TextEditable.java,v 1.20 2013/03/27 07:00:58 vincentb1 Exp $
Author:
Sylvain Reynal

Field Summary
static int FIRST_PT
           
static int LAST_PT
           
static int P_ANCHOR
           
protected  PicPoint ptAnchor
          anchor point
protected  String textString
          string argument
 
Fields inherited from class jpicedt.graphic.model.AbstractElement
attributeSet, name, parent, view
 
Constructor Summary
protected TextEditable(String textString, PicPoint anchorPoint)
          Construct a new TextEditable with the given content and a default attribute set
protected TextEditable(String textString, PicPoint anchorPoint, PicAttributeSet set)
          Construct a new TextEditable with the given content and attribute set
protected TextEditable(TextEditable e)
          Construct a clone of the given TextEditable
 
Method Summary
 PicPoint getCtrlPt(int numPoint, PicPoint dest)
          Return the user-controlled point having the given index.
 CtrlPtSubset getCtrlPtSubset(ConvexZoneGroup csg, BitSet czExtension)
          Renvoie un la partie des points de contrôle qui satisfont à l'un des deux critères suivants: ceux compris dans l'ensemble de zones convexes csg, et ceux en relation avec les points de contrôle satisfaisant au première critère selon une relation définies par czExtension
 int getFirstPointIndex()
          Returns the index of the first user-controlled point that can be retrieved by getCtrlPt().
 int getLastPointIndex()
          Returns the index of the last user-controlled point that can be retrieved by getCtrlPt().
 String getText()
          Return the string argument (e.g of the corresponding \\makebox{} command)
 String getText(boolean mode)
          Return the string argument (e.g of the corresponding \\makebox{} command)
<T> void
setAttribute(PicAttributeName<T> name, T value)
          Set the given attribute name to the given value for this AbstractElement
 void setText(String str)
          Set the string argument (e.g. of the \\makebox{} command)
 
Methods inherited from class jpicedt.graphic.model.AbstractElement
anchorPointsIterator, clone, createActions, createShape, fireChangedUpdate, getAttribute, getAttributeSet, getDefaultName, getDrawing, getName, getParent, getView, pullOutOfGroup, removeView, replaceBy, scale, scale, scale, setAttributeSet, setCtrlPt, setName, setParent, setViewFromFactory, shear, syncArrowGeometry, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jpicedt.graphic.model.Element
getBoundingBox, mirror, rotate, scale, setCtrlPt, shear, translate
 

Field Detail

FIRST_PT

public static final int FIRST_PT
See Also:
Constant Field Values

P_ANCHOR

public static final int P_ANCHOR
See Also:
Constant Field Values

LAST_PT

public static final int LAST_PT
See Also:
Constant Field Values

ptAnchor

protected PicPoint ptAnchor
anchor point


textString

protected String textString
string argument

Constructor Detail

TextEditable

protected TextEditable(String textString,
                       PicPoint anchorPoint,
                       PicAttributeSet set)
Construct a new TextEditable with the given content and attribute set


TextEditable

protected TextEditable(String textString,
                       PicPoint anchorPoint)
Construct a new TextEditable with the given content and a default attribute set


TextEditable

protected TextEditable(TextEditable e)
Construct a clone of the given TextEditable

Method Detail

setAttribute

public <T> void setAttribute(PicAttributeName<T> name,
                             T value)
Set the given attribute name to the given value for this AbstractElement

Specified by:
setAttribute in interface Element
Overrides:
setAttribute in class AbstractElement

getFirstPointIndex

public int getFirstPointIndex()
Returns the index of the first user-controlled point that can be retrieved by getCtrlPt(). This default implementation returns 0.


getLastPointIndex

public int getLastPointIndex()
Returns the index of the last user-controlled point that can be retrieved by getCtrlPt(). This default implementation returns the number of specification points minus one.


getCtrlPt

public PicPoint getCtrlPt(int numPoint,
                          PicPoint dest)
Description copied from interface: Element
Return the user-controlled point having the given index. The general contract is to return an IMMUTABLE instance of PicPoint, so that the only way to alter the geometry of this element is by calling the setPoint method.

Parameters:
numPoint - the point index, should be greater or equal to the value returned by getFirstPointIndex, and lower or equal to getLastPointIndex.
Returns:
the point indexed by index ; if dest is null, concrete implementation of this method should allocate a new PicPoint and return it, otherwise directly modify dest and return it as well for convenience.

getText

public String getText(boolean mode)
Return the string argument (e.g of the corresponding \\makebox{} command)

Parameters:
mode - the textmode

getText

public String getText()
Return the string argument (e.g of the corresponding \\makebox{} command)


setText

public void setText(String str)
Set the string argument (e.g. of the \\makebox{} command)


getCtrlPtSubset

public CtrlPtSubset getCtrlPtSubset(ConvexZoneGroup csg,
                                    BitSet czExtension)
Description copied from interface: Element
Renvoie un la partie des points de contrôle qui satisfont à l'un des deux critères suivants:
  1. ceux compris dans l'ensemble de zones convexes csg, et
  2. ceux en relation avec les points de contrôle satisfaisant au première critère selon une relation définies par czExtension

Specified by:
getCtrlPtSubset in interface Element
Overrides:
getCtrlPtSubset in class AbstractElement
Parameters:
csg - l'ensemble de zones convexes dont on teste qu'il contient le point d'ancrage du texte.
czExtension - ignoré
Returns:
null si le point d'ancrage du texte n'est pas dans l'ensemble de zones convexes csg, un CtrlPtSubsetPlain de this sinon.
Since:
jPicEdt 1.6
See Also:
jpicedt.graphic.model

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org