org.placelab.demo.mapview
Class RegionGlyph

java.lang.Object
  extended byorg.placelab.util.swt.Glyph
      extended byorg.placelab.demo.mapview.RegionGlyph
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.events.MouseListener, org.eclipse.swt.internal.SWTEventListener

public class RegionGlyph
extends Glyph
implements org.eclipse.swt.events.MouseListener

A RegionGlyph draws a RegionBacking and allows it to be manipulated.


Field Summary
protected  int lastX
           
protected  int lastY
           
protected static int lineWidth
           
protected  MapView map
           
protected  int modifyType
           
 RegionBacking region
           
protected static int resizeThreshold
           
protected static org.eclipse.swt.graphics.Color strokeColor
           
protected  org.placelab.demo.mapview.RegionGlyph.IconTextInfo text
           
 
Fields inherited from class org.placelab.util.swt.Glyph
ANCHOR_C, ANCHOR_E, ANCHOR_N, ANCHOR_NE, ANCHOR_NW, ANCHOR_S, ANCHOR_SE, ANCHOR_SW, ANCHOR_W, DISPOSED, IGNORE_TRANSPARENCY, MOUSE_EVENTS, needsTransformRedraw, transform, transformedImage, transparency, VISIBLE, zoom
 
Method Summary
protected  void enter(org.eclipse.swt.events.MouseEvent me)
           
protected  org.eclipse.swt.graphics.Rectangle getBoundsImpl()
           
protected  double getDeltaLat(int pixelsMoved)
           
protected  double getDeltaLon(int pixelsMoved)
           
protected  int getEdge(int x, int y)
           
protected  void leave(org.eclipse.swt.events.MouseEvent me)
           
 void mouseDoubleClick(org.eclipse.swt.events.MouseEvent arg0)
           
 void mouseDown(org.eclipse.swt.events.MouseEvent me)
           
protected  void mouseMoved(org.eclipse.swt.events.MouseEvent me)
           
 void mouseUp(org.eclipse.swt.events.MouseEvent arg0)
           
protected  void paintImpl(org.eclipse.swt.events.PaintEvent e, GlyphGC gc)
          Implement this if you don't want to worry about AffineTransforms.
protected  boolean pointInsideImpl(int x, int y)
          Return if the point is inside your glyph without the AffineTransform applied
 
Methods inherited from class org.placelab.util.swt.Glyph
addListener, addMouseListener, addPaintListener, areMouseEventsEnabled, dispose, enableMouseEvents, getBounds, getCloseEnough, getFlag, getHolder, getLocation, getMaskColor, getNeedsTransformRedraw, getOriginalLocation, getParent, getTransform, getTransparency, getZoom, handleMouseEvent, isDisposed, isVisible, moveAbove, moveBelow, notifyListeners, paint, pickGlyphAt, pointInside, pointInside, redraw, removeListener, resetFlag, setCloseEnough, setCursor, setFlag, setLocation, setNeedsTransformRedraw, setTransform, setTransparency, setVisible, setZoom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

region

public RegionBacking region

map

protected MapView map

text

protected org.placelab.demo.mapview.RegionGlyph.IconTextInfo text

strokeColor

protected static final org.eclipse.swt.graphics.Color strokeColor

lineWidth

protected static final int lineWidth
See Also:
Constant Field Values

resizeThreshold

protected static final int resizeThreshold
See Also:
Constant Field Values

modifyType

protected int modifyType

lastX

protected int lastX

lastY

protected int lastY
Method Detail

paintImpl

protected void paintImpl(org.eclipse.swt.events.PaintEvent e,
                         GlyphGC gc)
Description copied from class: Glyph
Implement this if you don't want to worry about AffineTransforms. Your graphics will be rasterized and have an AffineTransform applied to them

Overrides:
paintImpl in class Glyph

getEdge

protected int getEdge(int x,
                      int y)

getBoundsImpl

protected org.eclipse.swt.graphics.Rectangle getBoundsImpl()
Specified by:
getBoundsImpl in class Glyph
Returns:
your bounds without having the AffineTransform applied to them

pointInsideImpl

protected boolean pointInsideImpl(int x,
                                  int y)
Description copied from class: Glyph
Return if the point is inside your glyph without the AffineTransform applied

Specified by:
pointInsideImpl in class Glyph

mouseDoubleClick

public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent arg0)
Specified by:
mouseDoubleClick in interface org.eclipse.swt.events.MouseListener

mouseDown

public void mouseDown(org.eclipse.swt.events.MouseEvent me)
Specified by:
mouseDown in interface org.eclipse.swt.events.MouseListener

mouseUp

public void mouseUp(org.eclipse.swt.events.MouseEvent arg0)
Specified by:
mouseUp in interface org.eclipse.swt.events.MouseListener

getDeltaLat

protected double getDeltaLat(int pixelsMoved)

getDeltaLon

protected double getDeltaLon(int pixelsMoved)

mouseMoved

protected void mouseMoved(org.eclipse.swt.events.MouseEvent me)

enter

protected void enter(org.eclipse.swt.events.MouseEvent me)
Overrides:
enter in class Glyph

leave

protected void leave(org.eclipse.swt.events.MouseEvent me)
Overrides:
leave in class Glyph