Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 35 additions & 36 deletions roaddesign/.classpath
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/lwjgl/jinput.jar"/>
<classpathentry kind="lib" path="lib/lwjgl/lwjgl_util_applet.jar"/>
<classpathentry kind="lib" path="lib/lwjgl/lwjgl_util.jar"/>
<classpathentry kind="lib" path="lib/lwjgl/lwjgl.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="roaddesign/lib/lwjgl/native/windows"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="C:/Users/Desktop/Documents/RoadVisualizer/jME_2.0.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/lwjgl/jinput.jar"/>
<classpathentry kind="lib" path="lib/lwjgl/lwjgl_util_applet.jar"/>
<classpathentry kind="lib" path="lib/lwjgl/lwjgl_util.jar"/>
<classpathentry kind="lib" path="lib/lwjgl/lwjgl.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="roaddesign/lib/lwjgl/native/windows"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
16 changes: 8 additions & 8 deletions roaddesign/properties.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#Game Settings written by com.jme.app.BaseGame$BaseGameSettings at Fri Sep 04 19:49:05 EDT 2015
#Fri Sep 04 19:49:05 EDT 2015
FREQ=-1
WIDTH=1152
RENDERER=LWJGL
HEIGHT=864
DEPTH=24
FULLSCREEN=false
#Game Settings written by com.jme.app.BaseGame$BaseGameSettings at Sun Nov 08 14:05:06 EST 2015
#Sun Nov 08 14:05:06 EST 2015
FREQ=-1
WIDTH=1152
RENDERER=LWJGL
HEIGHT=864
DEPTH=24
FULLSCREEN=false
84 changes: 37 additions & 47 deletions roaddesign/roaddesign.log
Original file line number Diff line number Diff line change
@@ -1,47 +1,37 @@
Sep 04, 2015 7:48:21 PM com.sim.central.RoadDesign start
INFO: Starting RoadDesign
Sep 04, 2015 7:48:22 PM com.sim.central.RoadDesign installHandlers
INFO: Installing event handlers for application frame components...
Sep 04, 2015 7:48:22 PM com.sim.central.RoadDesign installHandlers
INFO: Installing event handlers for application frame components...Succeed
Sep 04, 2015 7:48:22 PM com.sim.central.RoadDesign installBuilders
INFO: Installing builders for network components...
Sep 04, 2015 7:48:22 PM com.sim.central.RoadDesign installBuilders
INFO: Installing builders for network components...Succeed
Sep 04, 2015 7:48:22 PM com.sim.network.RoadNetworkController findController
INFO: Building road network controller
Sep 04, 2015 7:48:22 PM com.sim.network.RoadNetworkController findController
INFO: Building road network controller...Succeed
Sep 04, 2015 7:48:22 PM com.sim.central.RoadDesign start
INFO: RoadDesign started
Sep 04, 2015 7:48:38 PM com.sim.central.RoadDesign getXsec
INFO: XSEC: numOfLanes = 1 laneWidth = 12.0 laneSlope = 0.0 shoulderWidth = 1.0 shoulderSlope = 2.0 medianWidth = 20.0
Sep 04, 2015 7:48:38 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (-2509.000, -1049.000, 0.000)
Sep 04, 2015 7:48:39 PM com.sim.central.RoadDesign getCurveParam
INFO: CURVE_PARAM: SPEED=35.000 GRADE=0.000 SUPERELEVATION=4.000
Sep 04, 2015 7:48:39 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (-114.000, 1181.000, 0.000)
Sep 04, 2015 7:48:40 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_CLOSE: (-48.000, 969.000, 0.000)
Sep 04, 2015 7:48:52 PM com.sim.central.RoadDesign getXsec
INFO: XSEC: numOfLanes = 1 laneWidth = 12.0 laneSlope = 0.0 shoulderWidth = 1.0 shoulderSlope = 2.0 medianWidth = 20.0
Sep 04, 2015 7:48:52 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (-2745.000, 492.000, 0.000)
Sep 04, 2015 7:48:54 PM com.sim.central.RoadDesign getCurveParam
INFO: CURVE_PARAM: SPEED=35.000 GRADE=0.000 SUPERELEVATION=4.000
Sep 04, 2015 7:48:54 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (-415.000, -337.000, 0.000)
Sep 04, 2015 7:48:54 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_CLOSE: (-330.000, -167.000, 0.000)
Sep 04, 2015 7:49:02 PM com.sim.central.RoadDesign confirm
INFO: USER_CHOICE: YES C:\Users\Desktop\Documents\RoadVisualizer\RoadVisualizer\roaddesign is not empty!
Do you want to override these files.
Sep 04, 2015 7:49:03 PM com.sim.io.exporters.basic.BasicHeightMapExporter export
INFO: Height map saved successfully
Sep 04, 2015 7:49:03 PM com.sim.gui.handler.SaveHandler actionPerformed
INFO: Model saved to C:\Users\Desktop\Documents\RoadVisualizer\RoadVisualizer\roaddesign
Sep 04, 2015 7:49:03 PM com.sim.central.RoadDesign$1 run
INFO: Starting the renderer...
Sep 04, 2015 7:49:28 PM com.sim.central.RoadDesign$1 run
INFO: The renderer completes successfully
Nov 08, 2015 2:04:53 PM com.sim.central.RoadDesign start
INFO: Starting RoadDesign
Nov 08, 2015 2:04:54 PM com.sim.central.RoadDesign installHandlers
INFO: Installing event handlers for application frame components...
Nov 08, 2015 2:04:54 PM com.sim.central.RoadDesign installHandlers
INFO: Installing event handlers for application frame components...Succeed
Nov 08, 2015 2:04:54 PM com.sim.central.RoadDesign installBuilders
INFO: Installing builders for network components...
Nov 08, 2015 2:04:54 PM com.sim.central.RoadDesign installBuilders
INFO: Installing builders for network components...Succeed
Nov 08, 2015 2:04:54 PM com.sim.network.RoadNetworkController findController
INFO: Building road network controller
Nov 08, 2015 2:04:54 PM com.sim.network.RoadNetworkController findController
INFO: Building road network controller...Succeed
Nov 08, 2015 2:04:54 PM com.sim.central.RoadDesign start
INFO: RoadDesign started
Nov 08, 2015 2:04:56 PM com.sim.central.RoadDesign getXsec
INFO: XSEC: numOfLanes = 1 laneWidth = 12.0 laneSlope = 0.0 shoulderWidth = 10.0 shoulderSlope = 2.0 medianWidth = 20.0
Nov 08, 2015 2:04:56 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (-3829.000, -1254.000, 0.000)
Nov 08, 2015 2:04:57 PM com.sim.central.RoadDesign getCurveParam
INFO: CURVE_PARAM: SPEED=35.000 GRADE=0.000 SUPERELEVATION=4.000
Nov 08, 2015 2:04:57 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (416.000, 1141.000, 0.000)
Nov 08, 2015 2:04:58 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_CLOSE: (976.000, 1121.000, 0.000)
Nov 08, 2015 2:05:01 PM com.sim.central.RoadDesign confirm
INFO: USER_CHOICE: YES C:\Users\Desktop\Documents\RoadVisualizer2\roaddesign is not empty!
Do you want to overwrite your existing road design?
Nov 08, 2015 2:05:01 PM com.sim.io.exporters.basic.BasicHeightMapExporter export
INFO: Height map saved successfully
Nov 08, 2015 2:05:01 PM com.sim.gui.handler.SaveHandler actionPerformed
INFO: Model saved to C:\Users\Desktop\Documents\RoadVisualizer2\roaddesign
Nov 08, 2015 2:05:04 PM com.sim.central.RoadDesign$1 run
INFO: Starting the renderer...
Nov 08, 2015 2:06:14 PM com.sim.central.RoadDesign$1 run
INFO: The renderer completes successfully
59 changes: 43 additions & 16 deletions roaddesign/roaddesign.log.1
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
Sep 04, 2015 7:19:16 PM com.sim.central.RoadDesign start
INFO: Starting RoadDesign
Sep 04, 2015 7:19:16 PM com.sim.central.RoadDesign installHandlers
INFO: Installing event handlers for application frame components...
Sep 04, 2015 7:19:16 PM com.sim.central.RoadDesign installHandlers
INFO: Installing event handlers for application frame components...Succeed
Sep 04, 2015 7:19:16 PM com.sim.central.RoadDesign installBuilders
INFO: Installing builders for network components...
Sep 04, 2015 7:19:16 PM com.sim.central.RoadDesign installBuilders
INFO: Installing builders for network components...Succeed
Sep 04, 2015 7:19:16 PM com.sim.network.RoadNetworkController findController
INFO: Building road network controller
Sep 04, 2015 7:19:16 PM com.sim.network.RoadNetworkController findController
INFO: Building road network controller...Succeed
Sep 04, 2015 7:19:16 PM com.sim.central.RoadDesign start
INFO: RoadDesign started
Nov 08, 2015 1:22:33 PM com.sim.central.RoadDesign start
INFO: Starting RoadDesign
Nov 08, 2015 1:22:34 PM com.sim.central.RoadDesign installHandlers
INFO: Installing event handlers for application frame components...
Nov 08, 2015 1:22:34 PM com.sim.central.RoadDesign installHandlers
INFO: Installing event handlers for application frame components...Succeed
Nov 08, 2015 1:22:34 PM com.sim.central.RoadDesign installBuilders
INFO: Installing builders for network components...
Nov 08, 2015 1:22:34 PM com.sim.central.RoadDesign installBuilders
INFO: Installing builders for network components...Succeed
Nov 08, 2015 1:22:34 PM com.sim.network.RoadNetworkController findController
INFO: Building road network controller
Nov 08, 2015 1:22:34 PM com.sim.network.RoadNetworkController findController
INFO: Building road network controller...Succeed
Nov 08, 2015 1:22:34 PM com.sim.central.RoadDesign start
INFO: RoadDesign started
Nov 08, 2015 1:22:37 PM com.sim.central.RoadDesign getXsec
INFO: XSEC: numOfLanes = 1 laneWidth = 12.0 laneSlope = 0.0 shoulderWidth = 10.0 shoulderSlope = 2.0 medianWidth = 20.0
Nov 08, 2015 1:22:37 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (-4149.000, -1454.000, 0.000)
Nov 08, 2015 1:22:39 PM com.sim.central.RoadDesign getCurveParam
INFO: CURVE_PARAM: SUPERELEVATION=4.000 GRADE=0.000 SPEED=35.000
Nov 08, 2015 1:22:39 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (1228.000, 1436.000, 0.000)
Nov 08, 2015 1:22:39 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_CLOSE: (953.000, 896.000, 0.000)
Nov 08, 2015 1:22:42 PM com.sim.central.RoadDesign getXsec
INFO: XSEC: numOfLanes = 1 laneWidth = 12.0 laneSlope = 0.0 shoulderWidth = 10.0 shoulderSlope = 2.0 medianWidth = 20.0
Nov 08, 2015 1:22:42 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (138.000, -1109.000, 0.000)
Nov 08, 2015 1:22:43 PM com.sim.central.RoadDesign getCurveParam
INFO: CURVE_PARAM: SUPERELEVATION=4.000 GRADE=0.000 SPEED=35.000
Nov 08, 2015 1:22:43 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_ADD: (-2702.000, 766.000, 0.000)
Nov 08, 2015 1:22:45 PM com.sim.gui.handler.MainMouseHandler mouseClicked
INFO: PT_CLOSE: (-2532.000, 184.000, 0.000)
Nov 08, 2015 1:22:53 PM com.sim.central.RoadDesign confirm
INFO: USER_CHOICE: YES C:\Users\Desktop\Documents\RoadVisualizer2\roaddesign is not empty!
Do you want to overwrite this file?
Nov 08, 2015 1:22:55 PM com.sim.io.exporters.basic.BasicHeightMapExporter export
INFO: Height map saved successfully
Nov 08, 2015 1:22:55 PM com.sim.gui.handler.SaveHandler actionPerformed
INFO: Model saved to C:\Users\Desktop\Documents\RoadVisualizer2\roaddesign
4 changes: 0 additions & 4 deletions roaddesign/src/main/java/com/sim/central/Builders.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package com.sim.central;

import java.util.EventListener;

import java.util.HashMap;
import java.util.Map;

import com.sim.core.basic.*;
import com.sim.gui.FrameComponents;
import com.sim.intersections.IntersectionBuilder;
import com.sim.intersections.basic.BasicIntersectionBuilder;
import com.sim.roads.RoadBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.*;
import java.util.EventListener;
import java.util.HashMap;
import java.util.Map;

import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;

import com.sim.gui.FrameComponents;
import com.sim.gui.ViewMode;
import com.sim.gui.handler.MainMouseHandler;
import com.sim.gui.handler.RenderHandler;
import com.sim.gui.handler.ResetHandler;
import com.sim.gui.handler.SaveHandler;
import com.sim.roads.RoadTypes;


/**
Expand Down Expand Up @@ -65,7 +65,7 @@ public void actionPerformed(ActionEvent e) {
_handlers.handlers.put(FrameComponents.TOOLBAR_VIEW_MODE_BOX,
new ActionListener(){
public void actionPerformed(ActionEvent e) {
JComboBox box = (JComboBox)e.getSource();
JComboBox<?> box = (JComboBox<?>)e.getSource();
RoadDesign.setViewMode(
(ViewMode) box.getSelectedItem());
}
Expand Down
23 changes: 15 additions & 8 deletions roaddesign/src/main/java/com/sim/central/Logging.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
package com.sim.central;

import java.io.IOException;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;


/**
* This class is used to statically access a {@link java.util.logging.Logger}.
* The logger uses a {@link java.util.logging.FileHandler} as a handler to write the log messages to a file.
* After displaying the log to the console, it is logged to the file specified by the {@link java.util.logging.FileHandler}.
* @author Dahai Guo
*/

public class Logging {
private static Logger logger = null;
private static Logger logger = null;

public static boolean init(){
FileHandler fh = null;
SimpleFormatter formatterTxt = new SimpleFormatter();
try {
fh = new FileHandler(
RoadDesign.getProperty(RoadDesign.LOG_FILE_NAME));
RoadDesign.getProperty(RoadDesign.LOG_FILE_NAME)); // specifies the FileHandler write to the log file specified in the properties file

fh.setFormatter(formatterTxt);
} catch (SecurityException e) {
Expand All @@ -28,14 +32,17 @@ public static boolean init(){
return false;
}

logger = Logger.getLogger("sim");
logger = Logger.getLogger("sim"); // Creates a new logger with the name "sim".
logger.setLevel(Level.ALL);
logger.addHandler(fh);
logger.addHandler(fh); // logs to the file specified by the FileHandler

return true;
return true; // initialization was successful
}

public static Logger getLogger(){
/**
* @return a reference to the static logger.
*/
public static Logger getLogger(){
return logger;
}
}
8 changes: 4 additions & 4 deletions roaddesign/src/main/java/com/sim/central/ModelPathState.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
*/
public enum ModelPathState {
/**
* The files in the model path is consistent. The renderer should be able to
* The files in the model path are consistent. The renderer should be able to
* render it.
* @see com.sim.renderer.AutoGenLoader
*/
OK,

/**
* The files in the model path is not consistent. The renderer will not be able to
* The files in the model path are not consistent. The renderer will not be able to
* render it.
* @see com.sim.renderer.AutoGenLoader
*/
Expand All @@ -34,11 +34,11 @@ public enum ModelPathState {
EMPTY,

/**
* The model path points to a non-existing directory.
* The model path points to a non-existent directory.
*/
NON_EXIST;

/**
/**
* Checks the state of the directory where the model is supposed to
* be saved.
* <p>
Expand Down
Loading