public class FFrameView extends FFrame implements IFFrameUseProject, IFFrameUseFMap, LayoutPanelListener
getTypeScale() and getLinked().
The main synchronization logic is kept on two internal classes:
OwnMapContextListener and ViewDocListener. The first one
listens for events on the FFrameView and synchronizes the View accordingly.
The second one listens for events on the View and synchronizes the FFrameView
accordingly. There synchronization process is flagged using
b_updating and b_updating, in order
to avoid incurring on infinite synchronization loops.IFFrameUseFMap.SCALE_TYPE| Modifier and Type | Field and Description |
|---|---|
protected boolean |
b_drawing |
protected boolean |
b_validCache |
static int |
DRAFT |
protected static GeometryManager |
geomManager |
protected IFFrame |
grid |
protected BufferedImage |
m_image |
protected AffineTransform |
mapAT |
protected MapContext |
mapContext |
protected int |
mapUnits |
protected Point |
origin |
protected Rectangle |
originalClip |
protected AffineTransform |
originalGraphicsAT |
protected org.gvsig.app.project.documents.layout.fframes.FFrameView.OwnMapContextListener |
ownMapContextListener |
protected Point2D |
p1 |
protected Point2D |
p2 |
static String |
PERSISTENCE_DEFINITION_NAME |
static int |
PRESENTATION |
protected Project |
project |
protected int |
quality |
protected double |
scaleAnt |
protected boolean |
showGrid |
protected boolean |
syncExtents |
protected boolean |
syncLayers |
protected org.gvsig.app.project.documents.layout.fframes.FFrameView.ViewDocListener |
viewDocListener |
protected ViewDocument |
viewDocument |
e, frameFactory, lastAT, layoutManager, LOG, m_BoundBox, m_Selected, n, ne, no, num, o, observers, s, se, soAUTOMATICO, CONSTANTE, MANUAL| Constructor and Description |
|---|
FFrameView()
Creates a new FFrameView object.
|
| Modifier and Type | Method and Description |
|---|---|
protected Envelope |
calculateNewExtent()
Calculates the new extent for the FFrame.
|
protected void |
clearOwnListeners(MapContext mapContext) |
protected void |
clearViewListeners(MapContext mapContext) |
Object |
clone()
Creates a copy of the object.
|
protected void |
cloneActions(FFrameView frame)
This method deals with places where this fframeview and the cloned
fframeview (frame) are registered as listeners.
|
boolean |
compare(Object arg0)
DOCUMENT ME!
|
protected void |
createImage(AffineTransform affineTransform,
int width,
int height,
Point mapOrigin) |
protected void |
createListeners() |
void |
dispose()
Disposes the current object, to allow it to close and dispose any used
resources.
|
protected void |
doSetSelected(int selectedStatus) |
void |
draw(Graphics2D g,
AffineTransform at,
Rectangle2D visibleLayoutDocRect,
BufferedImage imgBase)
Draws the FFrameView on the provided Graphics, according to the
provided affine transform and the visible rectangle.
|
protected void |
drawImage(Graphics2D g,
BufferedImage image,
Rectangle2D.Double visibleRectangle) |
protected void |
drawPresentation(Graphics2D g,
AffineTransform affineTransform,
Rectangle2D.Double fframeViewRect,
Rectangle2D.Double visibleRect,
BufferedImage imgBase) |
void |
frameAdded()
This method is called when the FFrame has been
added to the Layout
|
void |
frameRemoved()
This method is called when the FFrame has been
removed from the Layout
|
void |
fullExtent()
Zooms to the extent containing all the layers loaded in the map.
|
AffineTransform |
getATMap()
Devuelve la MAtriz de transformación utilizada por la FFrameView.
|
BufferedImage |
getBufferedImage()
Devuelve la imagen para repintar.
|
protected double |
getDrawPaperDPI()
Calculates the resolution (measured on dots per inch, DPI) to be
considered to draw the FFrameView on screen.
|
boolean |
getExtentSynced()
Gets the synchronization mode for the map extent.
|
IFFrame |
getGrid() |
boolean |
getLayerSynced()
Gets the synchronization mode for layers.
|
boolean |
getLinked()
Deprecated.
|
MapContext |
getMapContext()
Returns the MapContext contained in this FFrameView, which is
usually a clone of the associated View.
|
double |
getMapRotation()
Gets the rotation of the frame
|
int |
getMapUnits()
Obtiene la unidad de medida en la que está la vista.
|
String |
getName()
Devuelve el nombre que representa al fframe.
|
String |
getNameFFrame()
Devuelve el nombre que representa al tipo de FFrame.
|
int |
getQuality()
Gets the quality of the visualization of the FFrame on screen.
|
long |
getScale()
Devuelve la escala según el tipo de escala que se haya seleccionado al
añadida la vista.
|
IFFrameUseFMap.SCALE_TYPE |
getScaleType()
Gets the scale and extent types.
|
int |
getTypeScale()
Deprecated.
|
ViewDocument |
getView()
Gets the associated View
|
protected Envelope |
getVisibleEnvelope(Rectangle2D.Double fframeViewRect,
Rectangle2D.Double visiblefframeViewRect)
Gets the visible envelope, in map coordinates
|
protected void |
invalidateLayout() |
protected void |
invalidateToc() |
static boolean |
isPan(Envelope oldEnvelope,
Envelope newEnvelope)
Returns true if the newEnvelope represents a pan operation on oldEnvelope,
(both extents have the same height and width)
|
boolean |
isShowGrid() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
movePoints(Point2D px1,
Point2D px2) |
protected void |
postDraw(Graphics2D g,
Rectangle2D.Double fframeViewRect,
AffineTransform at) |
protected void |
postDraw(Graphics2D g,
Rectangle2D.Double rectangleLayout,
Rectangle2D rectangleView,
BufferedImage imgBase,
Rectangle originalClip,
AffineTransform at)
Deprecated.
|
protected Rectangle |
preDraw(Graphics2D g,
Rectangle2D.Double rectangleLayout)
Deprecated.
Use {@link #preDraw(Graphics2D, java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Double) instead
|
protected void |
preDraw(Graphics2D g,
Rectangle2D.Double fframeViewRect,
Rectangle2D.Double visibleRect) |
void |
print(Graphics2D g,
AffineTransform at,
Geometry geom,
PrintAttributes printAttributes) |
protected void |
print(Graphics2D g,
AffineTransform at,
PrintAttributes printAttributes) |
void |
refresh()
Invalidates the FFrameView cache, which will cause the
FFrame to be repainted on the next drawing cycle.
|
void |
refreshOriginalExtent() |
protected void |
refreshToc() |
static void |
registerPersistent() |
protected void |
resetListeners() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setATMap(AffineTransform transform)
Inserta la matriz de transformación.
|
void |
setBoundBox(Rectangle2D r)
Sets the bounding box in centimeters of this FFrame, using paper
coordinates.
|
void |
setBufferedImage(BufferedImage bi)
Inserta la imagen para repintar el FFrameView.
|
void |
setExtent(Envelope extent) |
void |
setExtentSynced(boolean synced)
Sets the synchronization mode for the map extent.
|
void |
setGrid(IFFrame grid) |
void |
setHasToc(boolean hasToc) |
void |
setLayerSynced(boolean synced)
Sets the synchronization mode for map layers.
|
void |
setLinked(boolean b)
Deprecated.
|
protected void |
setListeners() |
void |
setMapUnits(int i)
Rellena la unidad de medida en la que está la vista.
|
void |
setNewEnvelope(Envelope r)
Sets a new Envelope on the MapContext contained in
this FFrameView
|
void |
setPointsToZoom(Point2D px1,
Point2D px2) |
void |
setProject(Project p)
Inserta el proyecto.
|
void |
setQuality(int q)
Sets the quality of the visualization of the FFrame on screen.
|
void |
setRotation(double rotation)
Sets the rotation of the frame, measured in arc degrees
|
void |
setScale(double d)
Sets the scale of the MapContext contained in this FFrameView
|
void |
setScaleType(IFFrameUseFMap.SCALE_TYPE scaleType)
Sets the scale and extent types.
|
void |
setScaleType(IFFrameUseFMap.SCALE_TYPE scaleType,
double fixedScale) |
void |
setScaleType(IFFrameUseFMap.SCALE_TYPE scaleType,
Envelope fixedExtent) |
protected void |
setTocModel() |
void |
setView(ViewDocument dvd)
Sets the View associated with this FFrameView, which will
be used to clone the MapContext and the layers.
|
void |
setViewMapContext(MapContext viewMapContext)
Sets the MapContext associated with this FFrameView, which will
be used to clone the layers and synchronize the FFrameView with
the associated View
|
void |
showGrid(boolean b) |
String |
toString()
Returns a description of the FFrame
|
void |
updateScaleCtrl() |
void |
windowActivated() |
void |
windowClosed() |
addObserver, contains, deleteObserver, deleteObservers, drawDraft, drawEmpty, drawHandlers, drawSymbolTag, getBoundBox, getBoundingBox, getContains, getDocument, getFrameFactory, getLastMoveRect, getLayoutContext, getLevel, getMapCursor, getMovieRect, getRotation, getRotationAT, getSelected, getTag, getVisibleRect, initializeIcons, intersects, isSelected, setDocument, setFrameFactory, setLayoutContext, setLevel, setNum, setSelected, setSelected, setTag, updateRectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, drawDraft, drawHandlers, drawSymbolTag, getBoundBox, getBoundingBox, getContains, getDocument, getFrameFactory, getLastMoveRect, getLayoutContext, getLevel, getMapCursor, getMovieRect, getRotation, getSelected, getTag, intersects, isSelected, setDocument, setFrameFactory, setLayoutContext, setLevel, setNum, setSelected, setSelected, setTag, updateRectaddObserver, deleteObserver, deleteObserverspublic static final String PERSISTENCE_DEFINITION_NAME
public static final int PRESENTATION
public static final int DRAFT
protected boolean syncLayers
protected boolean syncExtents
protected int quality
protected ViewDocument viewDocument
protected MapContext mapContext
protected int mapUnits
protected BufferedImage m_image
protected AffineTransform mapAT
protected Project project
protected double scaleAnt
protected Point origin
protected Point2D p1
protected Point2D p2
protected IFFrame grid
protected boolean showGrid
protected boolean b_validCache
protected boolean b_drawing
protected org.gvsig.app.project.documents.layout.fframes.FFrameView.ViewDocListener viewDocListener
protected org.gvsig.app.project.documents.layout.fframes.FFrameView.OwnMapContextListener ownMapContextListener
protected static final GeometryManager geomManager
protected AffineTransform originalGraphicsAT
protected Rectangle originalClip
protected void createListeners()
public String toString()
public void setScale(double d)
setScale in interface IFFrameUseFMapd - Scale to be setpublic void setNewEnvelope(Envelope r)
setNewEnvelope in interface IFFrameUseFMapr - Envelope to be setprotected double getDrawPaperDPI()
public MapContext getMapContext()
getTypeScale().getMapContext in interface IFFrameUseFMappublic void setQuality(int q)
DRAFT and PRESENTATION.
Draft will disable the frame normal drawing, which will be
replaced by an empty rectangle only showing the name of the
frame.q - Integer representing the quality.public int getQuality()
DRAFT and PRESENTATION.
Draft will disable the frame normal drawing, which will be
replaced by an empty rectangle only showing the name of the
frame.q - The selected qualitypublic void setViewMapContext(MapContext viewMapContext)
viewMapContext - public void setView(ViewDocument dvd)
viewMapContext - public ViewDocument getView()
#setView(ViewDocument)}public void draw(Graphics2D g, AffineTransform at, Rectangle2D visibleLayoutDocRect, BufferedImage imgBase)
protected Envelope getVisibleEnvelope(Rectangle2D.Double fframeViewRect, Rectangle2D.Double visiblefframeViewRect)
fframeViewRect - Rectangle defining the bounding box of the
FFrameView, in screen coordinatesvisiblefframeViewRect - Rectangle defining the bounding box
of the visible area of the fframeView, in screen coordinatesprotected void drawPresentation(Graphics2D g, AffineTransform affineTransform, Rectangle2D.Double fframeViewRect, Rectangle2D.Double visibleRect, BufferedImage imgBase) throws Exception
Exceptionprotected void createImage(AffineTransform affineTransform, int width, int height, Point mapOrigin) throws ReadException, MapContextException
ReadExceptionMapContextExceptionprotected void drawImage(Graphics2D g, BufferedImage image, Rectangle2D.Double visibleRectangle)
protected void preDraw(Graphics2D g, Rectangle2D.Double fframeViewRect, Rectangle2D.Double visibleRect)
protected void postDraw(Graphics2D g, Rectangle2D.Double fframeViewRect, AffineTransform at)
@Deprecated protected void postDraw(Graphics2D g, Rectangle2D.Double rectangleLayout, Rectangle2D rectangleView, BufferedImage imgBase, Rectangle originalClip, AffineTransform at)
postDraw(Graphics2D, java.awt.geom.Rectangle2D.Double, AffineTransform) instead.@Deprecated protected Rectangle preDraw(Graphics2D g, Rectangle2D.Double rectangleLayout)
public void print(Graphics2D g, AffineTransform at, Geometry geom, PrintAttributes printAttributes)
print in interface IPrintableprotected void print(Graphics2D g, AffineTransform at, PrintAttributes printAttributes)
public void setMapUnits(int i)
i - entero que representa la unidad de medida de la vista.public int getMapUnits()
public long getScale()
public void setBufferedImage(BufferedImage bi)
bi - Imagen para repintar.public BufferedImage getBufferedImage()
getBufferedImage in interface IFFrameUseFMappublic AffineTransform getATMap()
getATMap in interface IFFrameUseFMappublic void setATMap(AffineTransform transform)
setATMap in interface IFFrameUseFMaptransform - Matriz de transformación.public void setProject(Project p)
setProject in interface IFFrameUseProjectp - Proyecto.public String getNameFFrame()
IFFramegetNameFFrame in interface IFFrameIFFrame.getNameFFrame()public String getName()
IFFramepublic boolean compare(Object arg0)
arg0 - DOCUMENT ME!public void updateScaleCtrl()
public void fullExtent()
throws ReadException
IFFrameUseFMapfullExtent in interface IFFrameUseFMapReadExceptionpublic void setPointsToZoom(Point2D px1, Point2D px2)
setPointsToZoom in interface IFFrameUseFMappublic void movePoints(Point2D px1, Point2D px2)
movePoints in interface IFFrameUseFMapprotected void cloneActions(FFrameView frame)
public Object clone() throws CloneNotSupportedException
Cloneableclone in class FFrameCloneNotSupportedException - if the instance of the object cannot
be cloned. As this is extending Cloneable so
its sure it implements it, so this exception may be used for problems
on specific object instances.Object#clone()}.public void setGrid(IFFrame grid)
public IFFrame getGrid()
public void setRotation(double rotation)
FFramesetRotation in interface IFFramesetRotation in class FFramerotation - Rotation to apply to the framepublic void showGrid(boolean b)
public boolean isShowGrid()
public void refreshOriginalExtent()
refreshOriginalExtent in interface IFFrameUseFMappublic static void registerPersistent()
public void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentloadFromState in class FFramePersistenceExceptionpublic void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentsaveToState in class FFramePersistenceExceptionpublic void setBoundBox(Rectangle2D r)
FFramesetBoundBox in interface IFFramesetBoundBox in class FFramer - Rectangle in centimeterspublic double getMapRotation()
protected void invalidateLayout()
protected void invalidateToc()
protected void refreshToc()
public void refresh()
IFFrameUseFMaprefresh in interface IFFrameUseFMapprotected void resetListeners()
protected void setListeners()
protected void clearOwnListeners(MapContext mapContext)
protected void clearViewListeners(MapContext mapContext)
public void dispose()
DisposableNOTE:After calling this method, the object may not be usable anymore.
dispose in interface Disposabledispose in class FFramepublic void frameRemoved()
IFFrameframeRemoved in interface IFFrameframeRemoved in class FFramepublic void frameAdded()
IFFrameframeAdded in interface IFFrameframeAdded in class FFramepublic void setHasToc(boolean hasToc)
protected void setTocModel()
protected void doSetSelected(int selectedStatus)
doSetSelected in class FFramepublic boolean getLayerSynced()
IFFrameUseFMaptrue, layers
will be synchronized between the FFrameView and the associated View, so
any change in the FFrameView (layer added or removed, visibility changed,
symbology change, etc) will be propagated to the associated View, and
vice versa.getLayerSynced in interface IFFrameUseFMaptrue if the layers are synchronized between the
FFrameView and the View, false otherwise.public void setLayerSynced(boolean synced)
IFFrameUseFMaptrue,
layers will be synchronized between the FFrameView and the associated
View, so any change in the FFrameView (layer added or removed,
visibility changed, symbology change, etc) will be propagated to the
associated View, and vice versa.setLayerSynced in interface IFFrameUseFMapsynced - true to enable layers synchronization
between the FFrameView and the View, false otherwise.public boolean getExtentSynced()
IFFrameUseFMaptrue,
the map extent will be synchronized between the FFrameView and the
associated View, so any change in the FFrameView (pan, zoom in, zoom
out...) will be propagated to the associated View, and vice versa.getExtentSynced in interface IFFrameUseFMaptrue if the map extent is synchronized between the
FFrameView and the View, false otherwise.public void setExtentSynced(boolean synced)
IFFrameUseFMaptrue,
the map extent will be synchronized between the FFrameView and the
associated View, so any change in the FFrameView (pan, zoom in, zoom
out...) will be propagated to the associated View, and vice versa.setExtentSynced in interface IFFrameUseFMapsynced - true to enable extent synchronization
between the FFrameView and the View, false otherwise.public static boolean isPan(Envelope oldEnvelope, Envelope newEnvelope)
protected Envelope calculateNewExtent()
newEnvelope - public void setExtent(Envelope extent)
public IFFrameUseFMap.SCALE_TYPE getScaleType()
IFFrameUseFMapIFFrameUseFMap.SCALE_TYPE.NORMAL, IFFrameUseFMap.SCALE_TYPE.FIXED_SCALE
or IFFrameUseFMap.SCALE_TYPE.FIXED_EXTENTgetScaleType in interface IFFrameUseFMappublic void setScaleType(IFFrameUseFMap.SCALE_TYPE scaleType)
IFFrameUseFMapIFFrameUseFMap.SCALE_TYPE.NORMAL, IFFrameUseFMap.SCALE_TYPE.FIXED_SCALE
or IFFrameUseFMap.SCALE_TYPE.FIXED_EXTENTsetScaleType in interface IFFrameUseFMappublic void setScaleType(IFFrameUseFMap.SCALE_TYPE scaleType, double fixedScale)
public void setScaleType(IFFrameUseFMap.SCALE_TYPE scaleType, Envelope fixedExtent)
@Deprecated public int getTypeScale()
IFFrameUseFMapgetTypeScale in interface IFFrameUseFMap@Deprecated public void setLinked(boolean b)
IFFrameUseFMapsetLinked in interface IFFrameUseFMap@Deprecated public boolean getLinked()
IFFrameUseFMapgetLinked in interface IFFrameUseFMappublic void windowActivated()
windowActivated in interface LayoutPanelListenerpublic void windowClosed()
windowClosed in interface LayoutPanelListener