|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpicedt.graphic.view.AbstractView jpicedt.graphic.view.LeafElementView jpicedt.graphic.view.TextViewHybrid
public class TextViewHybrid
a View for rendering Text's based on bitmaps (when available) or TextLayout (when image not available)
Field Summary | |
---|---|
protected boolean |
areDimensionsComputed
|
protected int |
fileDPI
|
protected BufferedImage |
image
|
protected double |
strx
|
protected double |
stry
|
protected AffineTransform |
text2ModelTr
|
protected TextLayout |
textLayout
|
Fields inherited from class jpicedt.graphic.view.LeafElementView |
---|
attrFactory, interiorPaint, leftArrow, outlinePaint, outlineStroke, overstrikeStroke, rightArrow, shadow, shadowPaint, shape |
Fields inherited from class jpicedt.graphic.view.AbstractView |
---|
bounds, element, highlighter |
Constructor Summary | |
---|---|
TextViewHybrid(PicText te,
AttributesViewFactory f)
construct a new View for the given PicRectangle |
Method Summary | |
---|---|
void |
changedUpdate(DrawingEvent.EventType eventType)
Give notification from the model that a change occured to the text this view is responsible for rendering. |
protected void |
getDimensionsFromLogFile(BufferedReader reader,
PicText text)
|
PicText |
getElement()
Returns the element the View is responsible for rendering |
protected double |
getRotation()
Returns the text rotation in radians : subclassers that don't support rotating text may return 0 here. |
TextLayout |
getTextLayout()
[SR:pending] make this view implement aka TextEditableView interface (or something like it), where TextEditableView is a subinterface of View with text-editing specific capabilities. |
AffineTransform |
getTextToModelTransform()
Return an affine transform which translat b/w the TextLayout coordinate system and the jpicedt.graphic.model coordinate system. |
HitInfo |
hitTest(PEMouseEvent e)
This implementation calls super.hitTest and returns the result if non-null
(this should be a HitInfo.Point),
then returns a HitInfo.Interior if the mouse-click occured inside the text bound (as defined
by text layout) |
void |
paint(Graphics2D g,
Rectangle2D a)
Render the View to the given graphic context. |
void |
run()
|
protected void |
syncBounds()
Synchronizes bounding box with the model ; |
protected void |
syncFrame()
synchronize frame shape and location (TextLayout only) ; this is called by syncShape(), so that subclasser might override easily when only rectangular shapes are availables. |
protected void |
syncShape()
Synchronize the textLayout and the shape (=frame box, by calling syncFrame) with the model When TextLayout is used, this
delegates to getRotation() where computing rotation angle
is concerned, and updates the AffineTransform returned by
getTextToModelTransform() . |
protected void |
syncStringLocation()
update strx stry = location of TextLayout's bottom-Left corner with respect to PicText's anchor-point |
Methods inherited from class jpicedt.graphic.view.LeafElementView |
---|
intersect, syncArrowsAttributes, syncArrowsGeometry, syncAttributes, syncShadow |
Methods inherited from class jpicedt.graphic.view.AbstractView |
---|
getBounds, getContainer, getDrawing, getGraphics, getHighlighter, getParentView, getViewFactory, hitTest, intersect, paintHighlighter, repaint, setElement, setHighlighter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double strx
protected double stry
protected TextLayout textLayout
protected AffineTransform text2ModelTr
protected BufferedImage image
protected boolean areDimensionsComputed
protected int fileDPI
Constructor Detail |
---|
public TextViewHybrid(PicText te, AttributesViewFactory f)
Method Detail |
---|
public PicText getElement()
View
getElement
in interface View
getElement
in class AbstractView
protected double getRotation()
public void changedUpdate(DrawingEvent.EventType eventType)
changedUpdate
in interface View
changedUpdate
in class LeafElementView
public void run()
run
in interface Runnable
protected void syncStringLocation()
protected void syncShape()
TextLayout
is used, this
delegates to getRotation()
where computing rotation angle
is concerned, and updates the AffineTransform returned by
getTextToModelTransform()
.
syncShape
in class LeafElementView
protected void syncFrame()
protected void getDimensionsFromLogFile(BufferedReader reader, PicText text)
protected void syncBounds()
syncBounds
in class LeafElementView
public void paint(Graphics2D g, Rectangle2D a)
paint
in interface View
paint
in class LeafElementView
a
- the current graphic clippublic HitInfo hitTest(PEMouseEvent e)
super.hitTest
and returns the result if non-null
(this should be a HitInfo.Point),
then returns a HitInfo.Interior if the mouse-click occured inside the text bound (as defined
by text layout)
hitTest
in class LeafElementView
public TextLayout getTextLayout()
public AffineTransform getTextToModelTransform()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |