togglebuttonpainter.java

来自「Mobile 应用程序使用 Java Micro Edition (Java M」· Java 代码 · 共 689 行 · 第 1/3 页

JAVA
689
字号
        g.setPaint(color1);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient1(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient2(roundRect));        g.fill(roundRect);    }    private void paintBackgroundEnabled(Graphics2D g) {        roundRect = decodeRoundRect1();        g.setPaint(color9);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient3(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient4(roundRect));        g.fill(roundRect);    }    private void paintBackgroundFocused(Graphics2D g) {        roundRect = decodeRoundRect4();        g.setPaint(color16);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient3(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient5(roundRect));        g.fill(roundRect);    }    private void paintBackgroundMouseOver(Graphics2D g) {        roundRect = decodeRoundRect1();        g.setPaint(color9);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient6(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient7(roundRect));        g.fill(roundRect);    }    private void paintBackgroundMouseOverAndFocused(Graphics2D g) {        roundRect = decodeRoundRect4();        g.setPaint(color16);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient6(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient7(roundRect));        g.fill(roundRect);    }    private void paintBackgroundPressed(Graphics2D g) {        roundRect = decodeRoundRect1();        g.setPaint(color22);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient8(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient4(roundRect));        g.fill(roundRect);    }    private void paintBackgroundPressedAndFocused(Graphics2D g) {        roundRect = decodeRoundRect4();        g.setPaint(color16);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient8(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient4(roundRect));        g.fill(roundRect);    }    private void paintBackgroundSelected(Graphics2D g) {        roundRect = decodeRoundRect5();        g.setPaint(color30);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient9(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient10(roundRect));        g.fill(roundRect);    }    private void paintBackgroundSelectedAndFocused(Graphics2D g) {        roundRect = decodeRoundRect6();        g.setPaint(color16);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient9(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient10(roundRect));        g.fill(roundRect);    }    private void paintBackgroundPressedAndSelected(Graphics2D g) {        roundRect = decodeRoundRect5();        g.setPaint(color30);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient11(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient10(roundRect));        g.fill(roundRect);    }    private void paintBackgroundPressedAndSelectedAndFocused(Graphics2D g) {        roundRect = decodeRoundRect6();        g.setPaint(color16);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient11(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient10(roundRect));        g.fill(roundRect);    }    private void paintBackgroundMouseOverAndSelected(Graphics2D g) {        roundRect = decodeRoundRect5();        g.setPaint(color30);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient12(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient10(roundRect));        g.fill(roundRect);    }    private void paintBackgroundMouseOverAndSelectedAndFocused(Graphics2D g) {        roundRect = decodeRoundRect6();        g.setPaint(color16);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient12(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient10(roundRect));        g.fill(roundRect);    }    private void paintBackgroundDisabledAndSelected(Graphics2D g) {        roundRect = decodeRoundRect5();        g.setPaint(color46);        g.fill(roundRect);        roundRect = decodeRoundRect2();        g.setPaint(decodeGradient13(roundRect));        g.fill(roundRect);        roundRect = decodeRoundRect3();        g.setPaint(decodeGradient14(roundRect));        g.fill(roundRect);    }

    private RoundRectangle2D decodeRoundRect1() {        roundRect.setRoundRect(decodeX(0.2857143f), //x                               decodeY(0.42857143f), //y                               decodeX(2.7142859f) - decodeX(0.2857143f), //width                               decodeY(2.857143f) - decodeY(0.42857143f), //height                               12.0f, 12.0f); //rounding        return roundRect;    }    private RoundRectangle2D decodeRoundRect2() {        roundRect.setRoundRect(decodeX(0.2857143f), //x                               decodeY(0.2857143f), //y                               decodeX(2.7142859f) - decodeX(0.2857143f), //width                               decodeY(2.7142859f) - decodeY(0.2857143f), //height                               9.0f, 9.0f); //rounding        return roundRect;    }    private RoundRectangle2D decodeRoundRect3() {        roundRect.setRoundRect(decodeX(0.42857143f), //x                               decodeY(0.42857143f), //y                               decodeX(2.5714285f) - decodeX(0.42857143f), //width                               decodeY(2.5714285f) - decodeY(0.42857143f), //height                               7.0f, 7.0f); //rounding        return roundRect;    }    private RoundRectangle2D decodeRoundRect4() {        roundRect.setRoundRect(decodeX(0.08571429f), //x                               decodeY(0.08571429f), //y                               decodeX(2.914286f) - decodeX(0.08571429f), //width                               decodeY(2.914286f) - decodeY(0.08571429f), //height                               11.0f, 11.0f); //rounding        return roundRect;    }    private RoundRectangle2D decodeRoundRect5() {        roundRect.setRoundRect(decodeX(0.2857143f), //x                               decodeY(0.42857143f), //y                               decodeX(2.7142859f) - decodeX(0.2857143f), //width                               decodeY(2.857143f) - decodeY(0.42857143f), //height                               9.0f, 9.0f); //rounding        return roundRect;    }    private RoundRectangle2D decodeRoundRect6() {        roundRect.setRoundRect(decodeX(0.08571429f), //x                               decodeY(0.08571429f), //y

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?