1014 |
*/ |
*/ |
1015 |
protected void drawRectangle(final Graphics graphics, final Point startPos, |
protected void drawRectangle(final Graphics graphics, final Point startPos, |
1016 |
final Point e) { |
final Point e) { |
1017 |
drawRectangle(graphics, startPos, e, Color.WHITE); |
drawRectangle(graphics, startPos, e, Color.WHITE, false); |
1018 |
} |
} |
1019 |
|
|
1020 |
/** |
/** |
1022 |
* given point. All in screen coordinates. |
* given point. All in screen coordinates. |
1023 |
*/ |
*/ |
1024 |
protected void drawRectangle(final Graphics graphics, final Point startPos, |
protected void drawRectangle(final Graphics graphics, final Point startPos, |
1025 |
final Point e, Color color) { |
final Point e, Color color, boolean fill) { |
1026 |
|
|
1027 |
if (!isWellDefined()) |
if (!isWellDefined()) |
1028 |
return; |
return; |
1039 |
return; |
return; |
1040 |
|
|
1041 |
graphics.setXORMode(color); |
graphics.setXORMode(color); |
1042 |
|
|
1043 |
|
if (fill) { |
1044 |
|
graphics.fillRect(left, bottom, width, height); |
1045 |
|
graphics.setXORMode(Color.WHITE); |
1046 |
|
} |
1047 |
|
|
1048 |
|
|
1049 |
graphics.drawRect(left, bottom, width, height); |
graphics.drawRect(left, bottom, width, height); |
1050 |
} |
} |
1051 |
|
|
2012 |
xMapPaneMouseListener.actions.put(type, action); |
xMapPaneMouseListener.actions.put(type, action); |
2013 |
} |
} |
2014 |
|
|
2015 |
|
/** |
2016 |
|
* Configure the tool that active on the map |
2017 |
|
*/ |
2018 |
public void setTool(XMapPaneTool tool) { |
public void setTool(XMapPaneTool tool) { |
2019 |
this.tool = tool; |
this.tool = tool; |
2020 |
xMapPaneMouseListener.configure(tool); |
xMapPaneMouseListener.configure(tool); |