Class FFrame
java.lang.Object
org.gvsig.app.project.documents.layout.fframes.FFrame
- All Implemented Interfaces:
Cloneable,IFFrame,org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable,org.gvsig.tools.dispose.Disposable,org.gvsig.tools.lang.Cloneable,org.gvsig.tools.observer.Observable,org.gvsig.tools.persistence.Persistent
- Direct Known Subclasses:
AbstractFFrameViewDependence,FFrameBasic,FFrameGraphics,FFrameMapBox,FFramePicture,FFrameText,FFrameView
Class implementing the IFFrame interface, that will be extended by all the
FFrames. It provides default methods useful for all fframes and abstract
methods to be implemented by them.
- Author:
- Vicente Caballero Navarro, Cesar Martinez Izquierdo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Rectangleprotected FrameFactorystatic Imagestatic Imageprotected AffineTransformprotected LayoutManagerprotected static final org.slf4j.Loggerprotected Rectangle2D.Doubleprotected intprotected Rectangleprotected Rectangleprotected Rectangleprotected intprotected Rectangleprotected org.gvsig.tools.observer.ObservableHelperstatic final Stringprotected Rectangleprotected Rectangleprotected Rectangle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(org.gvsig.tools.observer.Observer o) clone()booleanDevuelve true, si el punto que se pasa como par�metro esta contenido dentro del boundingbox del fframe.voiddeleteObserver(org.gvsig.tools.observer.Observer o) voidvoiddispose()protected voiddoSetSelected(int selectedStatus) abstract voiddraw(Graphics2D g, AffineTransform at, Rectangle2D r, BufferedImage imgBase) Draws the FFrame on the provided Graphics, according to the provided affine transform and the visible rectangle.voidDibuja sobre el graphics el rect�ngulo del fframe en modo borrador.voidDraws the FFrame rectangle on the provided Graphics2D, only showing the FFrame name on an empty rectangle.voidDibuja los handlers sobre el boundingBox en el graphics que se pasa como par�metro.voidDibuja sobre el graphics que se pasa como par�metro el icono que representa que contiene un tag.voidThis method is called when the FFrame has been added to the LayoutvoidThis method is called when the FFrame has been removed from the LayoutReturns the bounding box in centimeters of this FFrame, using paper coordinatesReturns the bounding box (in pixels) of this FFrame, based on the provided AffineTransform.intChecks whether the provided point is contained within the FFrame rectangle.org.gvsig.app.project.documents.DocumentDevuelve el rect�ngulo que representa el �ltimo generado al desplazar o modificar el tama�o del fframe.intgetLevel()Devuelve el nivel en el que se encuentra el FFrame.Devuelve el Cursor adecuado seg�n como est� contenido el punto, si es para desplazamiento, o cambio de tama�o.getMovieRect(int difx, int dify) Devuelve el rect�ngulo a partir del desplazamiento en el eje x y el desplazamiento en el eje y.getMovieRect(int difx, int dify, boolean prop) Devuelve el rectángulo a partir del desplazamiento en el eje x y el desplazamiento en el eje y.doubleGets the rotation of the frame, measured in arc degreesprotected AffineTransformGets the affine transform used to rotate the graphics when rotation is not 0intReturns an integer representing the type of selection applied to the FFrame.getTag()Devuelve el tag.protected Rectangle2DgetVisibleRect(Rectangle2D visibleLayoutDocRect, Rectangle2D frame) Gets the visible rectangle of the frame, taking rotation into consideration.static voidInitilizes the static iconsbooleanintersects(Rectangle2D rv, Rectangle2D r) Devuelve true si el rect�ngulo primero es null o si es distinto de null e intersecta.booleanGets the selection status of the framevoidloadFromState(org.gvsig.tools.persistence.PersistentState state) static voidvoidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidSets the bounding box in centimeters of this FFrame, using paper coordinates.voidsetDocument(org.gvsig.app.project.documents.Document document) voidvoidsetLayoutContext(LayoutContext layoutContext) voidsetLevel(int l) Inserta el nivel al que se encuentra el FFrame.voidsetNum(int i) Rellena con el n�mero de FFrame.voidsetRotation(double rotation) Sets the rotation of the frame, measured in arc degreesvoidsetSelected(boolean selected) Sets the selected status of the frame.voidsetSelected(Point2D p, MouseEvent e) Sets the type of selection performed on the frame, based on the position of the provided Point compared with the boundaries of the FFrame.voidRellena el tag del FFrame.voidupdateRect(Rectangle2D r, AffineTransform at) Actualiza el BoundBox del FFrame a partir de su rect�ngulo en pixels y la matriz de transformaci�n.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gvsig.app.project.documents.layout.fframes.IFFrame
getName, getNameFFrameMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable
print
-
Field Details
-
PERSISTENCE_DEFINITION_NAME
- See Also:
-
LOG
protected static final org.slf4j.Logger LOG -
m_BoundBox
-
lastAT
-
m_Selected
protected int m_Selected -
n
-
ne
-
e
-
se
-
s
-
so
-
o
-
no
-
num
protected int num -
frameFactory
-
iEResize
-
iNResize
-
layoutManager
-
observers
protected org.gvsig.tools.observer.ObservableHelper observers
-
-
Constructor Details
-
FFrame
public FFrame()
-
-
Method Details
-
drawHandlers
Dibuja los handlers sobre el boundingBox en el graphics que se pasa como par�metro.- Specified by:
drawHandlersin interfaceIFFrame- Parameters:
g- Graphics sobre el que dibujar.
-
setSelected
Sets the type of selection performed on the frame, based on the position of the provided Point compared with the boundaries of the FFrame. This method is usually called when the user clicks on the FFrame- Specified by:
setSelectedin interfaceIFFrame- Parameters:
p- Point which should be evaluated to establish if the FFrame must be selected or note- Mouse event that triggered this method call
-
updateRect
Actualiza el BoundBox del FFrame a partir de su rect�ngulo en pixels y la matriz de transformaci�n.- Specified by:
updateRectin interfaceIFFrame- Parameters:
r- Rect�ngulo.at- Matriz de transformaci�n.
-
getMovieRect
Devuelve el rect�ngulo a partir del desplazamiento en el eje x y el desplazamiento en el eje y.- Specified by:
getMovieRectin interfaceIFFrame- Parameters:
difx- desplazamiento sobre el eje x.dify- desplazamiento sobre el eje y.- Returns:
- rect�ngulo modificado en funci�n del desplazamiento realizado.
-
getMovieRect
Description copied from interface:IFFrameDevuelve el rectángulo a partir del desplazamiento en el eje x y el desplazamiento en el eje y.- Specified by:
getMovieRectin interfaceIFFrame- Parameters:
difx- desplazamiento sobre el eje x.dify- desplazamiento sobre el eje y.prop- true para un desplazamiento proporcional- Returns:
- rectángulo modificado en función del desplazamiento realizado.
-
getLastMoveRect
Devuelve el rect�ngulo que representa el �ltimo generado al desplazar o modificar el tama�o del fframe.- Specified by:
getLastMoveRectin interfaceIFFrame- Returns:
- Rectangle2D
-
getSelected
public int getSelected()Returns an integer representing the type of selection applied to the FFrame. Valid values are:IFFrame.NOSELECT,IFFrame.NO,IFFrame.N,IFFrame.NE,IFFrame.O,IFFrame.RECT,IFFrame.E,IFFrame.SO,IFFrame.S,IFFrame.SE.- Specified by:
getSelectedin interfaceIFFrame- Returns:
- The type of selection that has been applied
-
isSelected
public boolean isSelected()Gets the selection status of the frame- Specified by:
isSelectedin interfaceIFFrame- Returns:
trueif the frame is selected,falseotherwise
-
contains
Devuelve true, si el punto que se pasa como par�metro esta contenido dentro del boundingbox del fframe. -
getContains
Description copied from interface:IFFrameChecks whether the provided point is contained within the FFrame rectangle.- Specified by:
getContainsin interfaceIFFrame- Parameters:
p- Point to compare- Returns:
- An integer representing the topologic relation of the point and
the frame rectangle. It can be one of:
IFFrame.NOSELECT,IFFrame.NO,IFFrame.N,IFFrame.NE,IFFrame.O,IFFrame.RECT,IFFrame.E,IFFrame.SO,IFFrame.S,IFFrame.SE.
-
getMapCursor
Devuelve el Cursor adecuado seg�n como est� contenido el punto, si es para desplazamiento, o cambio de tama�o.- Specified by:
getMapCursorin interfaceIFFrame- Parameters:
p- punto a comprobar.- Returns:
- Cursor adecuado a la posici�n.
-
draw
Draws the FFrame on the provided Graphics, according to the provided affine transform and the visible rectangle. It has to to be implemented by each FFrame, as each of them usually draws diffently. -
getBoundingBox
Returns the bounding box (in pixels) of this FFrame, based on the provided AffineTransform. If the AffineTransform is null, it returns the last calculated bounding box.- Specified by:
getBoundingBoxin interfaceIFFrame- Parameters:
at- Affine transform to apply to the sheet coordinates to get the bounding box in pixels.- Returns:
- Rectangle representing the bounding box (in pixels) of this FFrame
-
setBoundBox
Sets the bounding box in centimeters of this FFrame, using paper coordinates.- Specified by:
setBoundBoxin interfaceIFFrame- Parameters:
r- Rectangle in centimeters
-
getBoundBox
Returns the bounding box in centimeters of this FFrame, using paper coordinates- Specified by:
getBoundBoxin interfaceIFFrame- Returns:
- The bounding box of this FFrame, measured in centimeters.
-
setSelected
public void setSelected(boolean selected) Sets the selected status of the frame.- Specified by:
setSelectedin interfaceIFFrame- Parameters:
selected-trueto select the frame,falseto unselect it
-
doSetSelected
protected void doSetSelected(int selectedStatus) -
drawDraft
Dibuja sobre el graphics el rect�ngulo del fframe en modo borrador. -
setNum
public void setNum(int i) Rellena con el n�mero de FFrame. -
drawEmpty
Draws the FFrame rectangle on the provided Graphics2D, only showing the FFrame name on an empty rectangle.- Parameters:
g- The graphics to draw on
-
intersects
Devuelve true si el rect�ngulo primero es null o si es distinto de null e intersecta.- Specified by:
intersectsin interfaceIFFrame- Parameters:
rv- Rect�ngulor- Rect�ngulo- Returns:
- True si intersecta o es null.
-
setTag
Rellena el tag del FFrame. -
getTag
Devuelve el tag. -
drawSymbolTag
Dibuja sobre el graphics que se pasa como par�metro el icono que representa que contiene un tag.- Specified by:
drawSymbolTagin interfaceIFFrame- Parameters:
g- Graphics sobre el que dibujar el icono.
-
setRotation
public void setRotation(double rotation) Sets the rotation of the frame, measured in arc degrees- Specified by:
setRotationin interfaceIFFrame- Parameters:
rotation- Rotation to apply to the frame
-
getRotationAT
Gets the affine transform used to rotate the graphics when rotation is not 0- Returns:
-
getRotation
public double getRotation()Gets the rotation of the frame, measured in arc degrees- Specified by:
getRotationin interfaceIFFrame- Returns:
- Rotation of the frame
-
getLevel
public int getLevel()Devuelve el nivel en el que se encuentra el FFrame. -
setLevel
public void setLevel(int l) Inserta el nivel al que se encuentra el FFrame. -
clone
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
setFrameFactory
- Specified by:
setFrameFactoryin interfaceIFFrame
-
getFrameFactory
- Specified by:
getFrameFactoryin interfaceIFFrame
-
initializeIcons
public static void initializeIcons()Initilizes the static icons -
registerPersistent
public static void registerPersistent() -
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
saveToState
public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
addObserver
public void addObserver(org.gvsig.tools.observer.Observer o) - Specified by:
addObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObserver
public void deleteObserver(org.gvsig.tools.observer.Observer o) - Specified by:
deleteObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObservers
public void deleteObservers()- Specified by:
deleteObserversin interfaceorg.gvsig.tools.observer.Observable
-
dispose
public void dispose()- Specified by:
disposein interfaceorg.gvsig.tools.dispose.Disposable
-
frameRemoved
public void frameRemoved()Description copied from interface:IFFrameThis method is called when the FFrame has been removed from the Layout- Specified by:
frameRemovedin interfaceIFFrame
-
frameAdded
public void frameAdded()Description copied from interface:IFFrameThis method is called when the FFrame has been added to the Layout- Specified by:
frameAddedin interfaceIFFrame
-
getLayoutContext
- Specified by:
getLayoutContextin interfaceIFFrame
-
setLayoutContext
- Specified by:
setLayoutContextin interfaceIFFrame
-
getDocument
public org.gvsig.app.project.documents.Document getDocument()- Specified by:
getDocumentin interfaceIFFrame
-
setDocument
public void setDocument(org.gvsig.app.project.documents.Document document) - Specified by:
setDocumentin interfaceIFFrame
-
getVisibleRect
Gets the visible rectangle of the frame, taking rotation into consideration. The result of this method is the rectangular area of the unrotated frame that will be visible when the frame gets rotated.- Parameters:
visibleLayoutDocRect- The visible area of the layout documentframe- The bounding box of this frame- Returns:
- the rectangular area of the unrotated frame that will be visible when the frame gets rotated, measured in screen coordinates
-