|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.glib.views.AbstractView<S>
net.sf.latexdraw.glib.views.Java2D.impl.LShapeView<IText>
net.sf.latexdraw.glib.views.Java2D.impl.LTextView
class LTextView
Defines a view of the IText 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.
05/23/2010
Field Summary | |
---|---|
static java.awt.Font |
FONT
|
static java.awt.FontMetrics |
FONT_METRICS
|
protected java.awt.Image |
image
The picture. |
private java.awt.Color |
lastColour
Used to detect if the last version of the text is different from the view. |
private java.lang.String |
lastText
Used to detect if the last version of the text is different from the view. |
private IText.TextPosition |
lastTextPos
Used to detect if the last version of the text is different from the view. |
protected java.lang.String |
log
The log of the compilation. |
private java.lang.String |
pathPic
The path of the files: for instance on Unix is can be /tmp/latexdraw180980 (without any extension). |
protected static double |
SCALE_IMAGE
A ratio used to create bigger thumbnails to improve the quality of the displayed image. |
Fields inherited from class net.sf.latexdraw.glib.views.Java2D.impl.LShapeView |
---|
arrows, border, path |
Fields inherited from class net.sf.latexdraw.glib.views.AbstractView |
---|
shape |
Constructor Summary | |
---|---|
protected |
LTextView(IText model)
Creates and initialises a text view. |
Method Summary | |
---|---|
boolean |
contains(double x,
double y)
Tests if the given point is into the pickable object. |
private java.awt.Image |
createImage()
|
private boolean |
execute(java.lang.String[] cmd)
Executes a given command and returns the log. |
protected void |
finalize()
|
void |
flush()
Removes and flushes the used resources and temporary documents. |
protected void |
flushPictures()
Flushes the pictures of the text and all the related resources. |
java.awt.Image |
getImage()
|
java.lang.String |
getLaTeXDocument()
|
java.lang.String |
getLatexErrorMessageFromLog()
|
private IPoint |
getTextPositionImage()
|
private IPoint |
getTextPositionText()
|
java.lang.String |
getToolTip()
|
boolean |
intersects(java.awt.geom.Rectangle2D rec)
|
boolean |
isToolTipVisible(double x,
double y)
Tests if a tooltip can be displayed. |
void |
paint(java.awt.Graphics2D g)
Draws the shape within a Java2D graphics. |
void |
update()
Updates the view. |
void |
updateBorder()
Update the border of the shape view. |
protected void |
updateDblePathInside()
Updates the borders of the double boundary when position is inside. |
protected void |
updateDblePathMiddle()
Updates the borders of the double boundary when position is middle. |
protected void |
updateDblePathOutside()
Updates the borders of the double boundary when position is outside. |
protected void |
updateGeneralPathInside()
Updates the borders of the shape as inside borders. |
protected void |
updateGeneralPathMiddle()
Updates the borders of the shape as middle borders. |
protected void |
updateGeneralPathOutside()
Updates the borders of the shape as outside borders. |
void |
updateImage()
Updates the image. |
Methods inherited from class net.sf.latexdraw.glib.views.Java2D.impl.LShapeView |
---|
beginRotation, contains, endRotation, getBorder, getPath, getPicker, getRotatedShape2D, getRotatedShape2D, getStroke, getStrokeThickness, paintArrows, paintBorders, paintFilling, paintShadow, paintShowPointsDots, paintShowPointsLines, updatePath, updatePathArrows |
Methods inherited from class net.sf.latexdraw.glib.views.AbstractView |
---|
getShape |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.latexdraw.glib.views.Java2D.interfaces.IViewShape |
---|
contains, getBorder, getPath, getRotatedShape2D, getStroke, paintBorders, paintFilling, paintShadow, paintShowPointsDots, paintShowPointsLines, updatePath |
Methods inherited from interface net.sf.latexdraw.glib.views.IAbstractView |
---|
getShape |
Methods inherited from interface org.malai.picking.Pickable |
---|
getPicker |
Field Detail |
---|
protected java.awt.Image image
protected java.lang.String log
private java.lang.String pathPic
private java.lang.String lastText
private java.awt.Color lastColour
private IText.TextPosition lastTextPos
public static final java.awt.Font FONT
public static final java.awt.FontMetrics FONT_METRICS
protected static final double SCALE_IMAGE
Constructor Detail |
---|
protected LTextView(IText model)
model
- The model to view.
java.lang.IllegalArgumentException
- If the given model is null.Method Detail |
---|
public void update()
IAbstractView
update
in interface IAbstractView
update
in class LShapeView<IText>
protected void finalize()
finalize
in class java.lang.Object
public void flush()
IViewShape
flush
in interface IViewShape
flush
in class LShapeView<IText>
protected void flushPictures()
public void updateImage()
IViewText
updateImage
in interface IViewText
public java.awt.Image getImage()
getImage
in interface IViewText
private java.awt.Image createImage()
public java.lang.String getLatexErrorMessageFromLog()
getLatexErrorMessageFromLog
in interface IViewText
private boolean execute(java.lang.String[] cmd)
cmd
- The command to execute.
public java.lang.String getLaTeXDocument()
getLaTeXDocument
in interface IViewText
public boolean intersects(java.awt.geom.Rectangle2D rec)
intersects
in interface IViewShape
intersects
in class LShapeView<IText>
rec
- The rectangle used to check the intersection.
public boolean contains(double x, double y)
Pickable
contains
in interface IViewShape
contains
in interface Pickable
contains
in class LShapeView<IText>
x
- The x-coordinate of the point to test.y
- The y-coordinate of the point to test.
private IPoint getTextPositionImage()
private IPoint getTextPositionText()
public void paint(java.awt.Graphics2D g)
IViewShape
paint
in interface IViewShape
paint
in class LShapeView<IText>
g
- The graphics where the shape must be drawn.public void updateBorder()
IViewShape
updateBorder
in interface IViewShape
updateBorder
in class LShapeView<IText>
protected void updateDblePathInside()
LShapeView
updateDblePathInside
in class LShapeView<IText>
protected void updateDblePathMiddle()
LShapeView
updateDblePathMiddle
in class LShapeView<IText>
protected void updateDblePathOutside()
LShapeView
updateDblePathOutside
in class LShapeView<IText>
protected void updateGeneralPathInside()
LShapeView
updateGeneralPathInside
in class LShapeView<IText>
protected void updateGeneralPathMiddle()
LShapeView
updateGeneralPathMiddle
in class LShapeView<IText>
protected void updateGeneralPathOutside()
LShapeView
updateGeneralPathOutside
in class LShapeView<IText>
public boolean isToolTipVisible(double x, double y)
ToolTipable
isToolTipVisible
in interface ToolTipable
x
- The X-coordinate to test.y
- The Y-coordinate to test.
public java.lang.String getToolTip()
getToolTip
in interface ToolTipable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |