Android Open Source - android-weblogic-monitor Default Pie Chart






From Project

Back to project page android-weblogic-monitor.

License

The source code is released under:

GNU General Public License

If you think the Android project android-weblogic-monitor 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

/*
 * *************************************************************************
 */*from  ww w.  j  av  a 2  s  .co  m*/
 * Copyright (c) 2013 - Jeffrey A. West Designs
 *
 * This code is provided for example purposes only.  Neither Oracle nor
 * Jeffrey A. West assume any responsibility or liability for the consequences
 *  of using this code. If you choose to use this code for any reason,
 * including but not limited to its use as an example you do so at your own
 * risk and without the support of Oracle.
 *
 * This code is provided under the following licenses:
 *  - GNU General Public License (GPL-2.0)
 *
 * **************************************************************************
 */

package com.jeffreyawest.weblogic.monitor.charting;

import android.app.Activity;
import android.graphics.Color;
import android.support.v4.app.Fragment;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;

import com.jeffreyawest.weblogic.monitor.R;
import com.jeffreyawest.weblogic.monitor.WebLogicMonitor;

import org.achartengine.model.CategorySeries;
import org.achartengine.renderer.DefaultRenderer;

/**
 * Created by jeffreyawest on 8/27/13.
 */
public class DefaultPieChart extends Fragment
{

  protected CategorySeries mSeries;
  protected DefaultRenderer mRenderer;

  public DefaultPieChart()
  {
    mRenderer = new DefaultRenderer();
    mSeries = new CategorySeries("");

    mRenderer.setBackgroundColor(Color.BLACK);
    mRenderer.setApplyBackgroundColor(false);
    mRenderer.setExternalZoomEnabled(false);
    mRenderer.setZoomEnabled(false);
    mRenderer.setInScroll(false);
    mRenderer.setShowLabels(false);
    mRenderer.setShowLegend(false);
    mRenderer.setZoomButtonsVisible(false);
    mRenderer.setPanEnabled(false);
    mRenderer.setClickEnabled(false);
    mRenderer.setScale(Charting.PIE_CHART_SCALE);
    mRenderer.setLabelsColor(Color.BLACK);
    mRenderer.setStartAngle(90);

    mRenderer.setMargins(WebLogicMonitor.getInstance().getResources().getIntArray(R.array.chart_margins));

//    mRenderer.setBackgroundColor(WebLogicMonitor.getInstance().getResources().getColor(R.color.chart_background));
//    mRenderer.setChartTitleTextSize(WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_title_size));
//    mRenderer.setLabelsTextSize(WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_label_size));
//    mRenderer.setLegendHeight((int) WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_legend_height));
//    mRenderer.setLegendTextSize(WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_legend_text_size));
  }

  protected final TableRow getRow(final Activity pActivity, int pColor, String pValue)
  {

    TableRow row = new TableRow(pActivity);
    row.setPadding(2, 2, 2, 2);

    pActivity.getResources().getDimension(R.dimen.graph_fragment_legend_graphic_size);

    TextView colorView = new TextView(pActivity);
    colorView.setBackgroundColor(pColor);
    colorView.setHeight((int) pActivity.getResources().getDimension(R.dimen.graph_fragment_legend_graphic_size));
    colorView.setText("   ");
    colorView.setWidth((int) pActivity.getResources().getDimension(R.dimen.graph_fragment_legend_graphic_size));
    row.addView(colorView);

    TextView text = new TextView(pActivity);
    text.setText(pValue);
    text.setPadding(2, 2, 2, 2);
    text.setTextSize(15);
    row.addView(text);

    return row;
  }

  protected final void updateLegend(final String[] pNAME_list, final Integer[] pCOLORS, int pID)
  {
    TableLayout tl = (TableLayout) getActivity().findViewById(pID);

    if (tl != null)
    {
      tl.removeAllViews();
      for (int x = 0; x < pNAME_list.length; x++)
      {
        tl.addView(getRow(getActivity(), pCOLORS[x], pNAME_list[x]));
      }
    }
  }
}




Java Source Code List

com.jeffreyawest.http.HTTPAdapterImpl.java
com.jeffreyawest.http.HTTPAdapter.java
com.jeffreyawest.weblogic.entity.ApplicationDatasource.java
com.jeffreyawest.weblogic.entity.ApplicationTargetState.java
com.jeffreyawest.weblogic.entity.Application.java
com.jeffreyawest.weblogic.entity.ClusterServer.java
com.jeffreyawest.weblogic.entity.Cluster.java
com.jeffreyawest.weblogic.entity.DatasourceInstance.java
com.jeffreyawest.weblogic.entity.Datasource.java
com.jeffreyawest.weblogic.entity.MaxThreadsConstraint.java
com.jeffreyawest.weblogic.entity.MinThreadsConstraint.java
com.jeffreyawest.weblogic.entity.RacInstance.java
com.jeffreyawest.weblogic.entity.RequestClass.java
com.jeffreyawest.weblogic.entity.Server.java
com.jeffreyawest.weblogic.entity.WebLogicEntity.java
com.jeffreyawest.weblogic.entity.WorkManager.java
com.jeffreyawest.weblogic.entity.enums.ApplicationHealth.java
com.jeffreyawest.weblogic.entity.enums.ApplicationState.java
com.jeffreyawest.weblogic.entity.enums.ApplicationType.java
com.jeffreyawest.weblogic.entity.enums.DatasourceInstanceState.java
com.jeffreyawest.weblogic.entity.enums.DatasourceType.java
com.jeffreyawest.weblogic.entity.enums.ServerHealth.java
com.jeffreyawest.weblogic.entity.enums.ServerState.java
com.jeffreyawest.weblogic.entity.enums.TargetState.java
com.jeffreyawest.weblogic.monitor.Constants.java
com.jeffreyawest.weblogic.monitor.WebLogicMonitor.java
com.jeffreyawest.weblogic.monitor.activity.EndpointEntryActivity.java
com.jeffreyawest.weblogic.monitor.activity.MainActivity.java
com.jeffreyawest.weblogic.monitor.activity.display.DisplayApplicationActivity.java
com.jeffreyawest.weblogic.monitor.activity.display.DisplayClusterActivity.java
com.jeffreyawest.weblogic.monitor.activity.display.DisplayDatasourceActivity.java
com.jeffreyawest.weblogic.monitor.activity.display.DisplayEntityActivity.java
com.jeffreyawest.weblogic.monitor.activity.display.DisplayServerActivity.java
com.jeffreyawest.weblogic.monitor.activity.display.fragment.ServerDetailsFragment.java
com.jeffreyawest.weblogic.monitor.activity.list.ListApplicationsActivity.java
com.jeffreyawest.weblogic.monitor.activity.list.ListClustersActivity.java
com.jeffreyawest.weblogic.monitor.activity.list.ListDatasourcesActivity.java
com.jeffreyawest.weblogic.monitor.activity.list.ListDomainEntitiesActivity.java
com.jeffreyawest.weblogic.monitor.activity.list.ListEntityActivity.java
com.jeffreyawest.weblogic.monitor.activity.list.ListServersActivity.java
com.jeffreyawest.weblogic.monitor.activity.list.adapter.ApplicationListAdapter.java
com.jeffreyawest.weblogic.monitor.activity.list.adapter.ClusterListAdapter.java
com.jeffreyawest.weblogic.monitor.activity.list.adapter.DatasourceListAdapter.java
com.jeffreyawest.weblogic.monitor.activity.list.adapter.DomainEntityListAdapter.java
com.jeffreyawest.weblogic.monitor.activity.list.adapter.ServerListAdapter.java
com.jeffreyawest.weblogic.monitor.charting.ApplicationTargetStatePieChart.java
com.jeffreyawest.weblogic.monitor.charting.Charting.java
com.jeffreyawest.weblogic.monitor.charting.ClusterServerHealthPieChart.java
com.jeffreyawest.weblogic.monitor.charting.ClusterServerStatePieChart.java
com.jeffreyawest.weblogic.monitor.charting.DatasourceInstancePieChart.java
com.jeffreyawest.weblogic.monitor.charting.DefaultPieChart.java
com.jeffreyawest.weblogic.monitor.charting.JVMCPUPieChart.java
com.jeffreyawest.weblogic.monitor.charting.JVMHeapPieChart.java
com.jeffreyawest.weblogic.monitor.task.RetrieveWebLogicEntityTask.java
com.jeffreyawest.weblogic.rest.WebLogicDemoRestAdapter.java
com.jeffreyawest.weblogic.rest.WebLogicHTTPRestAdapter.java
com.jeffreyawest.weblogic.rest.WebLogicRestAdapter.java