Show the simulation name as the chart title. Made some UI concessions because drawing the events in the graph is not currently available: Moved "draw" button to series tab, changed the list entry for the events to non-selectable simple text items.
This commit is contained in:
parent
e9d743c166
commit
e2cc085bab
@ -4,12 +4,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="draw"
|
||||
android:text="Draw" />
|
||||
|
||||
<TabHost
|
||||
android:id="@+id/simulationConfigurationForm"
|
||||
android:layout_width="fill_parent"
|
||||
@ -63,6 +57,12 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawSelectorOnTop="true" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="draw"
|
||||
android:text="Draw" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
@ -48,6 +48,7 @@ public class SimulationChart {
|
||||
private FlightDataType series2;
|
||||
private final FlightDataType time = FlightDataType.TYPE_TIME;
|
||||
private List<FlightEvent> flightEvents;
|
||||
private String simulationName;
|
||||
|
||||
// Define 4 different colors and point styles to use for the series.
|
||||
// For now only 2 series are supported though.
|
||||
@ -55,6 +56,13 @@ public class SimulationChart {
|
||||
private final static PointStyle[] styles = new PointStyle[] { PointStyle.CIRCLE, PointStyle.DIAMOND,
|
||||
PointStyle.TRIANGLE, PointStyle.SQUARE };
|
||||
|
||||
/**
|
||||
* @param simulationName the simulationName to set
|
||||
*/
|
||||
public void setSimulationName(String simulationName) {
|
||||
this.simulationName = simulationName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flightDataBranch the flightDataBranch to set
|
||||
*/
|
||||
@ -116,7 +124,7 @@ public class SimulationChart {
|
||||
renderer.setYLabels(10);
|
||||
renderer.setShowGrid(true);
|
||||
renderer.setZoomButtonsVisible(true);
|
||||
renderer.setChartTitle("Simulation");
|
||||
renderer.setChartTitle(simulationName);
|
||||
|
||||
renderer.setMargins(new int[] { 50, 30, 0, 20 });
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ public class SimulationViewer extends Activity {
|
||||
eventList = (ListView) findViewById(R.id.simulationEventsList);
|
||||
|
||||
// Initialize the eventList
|
||||
ArrayAdapter<FlightEvent> events = new ArrayAdapter<FlightEvent>(this,android.R.layout.simple_list_item_multiple_choice,data.getEvents()) {
|
||||
ArrayAdapter<FlightEvent> events = new ArrayAdapter<FlightEvent>(this,android.R.layout.simple_list_item_1,data.getEvents()) {
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView,
|
||||
@ -71,7 +71,7 @@ public class SimulationViewer extends Activity {
|
||||
View v = convertView;
|
||||
if ( v == null ) {
|
||||
LayoutInflater li = getLayoutInflater();
|
||||
v = li.inflate(android.R.layout.simple_list_item_multiple_choice,null);
|
||||
v = li.inflate(android.R.layout.simple_list_item_1,null);
|
||||
}
|
||||
FlightEvent event = this.getItem(position);
|
||||
((TextView)v.findViewById(android.R.id.text1)).setText( event.getType().toString() + " " + event.getTime() + " (s)" );
|
||||
@ -79,7 +79,7 @@ public class SimulationViewer extends Activity {
|
||||
}
|
||||
|
||||
};
|
||||
eventList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
|
||||
//eventList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
|
||||
eventList.setAdapter(events);
|
||||
|
||||
series1Spinner = (Spinner) findViewById(R.id.simulationSeries1);
|
||||
@ -131,6 +131,7 @@ public class SimulationViewer extends Activity {
|
||||
Log.d(TAG,"series2 = " + series2.toString());
|
||||
|
||||
SimulationChart chart = new SimulationChart();
|
||||
chart.setSimulationName( sim.getName() );
|
||||
chart.setFlightDataBranch(data);
|
||||
chart.setSeries1(series1);
|
||||
chart.setSeries2(series2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user