Changeset 30116 in osm for applications
- Timestamp:
- 2013-12-07T21:43:54+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/ClockSystem.java
r26215 r30116 5 5 import java.util.Locale; 6 6 7 /** 8 * Clock system (12 or 24 hours). 9 */ 7 10 public enum ClockSystem { 8 TWELVE_HOURS, TWENTYFOUR_HOURS; 11 12 /** 12-hour clock system */ 13 TWELVE_HOURS, 14 /** 24-hour clock system */ 15 TWENTYFOUR_HOURS; 9 16 17 /** 18 * Returns the clock system for the given locale. 19 * @param locale The locale 20 * @return the clock system for the given locale 21 */ 10 22 public static ClockSystem getClockSystem(Locale locale) { 11 23 DateFormat stdFormat = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.US); -
applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java
r30114 r30116 120 120 } 121 121 122 // returns the compiled Time from the valueField 122 /** 123 * Returns the compiled Time from the valueField. 124 * @return the compiled Time from the valueField 125 */ 123 126 public ArrayList<int[]> getTime() throws Exception { 124 127 String value = valueField.getText(); … … 138 141 SyntaxException syntaxError = (SyntaxException) t; 139 142 tColumns = new int[] { syntaxError.getStartColumn(), syntaxError.getEndColumn() }; 140 info = syntaxError.get Info();143 info = syntaxError.getMessage(); 141 144 } else { 145 info = t.getMessage(); 142 146 Main.warn(t); 143 147 } … … 162 166 } 163 167 164 throw new Exception("Error in the TimeValue" );168 throw new Exception("Error in the TimeValue", t); 165 169 } 166 170 } … … 169 173 } 170 174 171 // updates the valueField with the given timeRects 175 /** 176 * Updates the valueField with the given timeRects. 177 */ 172 178 public void updateValueField(ArrayList<TimeRect> timeRects) { 173 179 if (valueField != null && timeRects != null) … … 180 186 181 187 /** 182 * @return the hourMode 188 * Returns the clock system (12 or 24 hours). 189 * @return the clock system 183 190 */ 184 191 public ClockSystem getHourMode() { -
applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java
r29854 r30116 244 244 } 245 245 246 // removes the given timerect from the panel and from the arraylist 246 /** 247 * Removes the given timerect from the panel and from the arraylist 248 */ 247 249 public void removeTimeRect(TimeRect timeRectToRemove) { 248 250 timeRects.remove(timeRectToRemove); -
applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java
r28477 r30116 19 19 import javax.swing.JPopupMenu; 20 20 21 public class TimeRect extends JPanel implements MouseListener, 22 MouseMotionListener {21 public class TimeRect extends JPanel implements MouseListener, MouseMotionListener { 22 23 23 public static final int[] transformCursorTypes = new int[] { 24 24 Cursor.MOVE_CURSOR, Cursor.N_RESIZE_CURSOR, … … 53 53 private int minuteEnd; 54 54 55 public TimeRect(OheEditor editor, int dayStart, int dayEnd, 56 int minutesStart, int minutesEnd) { 55 public TimeRect(OheEditor editor, int dayStart, int dayEnd, int minutesStart, int minutesEnd) { 57 56 this.editor = editor; 58 57 … … 117 116 } 118 117 119 public static void drawTimeRect(Graphics2D g2D, Rectangle bounds, 120 boolean isZeroMinuteInterval, boolean isOpenEndInterval) { 118 public static void drawTimeRect(Graphics2D g2D, Rectangle bounds, boolean isZeroMinuteInterval, boolean isOpenEndInterval) { 121 119 122 120 Color innerColor = new Color(135, 135, 234); … … 156 154 private int transformType; 157 155 158 // Calculate where the Component was clicked and returns the 159 // transformtype 156 // Calculate where the Component was clicked and returns the transformtype 160 157 private int getTransformType(MouseEvent evt) { 161 158 int tmpClickAreaWidth = Math.min(clickAreaSize, getWidth() / 3); -
applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/OpeningTimeCompiler.jj
r30114 r30116 50 50 import org.openstreetmap.josm.plugins.ohe.OpeningTimeUtils.DateTime; 51 51 52 public class OpeningTimeCompiler 53 { 52 public class OpeningTimeCompiler { 53 54 /** 55 * Abbreviated week days. 56 */ 54 57 public static final String[] WEEKDAYS = new String[] {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}; 55 56 public OpeningTimeCompiler(String time) 57 { 58 /** 59 * Constructs a new OpeningTimeCompiler. 60 */ 61 public OpeningTimeCompiler(String time) { 58 62 this(new ByteArrayInputStream(time.getBytes()), null); 59 63 } -
applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/SyntaxException.java
r23192 r30116 15 15 } 16 16 17 public String getInfo() {18 return info;19 }20 21 17 public SyntaxException(String info, int startColumn, int endColumn) { 18 super(info); 22 19 this.startColumn = startColumn; 23 20 this.endColumn = endColumn;
Note:
See TracChangeset
for help on using the changeset viewer.