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 java.awt.image.BufferedImage |
m_image |
protected java.awt.geom.AffineTransform |
mapAT |
protected MapContext |
mapContext |
protected int |
mapUnits |
protected java.awt.Point |
origin |
protected java.awt.Rectangle |
originalClip |
protected java.awt.geom.AffineTransform |
originalGraphicsAT |
protected java.awt.geom.Point2D |
p1 |
protected java.awt.geom.Point2D |
p2 |
static java.lang.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 ViewDocument |
viewDocument |
e, frameFactory, iEResize, iNResize, 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 void |
addAllListeners() |
protected void |
beginUpdate() |
protected Envelope |
calculateNewExtent()
Calculates the new extent for the FFrame.
|
FFrameView |
clone()
Creates a copy of the object.
|
boolean |
compare(java.lang.Object arg0) |
protected void |
createImage(java.awt.geom.AffineTransform affineTransform,
int width,
int height,
java.awt.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(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
java.awt.geom.Rectangle2D visibleLayoutDocRect,
java.awt.image.BufferedImage imgBase)
Draws the FFrameView on the provided Graphics, according to the provided
affine transform and the visible rectangle.
|
protected void |
drawImage(java.awt.Graphics2D g,
java.awt.image.BufferedImage image,
java.awt.geom.Rectangle2D.Double visibleRectangle) |
protected void |
drawPresentation(java.awt.Graphics2D g,
java.awt.geom.AffineTransform affineTransform,
java.awt.geom.Rectangle2D.Double fframeViewRect,
java.awt.geom.Rectangle2D.Double visibleRect,
java.awt.image.BufferedImage imgBase) |
protected void |
endUpdate() |
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.
|
java.awt.geom.AffineTransform |
getATMap()
Devuelve la MAtriz de transformación utilizada por la FFrameView.
|
java.awt.image.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.
|
Envelope |
getFixedExtent() |
java.lang.Double |
getFixedScale() |
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.
|
java.lang.String |
getName()
Devuelve el nombre que representa al fframe.
|
java.lang.String |
getNameFFrame()
Devuelve el nombre que representa al tipo de FFrame.
|
int |
getQuality()
Gets the quality of the visualization of the FFrame on screen.
|
double |
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(java.awt.geom.Rectangle2D.Double fframeViewRect,
java.awt.geom.Rectangle2D.Double visiblefframeViewRect)
Gets the visible envelope, in map coordinates
|
protected void |
invalidateLayout() |
protected void |
invalidateToc() |
protected boolean |
isDrawing() |
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 |
isPersistIndependent() |
boolean |
isShowGrid() |
protected boolean |
isSyncLayers() |
protected boolean |
isUpdating() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
movePoints(java.awt.geom.Point2D px1,
java.awt.geom.Point2D px2) |
protected void |
postDraw(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D.Double fframeViewRect,
java.awt.geom.AffineTransform at) |
protected void |
postDraw(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D.Double rectangleLayout,
java.awt.geom.Rectangle2D rectangleView,
java.awt.image.BufferedImage imgBase,
java.awt.Rectangle originalClip,
java.awt.geom.AffineTransform at)
Deprecated.
|
protected java.awt.Rectangle |
preDraw(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D.Double rectangleLayout)
Deprecated.
Use {@link #preDraw(Graphics2D, java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Double) instead
|
protected void |
preDraw(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D.Double fframeViewRect,
java.awt.geom.Rectangle2D.Double visibleRect) |
void |
print(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
Geometry geom,
PrintAttributes printAttributes) |
protected void |
print(java.awt.Graphics2D g,
java.awt.geom.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 |
removeAllListeners() |
protected void |
removeOwnListeners() |
protected void |
removeViewListeners() |
protected void |
resetAllListeners() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setATMap(java.awt.geom.AffineTransform transform)
Inserta la matriz de transformación.
|
void |
setBoundBox(java.awt.geom.Rectangle2D r)
Sets the bounding box in centimeters of this FFrame, using paper
coordinates.
|
void |
setBufferedImage(java.awt.image.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.
|
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 |
setPersistIndependent(boolean b) |
void |
setPointsToZoom(java.awt.geom.Point2D px1,
java.awt.geom.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 viewDocument)
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) |
protected boolean |
skipFirstChangeExtent() |
java.lang.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, 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, getMovieRect, getRotation, getSelected, getTag, intersects, isSelected, setDocument, setFrameFactory, setLayoutContext, setLevel, setNum, setSelected, setSelected, setTag, updateRectcloneQuietly, cloneQuietlyaddObserver, deleteObserver, deleteObserverspublic static final java.lang.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 java.awt.image.BufferedImage m_image
protected java.awt.geom.AffineTransform mapAT
protected Project project
protected double scaleAnt
protected java.awt.Point origin
protected java.awt.geom.Point2D p1
protected java.awt.geom.Point2D p2
protected IFFrame grid
protected boolean showGrid
protected boolean b_validCache
protected boolean b_drawing
protected static final GeometryManager geomManager
protected java.awt.geom.AffineTransform originalGraphicsAT
protected java.awt.Rectangle originalClip
public java.lang.String toString()
toString in class java.lang.Objectpublic 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.public void setViewMapContext(MapContext viewMapContext)
viewMapContext - public void setView(ViewDocument viewDocument)
viewDocument - public ViewDocument getView()
#setView(ViewDocument)}public void draw(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
java.awt.geom.Rectangle2D visibleLayoutDocRect,
java.awt.image.BufferedImage imgBase)
protected Envelope getVisibleEnvelope(java.awt.geom.Rectangle2D.Double fframeViewRect, java.awt.geom.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(java.awt.Graphics2D g,
java.awt.geom.AffineTransform affineTransform,
java.awt.geom.Rectangle2D.Double fframeViewRect,
java.awt.geom.Rectangle2D.Double visibleRect,
java.awt.image.BufferedImage imgBase)
throws java.lang.Exception
java.lang.Exceptionprotected void createImage(java.awt.geom.AffineTransform affineTransform,
int width,
int height,
java.awt.Point mapOrigin)
throws ReadException,
MapContextException
ReadExceptionMapContextExceptionprotected void drawImage(java.awt.Graphics2D g,
java.awt.image.BufferedImage image,
java.awt.geom.Rectangle2D.Double visibleRectangle)
protected void preDraw(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D.Double fframeViewRect,
java.awt.geom.Rectangle2D.Double visibleRect)
protected void postDraw(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D.Double fframeViewRect,
java.awt.geom.AffineTransform at)
@Deprecated
protected void postDraw(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D.Double rectangleLayout,
java.awt.geom.Rectangle2D rectangleView,
java.awt.image.BufferedImage imgBase,
java.awt.Rectangle originalClip,
java.awt.geom.AffineTransform at)
postDraw(Graphics2D, java.awt.geom.Rectangle2D.Double, AffineTransform)
instead.g - rectangleLayout - rectangleView - originalClip - imgBase - at - @Deprecated
protected java.awt.Rectangle preDraw(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D.Double rectangleLayout)
g - rectangleLayout - public void print(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
Geometry geom,
PrintAttributes printAttributes)
print in interface IPrintableprotected void print(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
PrintAttributes printAttributes)
public void setMapUnits(int i)
i - entero que representa la unidad de medida de la vista.public int getMapUnits()
public double getScale()
public void setBufferedImage(java.awt.image.BufferedImage bi)
bi - Imagen para repintar.public java.awt.image.BufferedImage getBufferedImage()
getBufferedImage in interface IFFrameUseFMappublic java.awt.geom.AffineTransform getATMap()
getATMap in interface IFFrameUseFMappublic void setATMap(java.awt.geom.AffineTransform transform)
setATMap in interface IFFrameUseFMaptransform - Matriz de transformación.public void setProject(Project p)
setProject in interface IFFrameUseProjectp - Proyecto.public java.lang.String getNameFFrame()
IFFramegetNameFFrame in interface IFFrameIFFrame.getNameFFrame()public java.lang.String getName()
IFFramepublic boolean compare(java.lang.Object arg0)
public void updateScaleCtrl()
public void fullExtent()
throws ReadException
IFFrameUseFMapfullExtent in interface IFFrameUseFMapReadExceptionpublic void setPointsToZoom(java.awt.geom.Point2D px1,
java.awt.geom.Point2D px2)
setPointsToZoom in interface IFFrameUseFMappublic void movePoints(java.awt.geom.Point2D px1,
java.awt.geom.Point2D px2)
movePoints in interface IFFrameUseFMappublic FFrameView clone() throws java.lang.CloneNotSupportedException
Cloneableclone in class FFramejava.lang.CloneNotSupportedException - 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(java.awt.geom.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 createListeners()
protected void addAllListeners()
protected void resetAllListeners()
protected void removeAllListeners()
protected void removeOwnListeners()
protected void removeViewListeners()
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)
oldEnvelope - newEnvelope - protected Envelope calculateNewExtent()
protected boolean isDrawing()
protected boolean isUpdating()
protected boolean skipFirstChangeExtent()
protected boolean isSyncLayers()
protected void beginUpdate()
protected void endUpdate()
public IFFrameUseFMap.SCALE_TYPE getScaleType()
IFFrameUseFMapIFFrameUseFMap.SCALE_TYPE.NORMAL, IFFrameUseFMap.SCALE_TYPE.FIXED_SCALE
or IFFrameUseFMap.SCALE_TYPE.FIXED_EXTENTgetScaleType in interface IFFrameUseFMappublic java.lang.Double getFixedScale()
public Envelope getFixedExtent()
public void setExtent(Envelope extent)
public 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 LayoutPanelListenerpublic void setPersistIndependent(boolean b)
public boolean isPersistIndependent()