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, so
AUTOMATICO, 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, updateRect
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, 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, updateRect
addObserver, deleteObserver, deleteObservers
public 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 IFFrameUseFMap
d
- Scale to be setpublic void setNewEnvelope(Envelope r)
setNewEnvelope
in interface IFFrameUseFMap
r
- Envelope to be setprotected double getDrawPaperDPI()
public MapContext getMapContext()
getTypeScale()
.getMapContext
in interface IFFrameUseFMap
public 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
Exception
protected void createImage(AffineTransform affineTransform, int width, int height, Point mapOrigin) throws ReadException, MapContextException
ReadException
MapContextException
protected 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 IPrintable
protected 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 IFFrameUseFMap
public AffineTransform getATMap()
getATMap
in interface IFFrameUseFMap
public void setATMap(AffineTransform transform)
setATMap
in interface IFFrameUseFMap
transform
- Matriz de transformación.public void setProject(Project p)
setProject
in interface IFFrameUseProject
p
- Proyecto.public String getNameFFrame()
IFFrame
getNameFFrame
in interface IFFrame
IFFrame.getNameFFrame()
public String getName()
IFFrame
public boolean compare(Object arg0)
arg0
- DOCUMENT ME!public void updateScaleCtrl()
public void fullExtent() throws ReadException
IFFrameUseFMap
fullExtent
in interface IFFrameUseFMap
ReadException
public void setPointsToZoom(Point2D px1, Point2D px2)
setPointsToZoom
in interface IFFrameUseFMap
public void movePoints(Point2D px1, Point2D px2)
movePoints
in interface IFFrameUseFMap
protected void cloneActions(FFrameView frame)
public Object clone() throws CloneNotSupportedException
Cloneable
clone
in class FFrame
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)
FFrame
setRotation
in interface IFFrame
setRotation
in class FFrame
rotation
- Rotation to apply to the framepublic void showGrid(boolean b)
public boolean isShowGrid()
public void refreshOriginalExtent()
refreshOriginalExtent
in interface IFFrameUseFMap
public static void registerPersistent()
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
loadFromState
in class FFrame
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
saveToState
in class FFrame
PersistenceException
public void setBoundBox(Rectangle2D r)
FFrame
setBoundBox
in interface IFFrame
setBoundBox
in class FFrame
r
- Rectangle in centimeterspublic double getMapRotation()
protected void invalidateLayout()
protected void invalidateToc()
protected void refreshToc()
public void refresh()
IFFrameUseFMap
refresh
in interface IFFrameUseFMap
protected void resetListeners()
protected void setListeners()
protected void clearOwnListeners(MapContext mapContext)
protected void clearViewListeners(MapContext mapContext)
public void dispose()
Disposable
NOTE:After calling this method, the object may not be usable anymore.
dispose
in interface Disposable
dispose
in class FFrame
public void frameRemoved()
IFFrame
frameRemoved
in interface IFFrame
frameRemoved
in class FFrame
public void frameAdded()
IFFrame
frameAdded
in interface IFFrame
frameAdded
in class FFrame
public void setHasToc(boolean hasToc)
protected void setTocModel()
protected void doSetSelected(int selectedStatus)
doSetSelected
in class FFrame
public boolean getLayerSynced()
IFFrameUseFMap
true
, 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 IFFrameUseFMap
true
if the layers are synchronized between the
FFrameView and the View, false
otherwise.public void setLayerSynced(boolean synced)
IFFrameUseFMap
true
,
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 IFFrameUseFMap
synced
- true
to enable layers synchronization
between the FFrameView and the View, false
otherwise.public boolean getExtentSynced()
IFFrameUseFMap
true
,
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 IFFrameUseFMap
true
if the map extent is synchronized between the
FFrameView and the View, false
otherwise.public void setExtentSynced(boolean synced)
IFFrameUseFMap
true
,
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 IFFrameUseFMap
synced
- 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()
IFFrameUseFMap
IFFrameUseFMap.SCALE_TYPE.NORMAL
, IFFrameUseFMap.SCALE_TYPE.FIXED_SCALE
or IFFrameUseFMap.SCALE_TYPE.FIXED_EXTENT
getScaleType
in interface IFFrameUseFMap
public void setScaleType(IFFrameUseFMap.SCALE_TYPE scaleType)
IFFrameUseFMap
IFFrameUseFMap.SCALE_TYPE.NORMAL
, IFFrameUseFMap.SCALE_TYPE.FIXED_SCALE
or IFFrameUseFMap.SCALE_TYPE.FIXED_EXTENT
setScaleType
in interface IFFrameUseFMap
public void setScaleType(IFFrameUseFMap.SCALE_TYPE scaleType, double fixedScale)
public void setScaleType(IFFrameUseFMap.SCALE_TYPE scaleType, Envelope fixedExtent)
@Deprecated public int getTypeScale()
IFFrameUseFMap
getTypeScale
in interface IFFrameUseFMap
@Deprecated public void setLinked(boolean b)
IFFrameUseFMap
setLinked
in interface IFFrameUseFMap
@Deprecated public boolean getLinked()
IFFrameUseFMap
getLinked
in interface IFFrameUseFMap
public void windowActivated()
windowActivated
in interface LayoutPanelListener
public void windowClosed()
windowClosed
in interface LayoutPanelListener