1 package jarmos.app.activity;
7 import android.app.AlertDialog;
8 import android.app.Dialog;
9 import android.app.TabActivity;
10 import android.content.DialogInterface;
11 import android.content.Intent;
12 import android.content.res.ColorStateList;
13 import android.graphics.Color;
14 import android.os.Bundle;
15 import android.text.SpannableString;
16 import android.text.method.LinkMovementMethod;
17 import android.text.util.Linkify;
18 import android.widget.TabHost;
19 import android.widget.TextView;
20 import android.widget.Toast;
40 protected void onCreate(Bundle savedInstanceState) {
41 super.onCreate(savedInstanceState);
43 final TabHost tabHost = getTabHost();
48 TextView label1 =
new TextView(
this);
49 label1.setGravity(android.view.Gravity.CENTER);
50 label1.setTextSize(16);
52 label1.setTextColor(
new ColorStateList(
new int[][] {
new int[] { android.R.attr.state_selected },
new int[0] },
53 new int[] { Color.WHITE, Color.GRAY, }));
54 label1.setSelected(
true);
56 TextView label2 =
new TextView(
this);
57 label2.setGravity(android.view.Gravity.CENTER);
58 label2.setTextSize(16);
59 label2.setTextColor(
new ColorStateList(
new int[][] {
new int[] { android.R.attr.state_selected },
new int[0] },
60 new int[] { Color.WHITE, Color.GRAY, }));
61 label2.setSelected(
false);
64 TabHost.TabSpec one = tabHost.newTabSpec(
"tab 1");
65 label1.setText(
"About ");
66 one.setIndicator(label1);
68 intentOne.putExtras(getIntent().getExtras());
69 one.setContent(intentOne);
72 TabHost.TabSpec two = tabHost.newTabSpec(
"tab 2");
73 label2.setText(
"Solve problem");
74 two.setIndicator(label2);
75 Intent intentTwo = null;
84 Log.e(
"ShowModelActitity",
"Unknown model type: " + mt);
85 Toast.makeText(
this,
"Unknown model type: " + mt, Toast.LENGTH_LONG).show();
89 intentTwo.putExtras(getIntent().getExtras());
90 two.setContent(intentTwo);
94 tabHost.setCurrentTab(0);
102 getLocalActivityManager().removeAllActivities();
149 AlertDialog.Builder about_builder =
new AlertDialog.Builder(ShowModelActivity.this);
151 .setTitle(
"rbAPPmit version 0.1")
153 "rbAPPmit:\nAn Android front-end for the Reduced Basis Method\n\n"
154 +
"Copyright (C) 2010\nDavid Knezevic\nPhuong Huynh\n\n" +
"Implementation by:\n"
155 +
"David Knezevic\n" +
"Phuong Huynh\n" +
"Mark Wittels\n\n"
156 +
"This is free software released under the GPLv3 license")
157 .setPositiveButton(
"OK",
new DialogInterface.OnClickListener() {
158 public void onClick(DialogInterface dialog,
int id) {
162 dialog = about_builder.create();
168 final SpannableString s =
new SpannableString(
169 "Set RB dimension slider to specify the number of basis functions in the approximation.\n\n"
170 +
"Set the parameters at which the solve is performed via the parameter sliders or by pressing the adjacent parameter buttons.\n\n"
171 +
"Hit solve to perform the reduced basis solve and visualize output(s) and field variable(s).\n\n"
172 +
"For more information see http://augustine.mit.edu/methodology.htm");
173 Linkify.addLinks(s, Linkify.WEB_URLS);
175 message.setTextSize(18);
176 message.setPadding(5, 5, 5, 5);
177 message.setMovementMethod(LinkMovementMethod.getInstance());
179 AlertDialog.Builder help_builder =
new AlertDialog.Builder(ShowModelActivity.this);
180 help_builder.setTitle(
"rbAPPmit help").setView(message)
181 .setPositiveButton(
"OK",
new DialogInterface.OnClickListener() {
182 public void onClick(DialogInterface dialog,
int id) {
187 dialog = help_builder.create();
Main model options display activity.
void onCreate(Bundle savedInstanceState)
An rbappmit-model of old data format, compatible with JRB models.
This is the main Activity class for the app.
Known model types within the JaRMoSBase project.
The JKerMor model simulation activity.
An activity which displays URLs in a simple browser.
Provides a Log class imitating the Android Log class when not used on android systems.
static final int HELP_DIALOG_ID
Dialog onCreateDialog(int id)
Re-populates the main menu every time it is brought up depending on whether help should be displayed...
static final int ABOUT_DIALOG_ID