AllTopics.java
Go to the documentation of this file.
00001 /*
00002 copyright 2014 UNL Nimbus Lab 
00003 
00004   Licensed under the Apache License, Version 2.0 (the "License");
00005      you may not use this file except in compliance with the License.
00006     You may obtain a copy of the License at
00007   
00008         http://www.apache.org/licenses/LICENSE-2.0
00009   
00010     Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013    See the License for the specific language governing permissions and
00014   limitations under the License.
00015 */
00016 package edu.nimbus.glass.screens;
00017 
00018 import android.graphics.Canvas;
00019 import android.text.TextPaint;
00020 import edu.nimbus.glass.TopicManager;
00021 
00022 
00027 public class AllTopics implements Screen{
00028 
00029         public AllTopics(){
00030 
00031         }
00032 
00033         @Override
00034         public void draw(TopicManager tm, TextPaint mTopicPaint, Canvas canvas, int width, int height) {
00035                 String text = tm.getText();
00036                 String[] arr = text.split("\n");
00037                 //every field gets screen_height / # of fields space.
00038                 double dist = height / (arr.length);
00039                 
00040                 mTopicPaint.setTextSize((float)dist);
00041                 for(int i=0;i< arr.length;i++){
00042                         String val =  "\t" + arr[i];
00043                         canvas.drawText(TopicManager.performFormatting(val), 0, (float)  ((i+1) * dist) , mTopicPaint);
00044                 }
00045         }
00046 }


ros_glass_tools
Author(s):
autogenerated on Thu Aug 27 2015 14:47:21