Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.views.styledmap.painter
Class AbstractInstancePainter

java.lang.Object
  extended by de.fhg.igd.mapviewer.AbstractTileOverlayPainter
      extended by de.fhg.igd.mapviewer.MapKitTileOverlayPainter
          extended by de.fhg.igd.mapviewer.waypoints.CustomWaypointPainter<W>
              extended by de.fhg.igd.mapviewer.waypoints.GenericWaypointPainter<InstanceReference,InstanceWaypoint>
                  extended by eu.esdihumboldt.hale.ui.views.styledmap.painter.AbstractInstancePainter
All Implemented Interfaces:
InstanceServiceListener, ClipPainter, Comparable<org.jdesktop.swingx.mapviewer.TileOverlayPainter>, EventListener, org.eclipse.ui.ISelectionListener, org.jdesktop.swingx.mapviewer.TileOverlayPainter
Direct Known Subclasses:
SourceInstancePainter, TransformedInstancePainter

public abstract class AbstractInstancePainter
extends de.fhg.igd.mapviewer.waypoints.GenericWaypointPainter<InstanceReference,InstanceWaypoint>
implements InstanceServiceListener, org.eclipse.ui.ISelectionListener, ClipPainter

Abstract instance painter implementation based on an InstanceService.

Author:
Simon Templer

Nested Class Summary
 
Nested classes/interfaces inherited from class de.fhg.igd.mapviewer.AbstractTileOverlayPainter
de.fhg.igd.mapviewer.AbstractTileOverlayPainter.Refresher
 
Field Summary
 
Fields inherited from class de.fhg.igd.mapviewer.AbstractTileOverlayPainter
DEF_PRIORITY
 
Constructor Summary
AbstractInstancePainter(InstanceService instanceService, DataSet dataSet)
          Create an instance painter.
 
Method Summary
 void clearWaypoints()
           
static org.eclipse.jface.viewers.ISelection combineSelection(org.eclipse.jface.viewers.ISelection oldSelection, org.eclipse.jface.viewers.ISelection newSelection)
          Try to combine two selections.
protected  InstanceWaypoint createWaypoint(Instance instance, InstanceService instanceService)
          Create a way-point for an instance
 void datasetAboutToChange(DataSet type)
          Called when a data set is about to change.
 void datasetChanged(DataSet type)
          Called when a data set has changed
protected  void drawOverlay(Graphics2D gfx, BufferedImage img, int zoom, int tilePosX, int tilePosY, int tileWidth, int tileHeight, Rectangle viewportBounds, org.jdesktop.swingx.mapviewer.PixelConverter converter)
           
 InstanceWaypoint findWaypoint(InstanceReference object)
           
static de.cs3d.common.metamodel.helperGeometry.BoundingBox getBoundingBox(com.vividsolutions.jts.geom.Geometry geometry)
          Determine the bounding box for a geometry.
 DataSet getDataSet()
           
 GeometrySchemaServiceListener getGeometryListener()
           
 InstanceService getInstanceService()
           
protected  int getMaxOverlap()
           
 org.eclipse.jface.viewers.ISelection getSelection(Point point)
          Get the selection for the given point.
 org.eclipse.jface.viewers.ISelection getSelection(Polygon poly)
          Get the selection for a given polygon on the screen.
 org.eclipse.jface.viewers.ISelection getSelection(Rectangle rect)
          Get the selection for a given rectangle on the screen.
 StyleServiceListener getStyleListener()
           
 org.opengis.referencing.crs.CoordinateReferenceSystem getWaypointCRS()
          Get the CRS for use in way-point bounding boxes.
static org.eclipse.jface.viewers.ISelection preferSelection(org.eclipse.jface.viewers.ISelection oldSelection, org.eclipse.jface.viewers.ISelection newSelection)
          Selects the preferred selection.
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
           
 void setClip(Clip clip)
          Set the clip algorithm.
protected  void styleRefresh()
          Refresh with style update.
 void transformationToggled(boolean enabled)
          Called when the transformation has been enabled or disabled.
 void update(org.eclipse.jface.viewers.ISelection selection)
          Do a complete update of the way-points.
 
Methods inherited from class de.fhg.igd.mapviewer.waypoints.GenericWaypointPainter
addWaypoint, iterateWaypoints, removeWaypoint
 
Methods inherited from class de.fhg.igd.mapviewer.waypoints.CustomWaypointPainter
dispose, findWaypoint, findWaypoints, findWaypoints, findWaypoints, getBoundingBox, removeWaypoint, repaintTile, setRenderer
 
Methods inherited from class de.fhg.igd.mapviewer.MapKitTileOverlayPainter
getCurrentViewBounds, getMapKit, isCurrentZoom, repaint, setMapKit
 
Methods inherited from class de.fhg.igd.mapviewer.AbstractTileOverlayPainter
compareTo, configureGraphics, createImage, getPriority, paintTile, prepareRefresh, prepareRefresh, refreshAll, setAntialiasing, setPriority, setTileProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractInstancePainter

public AbstractInstancePainter(InstanceService instanceService,
                               DataSet dataSet)
Create an instance painter.

Parameters:
instanceService - the instance service
dataSet - the data set
Method Detail

styleRefresh

protected void styleRefresh()
Refresh with style update.


datasetChanged

public void datasetChanged(DataSet type)
Description copied from interface: InstanceServiceListener
Called when a data set has changed

Specified by:
datasetChanged in interface InstanceServiceListener
Parameters:
type - the data set type
See Also:
InstanceServiceListener.datasetChanged(DataSet)

getWaypointCRS

public org.opengis.referencing.crs.CoordinateReferenceSystem getWaypointCRS()
Get the CRS for use in way-point bounding boxes.

Returns:
the way-point CRS

update

public void update(org.eclipse.jface.viewers.ISelection selection)
Do a complete update of the way-points. Existing way-points are discarded.

Parameters:
selection - the current selection

createWaypoint

protected InstanceWaypoint createWaypoint(Instance instance,
                                          InstanceService instanceService)
Create a way-point for an instance

Parameters:
instance - the instance
instanceService - the instance service
Returns:
the created way-point or null if

getBoundingBox

public static de.cs3d.common.metamodel.helperGeometry.BoundingBox getBoundingBox(com.vividsolutions.jts.geom.Geometry geometry)
Determine the bounding box for a geometry.

Parameters:
geometry - the geometry
Returns:
the bounding box or null if it is either an empty geometry or the bounding box cannot be determined

getMaxOverlap

protected int getMaxOverlap()
Specified by:
getMaxOverlap in class de.fhg.igd.mapviewer.AbstractTileOverlayPainter
See Also:
AbstractTileOverlayPainter.getMaxOverlap()

getInstanceService

public InstanceService getInstanceService()
Returns:
the instance service

getDataSet

public DataSet getDataSet()
Returns:
the data set

combineSelection

public static org.eclipse.jface.viewers.ISelection combineSelection(org.eclipse.jface.viewers.ISelection oldSelection,
                                                                    org.eclipse.jface.viewers.ISelection newSelection)
Try to combine two selections.

Parameters:
oldSelection - the first selection
newSelection - the second selection
Returns:
the combined selection

preferSelection

public static org.eclipse.jface.viewers.ISelection preferSelection(org.eclipse.jface.viewers.ISelection oldSelection,
                                                                   org.eclipse.jface.viewers.ISelection newSelection)
Selects the preferred selection.

Parameters:
oldSelection - the first selection
newSelection - the second selection
Returns:
the preferred selection

getSelection

public org.eclipse.jface.viewers.ISelection getSelection(Polygon poly)
Get the selection for a given polygon on the screen.

Parameters:
poly - the polygon
Returns:
a selection or null

getSelection

public org.eclipse.jface.viewers.ISelection getSelection(Rectangle rect)
Get the selection for a given rectangle on the screen.

Parameters:
rect - the rectangle
Returns:
a selection or null

getSelection

public org.eclipse.jface.viewers.ISelection getSelection(Point point)
Get the selection for the given point.

Parameters:
point - the point (viewport coordinates)
Returns:
a selection or null

selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener
See Also:
ISelectionListener.selectionChanged(IWorkbenchPart, ISelection)

clearWaypoints

public void clearWaypoints()
Overrides:
clearWaypoints in class de.fhg.igd.mapviewer.waypoints.GenericWaypointPainter<InstanceReference,InstanceWaypoint>
See Also:
GenericWaypointPainter.clearWaypoints()

getStyleListener

public StyleServiceListener getStyleListener()
Returns:
the styleListener

getGeometryListener

public GeometrySchemaServiceListener getGeometryListener()
Returns:
the geometryListener

setClip

public void setClip(Clip clip)
Description copied from interface: ClipPainter
Set the clip algorithm.

Specified by:
setClip in interface ClipPainter
Parameters:
clip - the clip algorithm
See Also:
ClipPainter.setClip(Clip)

drawOverlay

protected void drawOverlay(Graphics2D gfx,
                           BufferedImage img,
                           int zoom,
                           int tilePosX,
                           int tilePosY,
                           int tileWidth,
                           int tileHeight,
                           Rectangle viewportBounds,
                           org.jdesktop.swingx.mapviewer.PixelConverter converter)
Overrides:
drawOverlay in class de.fhg.igd.mapviewer.AbstractTileOverlayPainter
See Also:
AbstractTileOverlayPainter.drawOverlay(Graphics2D, BufferedImage, int, int, int, int, int, Rectangle, PixelConverter)

findWaypoint

public InstanceWaypoint findWaypoint(InstanceReference object)
Overrides:
findWaypoint in class de.fhg.igd.mapviewer.waypoints.GenericWaypointPainter<InstanceReference,InstanceWaypoint>
See Also:
GenericWaypointPainter.findWaypoint(Object)

transformationToggled

public void transformationToggled(boolean enabled)
Description copied from interface: InstanceServiceListener
Called when the transformation has been enabled or disabled.

Specified by:
transformationToggled in interface InstanceServiceListener
Parameters:
enabled - if the transformation is enabled now
See Also:
InstanceServiceListener.transformationToggled(boolean)

datasetAboutToChange

public void datasetAboutToChange(DataSet type)
Description copied from interface: InstanceServiceListener
Called when a data set is about to change.

Specified by:
datasetAboutToChange in interface InstanceServiceListener
Parameters:
type - the data set type
See Also:
InstanceServiceListener.datasetAboutToChange(DataSet)

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d