547 |
// * {@link #xMapPaneMouseListener} is also enabled. |
// * {@link #xMapPaneMouseListener} is also enabled. |
548 |
// **/ |
// **/ |
549 |
// private int state = ZOOM_IN; |
// private int state = ZOOM_IN; |
550 |
|
// |
551 |
/** |
// /** |
552 |
* Manuell gesetzter statischer Cursor, unabhaengig von der aktuellen |
// * Manuell gesetzter statischer Cursor, unabhaengig von der aktuellen |
553 |
* MapPane-Funktion |
// * MapPane-Funktion |
554 |
*/ |
// */ |
555 |
protected Cursor staticCursor = null; |
// protected Cursor staticCursor = null; |
556 |
|
|
557 |
private AffineTransform worldToScreen; |
private AffineTransform worldToScreen; |
558 |
|
|
1291 |
// public int getState() { |
// public int getState() { |
1292 |
// return state; |
// return state; |
1293 |
// } |
// } |
1294 |
|
// |
1295 |
/** |
// /** |
1296 |
* Liefert den statisch eingestellten Cursor, der unabhaengig von der |
// * Liefert den statisch eingestellten Cursor, der unabhaengig von der |
1297 |
* eingestellten MapPane-Aktion (Zoom, Auswahl, ...) verwendet wird. |
// * eingestellten MapPane-Aktion (Zoom, Auswahl, ...) verwendet wird. |
1298 |
* |
// * |
1299 |
* @return {@code null}, wenn kein statischer Cursor verwendet, sondern der |
// * @return {@code null}, wenn kein statischer Cursor verwendet, sondern der |
1300 |
* Cursor automatisch je nach MapPane-Aktion eingestellt wird. |
// * Cursor automatisch je nach MapPane-Aktion eingestellt wird. |
1301 |
*/ |
// */ |
1302 |
public Cursor getStaticCursor() { |
// public Cursor getStaticCursor() { |
1303 |
return this.staticCursor; |
// return this.staticCursor; |
1304 |
} |
// } |
1305 |
|
|
1306 |
public AffineTransform getWorldToScreenTransform() { |
public AffineTransform getWorldToScreenTransform() { |
1307 |
if (worldToScreen == null) { |
if (worldToScreen == null) { |
1986 |
tool = XMapPaneTool.NO_ACTION; |
tool = XMapPaneTool.NO_ACTION; |
1987 |
this.tool = tool; |
this.tool = tool; |
1988 |
xMapPaneMouseListener.configure(tool); |
xMapPaneMouseListener.configure(tool); |
1989 |
setCursor(tool.cursor); |
setCursor(tool.getCursor()); |
1990 |
} |
} |
1991 |
|
|
1992 |
/** |
// /** |
1993 |
* Standardmaessig wird der Cursor automatisch je nach MapPane-Aktion (Zoom, |
// * Standardmaessig wird der Cursor automatisch je nach MapPane-Aktion (Zoom, |
1994 |
* Auswahl, ...) gesetzt. Mit dieser Methode kann ein statischer Cursor |
// * Auswahl, ...) gesetzt. Mit dieser Methode kann ein statischer Cursor |
1995 |
* gesetzt werden, der unabhaengig von der aktuellen MapPanes-Aktion |
// * gesetzt werden, der unabhaengig von der aktuellen MapPanes-Aktion |
1996 |
* beibehalten wird. Um diesen statischen Cursor wieder zu entfernen, kann |
// * beibehalten wird. Um diesen statischen Cursor wieder zu entfernen, kann |
1997 |
* {@code null} als Parameter uebergeben werden |
// * {@code null} als Parameter uebergeben werden |
1998 |
* |
// * |
1999 |
* @param cursor |
// * @param cursor |
2000 |
* Cursor |
// * Cursor |
2001 |
*/ |
// */ |
2002 |
public void setStaticCursor(final Cursor cursor) { |
// public void setStaticCursor(final Cursor cursor) { |
2003 |
this.staticCursor = cursor; |
// this.staticCursor = cursor; |
2004 |
if (cursor != null) |
// if (cursor != null) |
2005 |
super.setCursor(cursor); |
// super.setCursor(cursor); |
2006 |
} |
// } |
2007 |
|
|
2008 |
/** |
/** |
2009 |
* Starts rendering on one or two threads |
* Starts rendering on one or two threads |
2145 |
repaint(); |
repaint(); |
2146 |
} |
} |
2147 |
} |
} |
2148 |
|
// |
2149 |
// |
//// |
2150 |
// wenn manueller Cursor gesetzt ist, dann diesen verwenden (unabhaengig |
// // wenn manueller Cursor gesetzt ist, dann diesen verwenden (unabhaengig |
2151 |
// von der aktuellen Aktion |
// // von der aktuellen Aktion |
2152 |
if (this.staticCursor != null) { |
// if (this.staticCursor != null) { |
2153 |
setCursor(staticCursor); |
// setCursor(staticCursor); |
2154 |
return; |
// return; |
2155 |
} |
// } |
2156 |
|
// |
2157 |
if (getCursor() == SwingUtil.PANNING_CURSOR) { |
if (getCursor() == SwingUtil.PANNING_CURSOR) { |
2158 |
// This cursor will reset itself |
// This cursor will reset itself |
2159 |
return; |
return; |
2160 |
} |
} |
2161 |
|
|
2162 |
setCursor(tool.cursor); |
setCursor(tool.getCursor()); |
2163 |
|
|
2164 |
// |
// |
2165 |
// // Set the cursor depending on what tool is in use... |
// // Set the cursor depending on what tool is in use... |