Permalink
Browse files

Merge branch 'master' into mirror

  • Loading branch information...
2 parents 826ee21 + 5185383 commit c650f19d19ab94a71c17f7f6d0d7a75f37251df2 JOSM GitHub mirror committed Aug 27, 2012
View
@@ -139,6 +139,7 @@ Build-Date: ${build.tstamp}
packagenames="org.openstreetmap.josm.*,org.openstreetmap.gui.jmapviewer.*"
windowtitle="JOSM"
use="true"
+ private="true"
linksource="true"
author="false">
<link href="http://docs.oracle.com/javase/6/docs/api"/>
@@ -15,6 +15,7 @@
import java.lang.ref.WeakReference;
import java.net.URI;
import java.net.URISyntaxException;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -150,31 +151,73 @@ static public boolean isDisplayingMapView() {
*/
public MainMenu menu;
+ /**
+ * The data validation handler.
+ */
public OsmValidator validator;
/**
* The MOTD Layer.
*/
private GettingStarted gettingStarted = new GettingStarted();
/**
- * Print a message if logging is on.
+ * Logging level (3 = debug, 2 = info, 1 = warn, 0 = none).
*/
static public int log_level = 2;
+ /**
+ * Print a warning message if logging is on.
+ * @param msg The message to print.
+ */
static public void warn(String msg) {
if (log_level < 1)
return;
System.out.println(msg);
}
+ /**
+ * Print an informational message if logging is on.
+ * @param msg The message to print.
+ */
static public void info(String msg) {
if (log_level < 2)
return;
System.out.println(msg);
}
+ /**
+ * Print an debug message if logging is on.
+ * @param msg The message to print.
+ */
static public void debug(String msg) {
if (log_level < 3)
return;
System.out.println(msg);
}
+ /**
+ * Print a formated warning message if logging is on. Calls {@link MessageFormat#format}
+ * function to format text.
+ * @param msg The formated message to print.
+ * @param objects The objects to insert into format string.
+ */
+ static public void warn(String msg, Object... objects) {
+ warn(MessageFormat.format(msg, objects));
+ }
+ /**
+ * Print a formated informational message if logging is on. Calls {@link MessageFormat#format}
+ * function to format text.
+ * @param msg The formated message to print.
+ * @param objects The objects to insert into format string.
+ */
+ static public void info(String msg, Object... objects) {
+ info(MessageFormat.format(msg, objects));
+ }
+ /**
+ * Print a formated debug message if logging is on. Calls {@link MessageFormat#format}
+ * function to format text.
+ * @param msg The formated message to print.
+ * @param objects The objects to insert into format string.
+ */
+ static public void debug(String msg, Object... objects) {
+ debug(MessageFormat.format(msg, objects));
+ }
/**
* Platform specific code goes in here.
@@ -25,15 +25,15 @@
* {@link OsmPrimitive}s. In particular, it represents conflicts in the coordinates of {@link Node}s and
* the deleted or visible state of {@link OsmPrimitive}s.
*
- * This model is an {@link Observable}. It notifies registered {@link Observer}s whenever the
+ * This model is an {@link Observable}. It notifies registered {@link java.util.Observer}s whenever the
* internal state changes.
*
* This model also emits property changes for {@link #RESOLVED_COMPLETELY_PROP}. Property change
* listeners may register themselves using {@link #addPropertyChangeListener(PropertyChangeListener)}.
*
* @see Node#getCoor()
- * @see OsmPrimitive#deleted
- * @see OsmPrimitive#visible
+ * @see OsmPrimitive#isDeleted
+ * @see OsmPrimitive#isVisible
*
*/
public class PropertiesMergeModel extends Observable {
@@ -119,10 +119,9 @@ public boolean isDeletedStateDecision(MergeDecisionType decision) {
}
/**
- * populates the model with the differences between my and their version
+ * Populates the model with the differences between local and server version
*
- * @param my my version of the primitive
- * @param their their version of the primitive
+ * @param conflict The conflict information
*/
public void populate(Conflict<? extends OsmPrimitive> conflict) {
this.my = conflict.getMy();
@@ -150,21 +149,21 @@ public void populate(Conflict<? extends OsmPrimitive> conflict) {
/**
* replies the coordinates of my {@link OsmPrimitive}. null, if my primitive hasn't
- * coordinates (i.e. because it is a {@link Way}).
+ * coordinates (i.e. because it is a {@link org.openstreetmap.josm.data.osm.Way}).
*
* @return the coordinates of my {@link OsmPrimitive}. null, if my primitive hasn't
- * coordinates (i.e. because it is a {@link Way}).
+ * coordinates (i.e. because it is a {@link org.openstreetmap.josm.data.osm.Way}).
*/
public LatLon getMyCoords() {
return myCoords;
}
/**
* replies the coordinates of their {@link OsmPrimitive}. null, if their primitive hasn't
- * coordinates (i.e. because it is a {@link Way}).
+ * coordinates (i.e. because it is a {@link org.openstreetmap.josm.data.osm.Way}).
*
* @return the coordinates of my {@link OsmPrimitive}. null, if my primitive hasn't
- * coordinates (i.e. because it is a {@link Way}).
+ * coordinates (i.e. because it is a {@link org.openstreetmap.josm.data.osm.Way}).
*/
public LatLon getTheirCoords() {
return theirCoords;
@@ -188,7 +187,7 @@ public LatLon getMergedCoords() {
}
/**
- * decides a conflict between my and their coordinates
+ * Decides a conflict between local and server coordinates
*
* @param decision the decision
*/
@@ -200,17 +199,25 @@ public void decideCoordsConflict(MergeDecisionType decision) {
}
/**
- * replies my deleted state,
- * @return
+ * Replies deleted state of local dataset
+ * @return The state of deleted flag
*/
public Boolean getMyDeletedState() {
return myDeletedState;
}
+ /**
+ * Replies deleted state of Server dataset
+ * @return The state of deleted flag
+ */
public Boolean getTheirDeletedState() {
return theirDeletedState;
}
+ /**
+ * Replies deleted state of combined dataset
+ * @return The state of deleted flag
+ */
public Boolean getMergedDeletedState() {
switch(deletedMergeDecision) {
case KEEP_MINE: return myDeletedState;
@@ -222,16 +229,16 @@ public Boolean getMergedDeletedState() {
}
/**
- * returns my referrers,
- * @return my referrers
+ * Returns local referrers
+ * @return The referrers
*/
public List<OsmPrimitive> getMyReferrers() {
return myReferrers;
}
/**
- * returns their referrers,
- * @return their referrers
+ * Returns server referrers
+ * @return The referrers
*/
public List<OsmPrimitive> getTheirReferrers() {
return theirReferrers;
@@ -288,7 +295,7 @@ public boolean hasCoordConflict() {
* replies true if my and their primitive have a conflict between
* their deleted states
*
- * @return true if my and their primitive have a conflict between
+ * @return <code>true</code> if my and their primitive have a conflict between
* their deleted states
*/
public boolean hasDeletedStateConflict() {
@@ -298,7 +305,7 @@ public boolean hasDeletedStateConflict() {
/**
* replies true if all conflict in this model are resolved
*
- * @return true if all conflict in this model are resolved; false otherwise
+ * @return <code>true</code> if all conflict in this model are resolved; <code>false</code> otherwise
*/
public boolean isResolvedCompletely() {
boolean ret = true;
@@ -312,11 +319,10 @@ public boolean isResolvedCompletely() {
}
/**
- * builds the command(s) to apply the conflict resolutions to my primitive
+ * Builds the command(s) to apply the conflict resolutions to my primitive
*
- * @param my my primitive
- * @param their their primitive
- * @return the list of commands
+ * @param conflict The conflict information
+ * @return The list of commands
*/
public List<Command> buildResolveCommand(Conflict<? extends OsmPrimitive> conflict) {
List<Command> cmds = new ArrayList<Command>();
Oops, something went wrong.

0 comments on commit c650f19

Please sign in to comment.