package com.showcast.hvscroll.params;

import android.support.annotation.ColorInt;

/**
 * Created by taro on 16/8/17.
 */
public class TableParams {
    protected int mRowMenuHeight;
    protected int mRowMenuTextColor;
    protected int mRowMenuBgColor;
    protected int mRowMenuTextSize;
    protected int mColumnMenuWidth;
    protected int mColumnMenuTextColor;
    protected int mColumnMenuBgColor;
    protected int mColumnMenuTextSize;

    public boolean setRowMenuHeight(int rowMenuHeight) {
        if (rowMenuHeight < 0) {
            return false;
        }
        this.mRowMenuHeight = rowMenuHeight;
        return true;
    }

    public void setRowMenuTextColor(@ColorInt int rowMenuTextColor) {
        this.mRowMenuTextColor = rowMenuTextColor;
    }

    public void setRowMenuBackgroundColor(@ColorInt int rowMenuBgColor) {
        this.mRowMenuBgColor = rowMenuBgColor;
    }

    public boolean setRowMenuTextSize(int rowMenuTextSize) {
        if (rowMenuTextSize < 0) {
            return false;
        }
        this.mRowMenuTextSize = rowMenuTextSize;
        return true;
    }

    public boolean setColumnMenuWidth(int columnMenuWidth) {
        if (columnMenuWidth < 0) {
            return false;
        }
        this.mColumnMenuWidth = columnMenuWidth;
        return true;
    }

    public void setColumnMenuTextColor(@ColorInt int columnMenuTextColor) {
        this.mColumnMenuTextColor = columnMenuTextColor;
    }

    public void setColumnMenuBackgroundColor(@ColorInt int columnMenuBgColor) {
        this.mColumnMenuBgColor = columnMenuBgColor;
    }

    public boolean setColumnMenuTextSize(int columnMenuTextSize) {
        if (columnMenuTextSize < 0) {
            return false;
        }
        this.mColumnMenuTextSize = columnMenuTextSize;
        return true;
    }

}

@@ -51,668 +51,917 @@
 oid.
-support.annotation.ColorInt;%0A%0A/**%0A * Created by taro on 16/8/17.%0A */%0Apublic class TableParams %7B%0A    protected int mRowMenuHeight;%0A    protected int mRowMenuTextColor;%0A    protected int mRowMenuBgColor;%0A    protected int mRowMenuTextSize;%0A    protected int mColumnMenuWidth;%0A    protected int mColumnMenuTextColor;%0A    protected int mColumnMenuBgColor;%0A    protected int mColumnMenuTextSize;%0A%0A    public boolean setRowMenuHeight(int rowMenuHeight)
+graphics.Color;%0Aimport android.support.annotation.IntDef;%0A%0Aimport com.showcast.hvscroll.draw.MenuDrawStyle;%0A%0Aimport java.lang.annotation.Retention;%0Aimport java.lang.annotation.RetentionPolicy;%0A%0A/**%0A * Created by taro on 16/8/17.%0A */%0Apublic class TableParams %7B%0A    public static final int DEFAULT_BACKGROUND_COLOR = Color.WHITE;%0A    public static final int DEFAULT_TEXT_COLOR = Color.BLACK;%0A    public static final int DEFAULT_TEXT_SIZE = 50;%0A    public static final int DEFAULT_MENU_WIDTH = 80;%0A    public static final int DEFAULT_MENU_HEIGHT = 60;%0A%0A    @Retention(RetentionPolicy.SOURCE)%0A    @IntDef(value = %7BMENU_ROW, MENU_COLUMN%7D)%0A    public @interface MenuType
  %7B%0A    
+%7D%0A%0A
     
-if (rowMenuHeight %3C 0) %7B%0A            return false;%0A        %7D%0A        this.mRowMenuHeight = rowMenuHeight;%0A        return true;%0A    %7D%0A%0A    public void setRowMenuTextColor(@ColorInt int rowMenuTextColor) %7B
+public static final int MENU_ROW = 1;%0A    public static final int MENU_COLUMN = -1;%0A%0A    protected MenuDrawStyle mRowMenu;%0A    protected MenuDrawStyle mColumnMenu;%0A%0A    public TableParams() %7B%0A        mRowMenu = new MenuDrawStyle();
 %0A   
@@ -961,37 +961,32 @@
 ();%0A        
-this.
 mRowMenu
 TextColor = 
@@ -977,293 +977,221 @@
 Menu
-TextColor = rowMenuTextColor;%0A    %7D%0A%0A    public void setRowMenuBackgroundColor(@ColorInt int rowMenuBgColor) %7B%0A        this.mRowMenuBgColor = rowMenuBgColor;%0A    %7D%0A%0A    public boolean setRowMenuTextSize(int rowMenuTextSize) %7B%0A        if (rowMenuTextSize %3C 0) %7B%0A            return false
+ = new MenuDrawStyle();%0A    %7D%0A%0A    public void setIsDrawMenu(boolean isDraw, @MenuType int menuType) %7B%0A        MenuDrawStyle menu = getMenu(menuType);%0A        if (menu != null) %7B%0A            menu.setIsDraw(isDraw)
 ;%0A  
@@ -1206,700 +1206,485 @@
     
+%7D%0A%0A
     
-this.mRowMenuTextSize = rowMenuTextSize;%0A        return true;
+public void setMenuFrozen(boolean frozenInX, boolean frozenInY, @MenuType int menuType) %7B
 %0A    
-%7D%0A%0A
     
-public boolean setColumnMenuWidth(int columnMenuWidth) %7B%0A        if (columnMenuWidth %3C 0) %7B%0A            return false;%0A        %7D%0A        this.mColumnMenuWidth = columnMenuWidth;%0A        return true;%0A    %7D%0A%0A    public void setColumnMenuTextColor(@ColorInt int columnMenuTextColor) %7B%0A        this.mColumnMenuTextColor = columnMenuTextColor;
+MenuDrawStyle menu = getMenu(menuType);%0A        if (menu != null) %7B%0A            menu.setMenuFrozen(frozenInX, frozenInY);%0A        %7D%0A    %7D%0A%0A    public MenuDrawStyle getMenu(@MenuType int menuType) %7B%0A        switch (menuType) %7B
 %0A    
-%7D%0A%0A
     
-public void setColumnMenuBackgroundColor(@ColorInt int columnMenuBgColor) %7B%0A        this.mColumnMenuBgColor = columnMenuBgColor
+    case MENU_ROW:%0A                return mRowMenu
 ;%0A    
-%7D%0A%0A
     
-public boolean setColumnMenuTextSize(int columnMenuTextSize) %7B%0A        if (columnMenuTextSize %3C 0) %7B%0A            return false;
+    case MENU_COLUMN:%0A                return mColumnMenu;%0A            default:
 %0A   
@@ -1692,18 +1692,16 @@
     
-%7D%0A
         
 this
@@ -1700,81 +1700,35 @@
     
-this.mColumnMenuTextSize = columnMenuTextSize;%0A        return true;
+return null;%0A        %7D
 %0A    %7D%0A
-%0A
 %7D%0A

更新table的参数类,暂时未使用