|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpicedt.graphic.model.AbstractElement jpicedt.graphic.model.TextEditable jpicedt.graphic.model.PicText
public class PicText
Textual elements, possibly surrounded by a box (currently, only rectangular, oval and circular shapes are supported). The box size is computed from the text size (ie aka LaTeX's \\framebox command with no width/height argument).
Nested Class Summary | |
---|---|
static class |
PicText.FrameStyle
An enum for allowed values for frame-box styles |
static class |
PicText.HorAlign
An enum for allowed values for horizontal text alignment |
static class |
PicText.TextIcon
An enum for the text display options TEXT_MODE In this mode the value of text is
used for display. |
static class |
PicText.TextMode
An enum for the different text-modes |
class |
PicText.TextNodeConnectionManager
|
static class |
PicText.VertAlign
An enum for allowed values for vertical text alignment |
Field Summary | |
---|---|
protected boolean |
areaSet
|
protected double |
depth
|
protected Shape |
frame
|
protected double |
frameSep
|
protected double |
height
|
protected PicText.TextNodeConnectionManager |
nodeConnectionManager
|
protected double |
nodeSep
|
protected double |
width
dimensions (in latex sense) of the latex box (this does not include frame) |
Fields inherited from class jpicedt.graphic.model.TextEditable |
---|
FIRST_PT, LAST_PT, P_ANCHOR, ptAnchor, textString |
Fields inherited from class jpicedt.graphic.model.AbstractElement |
---|
attributeSet, name, parent, view |
Constructor Summary | |
---|---|
PicText()
Creates a PicText object with a default attribute set, and the following default values : empty string, no frame, bottom-left alignment. |
|
PicText(PicAttributeSet set)
Creates a PicText object with the following default values : empty string, frame and alignment according to the attribute set and anchor point at (0,0) |
|
PicText(PicPoint ptA,
PicAttributeSet set)
Creates a PicText object with the following default values : empty string, frame and alignment according to the attribute set |
|
PicText(PicPoint ptA,
String textString,
PicAttributeSet set)
Create a new PicText object with the whole bunch of parameters ! |
|
PicText(PicText text)
cloning constructor |
Method Summary | |
---|---|
PicText |
clone()
Override Object.clone() method |
AbstractCustomizer |
createCustomizer()
Return a Customizer for geometry editing |
protected void |
fireChangedUpdate(DrawingEvent.EventType eventType)
Overriden in order to support forwarding to node connections. |
boolean |
getAreaMode()
|
boolean |
getAreaSet()
|
double |
getBaseLineY()
Return y-coordinate of baseline |
double |
getBottomY()
Return y-coordinate of bottom boundary of text only |
Rectangle2D |
getBoundingBox(Rectangle2D r)
Returns the bounding box (i.e. the surrounding rectangle) in double precision Used e.g. to determine the arguments of a \\begin{picture} command. |
double |
getCenterX()
Return x-coordinate of center of text only |
double |
getCenterY()
Return y-coordinate of center of text only |
String |
getDefaultName()
Return a string that represents this object's name |
double |
getDepth()
Return the depth of text only |
double |
getFrameBaseLineY()
Return y-coordinate of baseline |
double |
getFrameBottomY()
Return y-coordinate of bottom boundary |
double |
getFrameCenterX()
Return x-coordinate of center |
double |
getFrameCenterY()
Return y-coordinate of center |
double |
getFrameDepth()
Return the depth of the text including frame |
double |
getFrameHeight()
Return the height of the text including frame |
double |
getFrameLeftX()
Return x-coordinate of left boundary, including frame |
double |
getFrameRightX()
Return x-coordinate of right boundary |
double |
getFrameTopY()
Return y-coordinate of top boundary |
PicText.FrameStyle |
getFrameType()
Set the frame type |
double |
getFrameWidth()
Return the width of the text including frame |
double |
getHeight()
Return the height of text only |
PicText.HorAlign |
getHorAlign()
Return horizontal alignment (see constant fields above) |
double |
getLeftX()
Return x-coordinate of left boundary of text only |
NodeConnectionManager |
getNodeConnectionManager()
|
double |
getRightX()
Return x-coordinate of right boundary of text only |
Shape |
getShapeOfFrame()
Returns the frame that surrounds the text, ignoring rotation (the view will rotate it) |
boolean |
getTextMode()
Return the textmode only |
double |
getTopY()
Return y-coordinate of top boundary of text only |
PicText.VertAlign |
getVertAlign()
Return vertical alignement (see static constant above) |
double |
getWidth()
Return the width of text only |
boolean |
isFramed()
Return TRUE if the box has to be drawn |
void |
mirror(PicPoint ptOrg,
PicVector normalVector)
Effectue une réflexion sur this relativement à l'axe
défini par ptOrg et normalVector . |
void |
rotate(PicPoint ptOrg,
double angle)
Rotate this Element by the given angle along the given point |
void |
scale(double ptOrgX,
double ptOrgY,
double sx,
double sy,
UserConfirmationCache ucc)
Scale this object by (sx,sy) using (ptOrgX,ptOrgY) as the origin. |
void |
setAreaMode(boolean b)
|
void |
setCtrlPt(int index,
PicPoint pt,
EditPointConstraint constraint)
Set the user-controlled point indexed by "index" to the given value, using the specified geometrical constraint. |
void |
setDimensions(double w,
double h,
double d)
set the width, height, and depth (of the text box, without frame). |
void |
setFrameType(PicText.FrameStyle frameType)
Set the type of frame to be put around the text. |
void |
setHorAlign(PicText.HorAlign horAlign)
Set the horizontal alignment (see constant fields above) |
void |
setTextIcon(PicText.TextIcon textIcon)
|
void |
setTextMode(boolean mode)
Set the textmode and updates the text |
void |
setTextMode(PicText.TextMode textMode)
|
void |
setVertAlign(PicText.VertAlign vertAlign)
set the vertical alignement (see constant fields above) |
void |
shear(PicPoint ptOrg,
double shx,
double shy,
UserConfirmationCache ucc)
Shear this Element by the given params wrt to the given origin |
String |
toString()
Returns a String representation of the attribute set for this AbstractElement |
void |
translate(double dx,
double dy)
Translate this Element by (dx,dy) ; this implementation translates the specification-points, then fires a changed-update event. |
void |
updateFrame()
First computes frame dimensions (frameWidth, etc). |
Methods inherited from class jpicedt.graphic.model.TextEditable |
---|
getCtrlPt, getCtrlPtSubset, getFirstPointIndex, getLastPointIndex, getText, getText, setAttribute, setText |
Methods inherited from class jpicedt.graphic.model.AbstractElement |
---|
anchorPointsIterator, createActions, createShape, getAttribute, getAttributeSet, getDrawing, getName, getParent, getView, pullOutOfGroup, removeView, replaceBy, scale, scale, scale, setAttributeSet, setCtrlPt, setName, setParent, setViewFromFactory, shear, syncArrowGeometry |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jpicedt.graphic.model.Element |
---|
anchorPointsIterator, createShape, getAttribute, getAttributeSet, getCtrlPt, getCtrlPtSubset, getDrawing, getFirstPointIndex, getLastPointIndex, getName, getParent, getView, removeView, replaceBy, scale, scale, scale, setAttribute, setAttributeSet, setCtrlPt, setParent, setViewFromFactory, shear, syncArrowGeometry |
Field Detail |
---|
protected double width
protected double height
protected double depth
protected boolean areaSet
protected Shape frame
protected double frameSep
protected double nodeSep
protected PicText.TextNodeConnectionManager nodeConnectionManager
Constructor Detail |
---|
public PicText(PicPoint ptA, String textString, PicAttributeSet set)
ptA
- Anchor point (see setHorAlign() and setVertAlign() for details)textString
- the text contentpublic PicText(PicPoint ptA, PicAttributeSet set)
public PicText(PicAttributeSet set)
public PicText()
public PicText(PicText text)
Method Detail |
---|
public PicText clone()
clone
in interface Element
clone
in class AbstractElement
public String getDefaultName()
getDefaultName
in class AbstractElement
public Rectangle2D getBoundingBox(Rectangle2D r)
This implementation compute the bb from the smallest rectangle that encompasses all specification-points.
getBoundingBox
in interface Element
public void setCtrlPt(int index, PicPoint pt, EditPointConstraint constraint)
Element
setCtrlPt
in interface Element
constraint
- a geometry constraint, or null if no particular constraint is being imposed (aka default).protected void fireChangedUpdate(DrawingEvent.EventType eventType)
fireChangedUpdate
in class AbstractElement
eventType
- the event typepublic void translate(double dx, double dy)
translate
in interface Element
dx
- The X coordinate of translation vectordy
- The Y coordinate of translation vectorpublic void scale(double ptOrgX, double ptOrgY, double sx, double sy, UserConfirmationCache ucc)
(sx,sy)
using (ptOrgX,ptOrgY)
as the origin. This
implementation simply apply a scaling transform to all specification-points. Note that sx
and sy
may be negative. This method eventually fires a changed-update event.
scale
in interface Element
ucc
- une valeur UserConfirmationCache
permettant de demander à l'utilisateur
confirmation, de se souvenir de la dernière confirmation qu'il a donné, ou de ses préférences.public void rotate(PicPoint ptOrg, double angle)
rotate
in interface Element
angle
- rotation angle in radianspublic void mirror(PicPoint ptOrg, PicVector normalVector)
this
relativement à l'axe
défini par ptOrg
et normalVector
.
mirror
in interface Element
ptOrg
- le PicPoint
par lequel passe l'axe de réflexion.normalVector
- le PicVector
normal à l'axe de réflexion.public void shear(PicPoint ptOrg, double shx, double shy, UserConfirmationCache ucc)
shear
in interface Element
ucc
- une valeur UserConfirmationCache
permettant de demander à l'utilisateur
confirmation, de se souvenir de la dernière confirmation qu'il a donné, ou de ses préférences.public void setTextMode(PicText.TextMode textMode)
public void setTextIcon(PicText.TextIcon textIcon)
public PicText.HorAlign getHorAlign()
public void setHorAlign(PicText.HorAlign horAlign)
public PicText.VertAlign getVertAlign()
public void setVertAlign(PicText.VertAlign vertAlign)
public boolean isFramed()
public void setFrameType(PicText.FrameStyle frameType)
public PicText.FrameStyle getFrameType()
public Shape getShapeOfFrame()
public void updateFrame()
public boolean getTextMode()
public void setTextMode(boolean mode)
public void setAreaMode(boolean b)
public boolean getAreaSet()
public boolean getAreaMode()
public double getWidth()
public double getHeight()
public double getDepth()
public double getLeftX()
public double getRightX()
public double getCenterX()
public double getBottomY()
public double getTopY()
public double getBaseLineY()
public double getCenterY()
public double getFrameWidth()
public double getFrameHeight()
public double getFrameDepth()
public double getFrameLeftX()
public double getFrameRightX()
public double getFrameCenterX()
public double getFrameTopY()
public double getFrameBottomY()
public double getFrameBaseLineY()
public double getFrameCenterY()
public void setDimensions(double w, double h, double d)
public NodeConnectionManager getNodeConnectionManager()
getNodeConnectionManager
in interface NodeableElement
public String toString()
AbstractElement
String
representation of the attribute set for this AbstractElement
toString
in class AbstractElement
public AbstractCustomizer createCustomizer()
createCustomizer
in interface CustomizerFactory
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |