public class DefaultViewFactory.TextViewHybrid extends DefaultViewFactory.LeafElementView implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected boolean |
areDimensionsComputed |
protected int |
fileDPI |
protected java.awt.image.BufferedImage |
image |
protected double |
strx |
protected double |
stry |
protected java.awt.geom.AffineTransform |
text2ModelTr |
protected java.awt.font.TextLayout |
textLayout |
interiorPaint, lineWidth, outlinePaint, outlineStroke, overStrikeWidth, shadowBounds, shape
bounds, element, highlighter
BARBELL_SIZE, CLICK_DISTANCE
Constructor and Description |
---|
DefaultViewFactory.TextViewHybrid(PicText te)
construct a new View for the given PicRectangle
|
Modifier and Type | Method and Description |
---|---|
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(java.io.BufferedReader reader,
PicText text) |
protected double |
getRotation()
Returns the text rotation in radians : subclassers that don't support rotating text may return 0 here.
|
java.awt.font.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.
|
java.awt.geom.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(java.awt.Graphics2D g,
java.awt.geom.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
|
getViewFactory, syncAttributes
getBounds, getContainer, getDrawing, getElement, getGraphics, getHighlighter, getParentView, hitTest, paintHighlighter, repaint, setElement, setHighlighter
protected double strx
protected double stry
protected java.awt.font.TextLayout textLayout
protected java.awt.geom.AffineTransform text2ModelTr
protected java.awt.image.BufferedImage image
protected boolean areDimensionsComputed
protected int fileDPI
public DefaultViewFactory.TextViewHybrid(PicText te)
protected double getRotation()
public void changedUpdate(DrawingEvent.EventType eventType)
changedUpdate
in interface View
changedUpdate
in class DefaultViewFactory.LeafElementView
public void run()
run
in interface java.lang.Runnable
protected void syncStringLocation()
protected void syncShape()
syncShape
in class DefaultViewFactory.LeafElementView
protected void syncFrame()
protected void getDimensionsFromLogFile(java.io.BufferedReader reader, PicText text)
protected void syncBounds()
syncBounds
in class DefaultViewFactory.LeafElementView
public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D a)
paint
in interface View
paint
in class DefaultViewFactory.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 DefaultViewFactory.LeafElementView
public java.awt.font.TextLayout getTextLayout()
public java.awt.geom.AffineTransform getTextToModelTransform()
Submit a bug : syd@jpicedt.org