1 /* 2 * Copyright 2012 AndroidPlot.com 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.androidplot; 18 19 import android.graphics.Canvas; 20 21 /** 22 * Defines methods used for monitoring events generated by a Plot. 23 */ 24 public interface PlotListener { 25 26 /** 27 * Fired immediately before the Plot "source" is drawn onto canvas. 28 * Commonly used by implementing Series instances to activate a read 29 * lock on it's self in preparation for the Plot's imminent reading 30 * of that series. 31 * @param source 32 * @param canvas 33 */ onBeforeDraw(Plot source, Canvas canvas)34 public void onBeforeDraw(Plot source, Canvas canvas); 35 36 /** 37 * Fired immediately after the Plot "source" is drawn onto canvas. 38 * Just as onBeforeDraw(...) is commonly used by Series implementations 39 * to activate a read lock, this method is commonly used to release that 40 * same lock. 41 * @param source 42 * @param canvas 43 */ onAfterDraw(Plot source, Canvas canvas)44 public void onAfterDraw(Plot source, Canvas canvas); 45 } 46