108 |
|
|
109 |
private final static Logger LOGGER = Logger.getLogger(XMapPane.class); |
private final static Logger LOGGER = Logger.getLogger(XMapPane.class); |
110 |
|
|
111 |
/** A flag indicating whether the {@link XMapPane} is accepting repaints from the EDT. @see {@link XMapPane#setPainting(boolean)) **/ |
/** |
112 |
|
* A flag indicating whether the {@link XMapPane} is accepting repaints from |
113 |
|
* the EDT. @see {@link XMapPane#setPainting(boolean)) |
114 |
|
**/ |
115 |
private boolean acceptsRepaintCalls = true; |
private boolean acceptsRepaintCalls = true; |
116 |
|
|
117 |
/** |
/** |
577 |
|
|
578 |
private AffineTransform worldToScreen; |
private AffineTransform worldToScreen; |
579 |
|
|
580 |
// /** |
// /** |
581 |
// * This {@link MouseListener} is managing all zoom related tasks |
// * This {@link MouseListener} is managing all zoom related tasks |
582 |
// */ |
// */ |
583 |
// private final ZoomXMapPaneMouseListener zoomMapPaneMouseListener = new ZoomXMapPaneMouseListener( |
// private final ZoomXMapPaneMouseListener zoomMapPaneMouseListener = new |
584 |
// this); |
// ZoomXMapPaneMouseListener( |
585 |
|
// this); |
586 |
|
|
587 |
/** |
/** |
588 |
* This {@link MouseListener} is managing all zoom related tasks |
* This {@link MouseListener} is managing all zoom related tasks |
589 |
*/ |
*/ |
590 |
private final XMapPaneMouseListener xMapPaneMouseListener = new XMapPaneMouseListener(this); |
private final XMapPaneMouseListener xMapPaneMouseListener = new XMapPaneMouseListener( |
591 |
|
this); |
592 |
|
|
593 |
/** Is set if a renderer has an error **/ |
/** Is set if a renderer has an error **/ |
594 |
protected ArrayList<Exception> renderingErrors = new ArrayList<Exception>(); |
protected ArrayList<Exception> renderingErrors = new ArrayList<Exception>(); |
632 |
this.addMouseListener(xMapPaneMouseListener); |
this.addMouseListener(xMapPaneMouseListener); |
633 |
this.addMouseMotionListener(xMapPaneMouseListener); |
this.addMouseMotionListener(xMapPaneMouseListener); |
634 |
this.addMouseWheelListener(xMapPaneMouseListener); |
this.addMouseWheelListener(xMapPaneMouseListener); |
635 |
xMapPaneMouseListener.actions.put(MouseInputType.RClick, XMapPaneAction.ZOOM_IN); |
xMapPaneMouseListener.actions.put(MouseInputType.LClick, |
636 |
xMapPaneMouseListener.actions.put(MouseInputType.RDrag, XMapPaneAction.ZOOM_IN); |
XMapPaneAction.ZOOM_IN); |
637 |
|
xMapPaneMouseListener.actions.put(MouseInputType.LDrag, |
638 |
xMapPaneMouseListener.actions.put(MouseInputType.LClick, XMapPaneAction.ZOOM_OUT); |
XMapPaneAction.ZOOM_IN); |
639 |
xMapPaneMouseListener.actions.put(MouseInputType.LDrag, XMapPaneAction.ZOOM_OUT); |
xMapPaneMouseListener.actions.put(MouseInputType.Wheel, |
640 |
|
XMapPaneAction.ZOOM_IN); |
641 |
|
|
642 |
|
xMapPaneMouseListener.actions.put(MouseInputType.RClick, |
643 |
|
XMapPaneAction.ZOOM_OUT); |
644 |
|
|
645 |
|
xMapPaneMouseListener.actions.put(MouseInputType.RDrag, |
646 |
|
XMapPaneAction.ZOOM_OUT); |
647 |
|
|
648 |
/* |
/* |
649 |
* We use a Timer object to avoid rendering delays and flickering when |
* We use a Timer object to avoid rendering delays and flickering when |
1008 |
|
|
1009 |
removeAll(); |
removeAll(); |
1010 |
} |
} |
1011 |
|
|
1012 |
/** |
/** |
1013 |
* Draws a rectangle in XOR mode from the origin at {@link #startPos} to the |
* Draws a rectangle in XOR mode from the origin at {@link #startPos} to the |
1014 |
* given point. All in screen coordinates. |
* given point. All in screen coordinates. |
1702 |
|
|
1703 |
if (mapArea == null) |
if (mapArea == null) |
1704 |
return; |
return; |
1705 |
|
|
1706 |
final ReferencedEnvelope refMapEnv = new ReferencedEnvelope(mapArea, |
final ReferencedEnvelope refMapEnv = new ReferencedEnvelope(mapArea, |
1707 |
getMapContext().getCoordinateReferenceSystem()); |
getMapContext().getCoordinateReferenceSystem()); |
1708 |
|
|
1998 |
@Deprecated |
@Deprecated |
1999 |
public void setState(final int state) { |
public void setState(final int state) { |
2000 |
this.state = state; |
this.state = state; |
|
|
|
|
// throw new RuntimeException("Old concept.. migrate to new concept!"); |
|
2001 |
|
|
2002 |
// xMapPaneMouseListener.setEnabled((state == ZOOM_IN |
// throw new RuntimeException("Old concept.. migrate to new concept!"); |
2003 |
// || state == ZOOM_OUT || state == PAN)); |
|
2004 |
|
// xMapPaneMouseListener.setEnabled((state == ZOOM_IN |
2005 |
|
// || state == ZOOM_OUT || state == PAN)); |
2006 |
|
|
2007 |
// Je nach Aktion den Cursor umsetzen |
// Je nach Aktion den Cursor umsetzen |
2008 |
updateCursor(); |
updateCursor(); |
2009 |
} |
} |
2010 |
|
|
2011 |
public void configureMouse(MouseInputType type, XMapPaneAction action){ |
public void configureMouse(MouseInputType type, XMapPaneAction action) { |
2012 |
|
xMapPaneMouseListener.actions.put(type, action); |
2013 |
} |
} |
2014 |
|
|
2015 |
/** |
/** |