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
17package com.androidplot.ui;
18
19import android.graphics.Canvas;
20import android.graphics.RectF;
21import com.androidplot.util.DisplayDimensions;
22
23/**
24 * Used by classes that depend on dimensional values to lay themselves out and draw.
25 * Consideration should be given to synchronizing with any draw routines that also
26 * exist within the class.
27 */
28public interface Resizable {
29
30    /**
31     * Called when a change to the class' dimensions is made.  This method is responsible
32     * for cascading calls to update for any logical children of this class, for example
33     * the Plot class is responsible for updating the LayoutManager.  Note that while dims
34     * is marked final in this interface, the compiler will not enforce it.  Implementors of
35     * this method should take care not to make changes to dims as this will affect parent
36     * Resizables in likely undesired ways.
37     * @param dims
38     */
39    public void layout(final DisplayDimensions dims);
40}
41