hxb
2022-11-22 b3513b1713bb979d0a69c5a8c4ddcd038f184e6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package com.mm.android.deviceaddmodule.mobilecommon.widget.linechart.model;
 
import android.graphics.Color;
 
import com.mm.android.deviceaddmodule.mobilecommon.widget.linechart.adapter.DefaultHighLightValueAdapter;
import com.mm.android.deviceaddmodule.mobilecommon.widget.linechart.adapter.IValueAdapter;
import com.mm.android.deviceaddmodule.mobilecommon.widget.linechart.utils.Utils;
 
public class HighLight {
 
    public static final float D_HIGHLIGHT_WIDTH = 1; //dp
    public static final float D_HINT_TEXT_SIZE = 15;
 
    //////////////////////// high light ////////////////////////
    int highLightColor ;
    float highLightWidth;
 
    //////////////////////// hint ////////////////////////
    int hintColor = Color.BLACK;
    float hintTextSize;
 
    boolean enable = false;
    boolean isDrawHighLine = true;
    boolean isDrawHint = true;
 
    protected IValueAdapter xValueAdapter;// 高亮时,x应该如何显示?
    protected IValueAdapter yValueAdapter;// 高亮时,y应该如何显示?
 
 
    public HighLight() {
 
        highLightWidth = Utils.dp2px(D_HIGHLIGHT_WIDTH);
        hintTextSize = Utils.dp2px(D_HINT_TEXT_SIZE);
 
        xValueAdapter = new DefaultHighLightValueAdapter();
        yValueAdapter = new DefaultHighLightValueAdapter();
    }
 
    public HighLight(IValueAdapter xValueAdapter, IValueAdapter yValueAdapter) {
        this.xValueAdapter = xValueAdapter;
        this.yValueAdapter = yValueAdapter;
    }
 
    public int getHighLightColor() {
        return highLightColor;
    }
 
    public void setHighLightColor(int highLightColor) {
        this.highLightColor = highLightColor;
    }
 
    public float getHighLightWidth() {
        return highLightWidth;
    }
 
    public void setHighLightWidth(float highLightWidth) {
        this.highLightWidth = highLightWidth;
    }
 
    public int getHintColor() {
        return hintColor;
    }
 
    public void setHintColor(int hintColor) {
        this.hintColor = hintColor;
    }
 
    public float getHintTextSize() {
        return hintTextSize;
    }
 
    public void setHintTextSize(float hintTextSize) {
        this.hintTextSize = hintTextSize;
    }
 
    public boolean isEnable() {
        return enable;
    }
 
    public void setEnable(boolean enable) {
        this.enable = enable;
    }
 
    public boolean isDrawHighLine() {
        return isDrawHighLine;
    }
 
    public void setDrawHighLine(boolean drawHighLine) {
        isDrawHighLine = drawHighLine;
    }
 
    public boolean isDrawHint() {
        return isDrawHint;
    }
 
    public void setDrawHint(boolean drawHint) {
        isDrawHint = drawHint;
    }
 
    public IValueAdapter getxValueAdapter() {
        return xValueAdapter;
    }
 
    public HighLight setxValueAdapter(IValueAdapter xValueAdapter) {
        this.xValueAdapter = xValueAdapter;
        return this;
    }
 
    public IValueAdapter getyValueAdapter() {
        return yValueAdapter;
    }
 
    public HighLight setyValueAdapter(IValueAdapter yValueAdapter) {
        this.yValueAdapter = yValueAdapter;
        return this;
    }
}