Android Open Source - ArchPad C Round Template






From Project

Back to project page ArchPad.

License

The source code is released under:

GNU General Public License

If you think the Android project ArchPad listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.Andryyo.ArchPad.archeryFragment;
//from w  w  w  .  j  a  v a2 s . c  o m
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.Andryyo.ArchPad.database.CSQLiteOpenHelper;

import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: ???????
 * Date: 24.06.13
 * Time: 18:58
 * To change this template use File | Settings | File Templates.
 */
public class CRoundTemplate implements Serializable{

    private long arrowId;
    private String description;
    //??? ??? ??????? ????????????? ??????? ???????? ???????????? ???????????? ??? ?????????????
    private ArrayList<CDistanceTemplate> templates = new ArrayList<CDistanceTemplate>();

    public CRound createRound(Context context)    {
        return new CRound(context, description, templates, arrowId);
    }

    public CRoundTemplate setArrowId(long id)  {
        this.arrowId = id;
        return this;
    }

    public CRoundTemplate addDistanceTemplate(CDistanceTemplate template)  {
        templates.add(template);
        return this;
    }

    public CRoundTemplate setDescription(String description)  {
        this.description = new String(description);
        return this;
    }

    public void writeToDatabase(SQLiteDatabase database)    {
        ContentValues values = new ContentValues();
        values.put("description", description);
        try {
            values.put("template",CSQLiteOpenHelper.getObjectBytes(this));
        } catch (IOException e) {
            e.printStackTrace();
        }
        database.insert(CSQLiteOpenHelper.TABLE_ROUND_TEMPLATES, null, values);
    }
}




Java Source Code List

com.Andryyo.ArchPad.CArrow.java
com.Andryyo.ArchPad.CShot.java
com.Andryyo.ArchPad.MainActivity.java
com.Andryyo.ArchPad.archeryFragment.CArcheryFragment.java
com.Andryyo.ArchPad.archeryFragment.CCurrentEndView.java
com.Andryyo.ArchPad.archeryFragment.CDistanceTemplate.java
com.Andryyo.ArchPad.archeryFragment.CDistance.java
com.Andryyo.ArchPad.archeryFragment.CRoundTemplate.java
com.Andryyo.ArchPad.archeryFragment.CRound.java
com.Andryyo.ArchPad.archeryFragment.IOnShotAddListener.java
com.Andryyo.ArchPad.archeryFragment.?EndsCounterView.java
com.Andryyo.ArchPad.database.CSQLiteOpenHelper.java
com.Andryyo.ArchPad.note.CNoteCreateActivity.java
com.Andryyo.ArchPad.note.CNotesFragment.java
com.Andryyo.ArchPad.sight.CSightSelectFragment.java
com.Andryyo.ArchPad.sight.?SightPropertiesFragment.java
com.Andryyo.ArchPad.start.CArrowSelectView.java
com.Andryyo.ArchPad.start.CColorSelectView.java
com.Andryyo.ArchPad.start.CRoundSelectView.java
com.Andryyo.ArchPad.start.CStartFragment.java
com.Andryyo.ArchPad.start.CTargetSelectView.java
com.Andryyo.ArchPad.start.IOnFragmentSwapRequiredListener.java
com.Andryyo.ArchPad.statistics.CBorderedTextView.java
com.Andryyo.ArchPad.statistics.CRecordViewFragment.java
com.Andryyo.ArchPad.statistics.CStatisticsFragment.java
com.Andryyo.ArchPad.statistics.IOnUpdateListener.java
com.Andryyo.ArchPad.target.CEditableTargetView.java
com.Andryyo.ArchPad.target.CRing.java
com.Andryyo.ArchPad.target.CTargetView.java
com.Andryyo.ArchPad.target.CTarget.java
com.Andryyo.ArchPad.target.CZoomableTargetView.java