Преглед на файлове

优化 - Code整理 & 清理

luozhipeng преди 1 година
родител
ревизия
ee07cc473b
променени са 13 файла, в които са добавени 111 реда и са изтрити 111 реда
  1. 1 1
      compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdffreetext/CFreeTextStyleFragment.java
  2. 1 1
      compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfshape/CShapeStyleFragment.java
  3. 4 4
      compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfstyle/CAnnotImplStyle.java
  4. 29 29
      compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfstyle/CPDFGlobalAnnotStyle.java
  5. 2 2
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfstyle/CAnnotStyle.java
  6. 13 13
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfstyle/manager/CStyleManager.java
  7. 1 1
      compdfkit-tools/src/main/java/com/compdfkit/tools/edit/pdfproperties/CEditTextProperFragment.java
  8. 1 1
      compdfkit-tools/src/main/java/com/compdfkit/tools/edit/pdfproperties/pdfstyle/CEditSelectionStyle.java
  9. 2 2
      compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdfcheckbox/CheckBoxStyleFragment.java
  10. 4 4
      compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdflistbox/CListBoxStyleFragment.java
  11. 4 4
      compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdfpushbutton/CPushButtonStyleFragment.java
  12. 45 45
      compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdfstyle/CFormStyle.java
  13. 4 4
      compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdftextfield/CTextFieldStyleFragment.java

+ 1 - 1
compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdffreetext/CFreeTextStyleFragment.java

@@ -167,7 +167,7 @@ public class CFreeTextStyleFragment extends CBasicPropertiesFragment implements
     @Override
     public void color(int color) {
         if (viewModel != null && viewModel.getStyle() != null) {
-            viewModel.getStyle().setTextColor(color);
+            viewModel.getStyle().setFontColor(color);
         }
     }
 

+ 1 - 1
compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfshape/CShapeStyleFragment.java

@@ -176,7 +176,7 @@ public class CShapeStyleFragment extends CBasicPropertiesFragment {
             if (style.getLineColor() == Color.TRANSPARENT) {
                 style.setLineColorOpacity(opacitySliderBar.getProgress());
             }
-            viewModel.getStyle().setLineColor(color);
+            viewModel.getStyle().setBorderColor(color);
             if (style.getType() == CStyleType.ANNOT_ARROW){
                 updateFillColor(color);
             }

+ 4 - 4
compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfstyle/CAnnotImplStyle.java

@@ -158,7 +158,7 @@ public class CAnnotImplStyle implements CStyleProvider {
             case ANNOT_SQUARE:
                 CPDFSquareAnnotImpl squareAnnot = (CPDFSquareAnnotImpl) annotImpl;
                 CPDFSquareAnnotation squareAnnotation = squareAnnot.onGetAnnotation();
-                style.setLineColor(squareAnnotation.getBorderColor());
+                style.setBorderColor(squareAnnotation.getBorderColor());
                 style.setLineColorOpacity(squareAnnotation.getBorderAlpha());
                 style.setFillColor(squareAnnotation.getFillColor());
                 style.setFillColorOpacity(squareAnnotation.getFillAlpha());
@@ -172,7 +172,7 @@ public class CAnnotImplStyle implements CStyleProvider {
             case ANNOT_CIRCLE:
                 CPDFCircleAnnotImpl circleAnnot = (CPDFCircleAnnotImpl) annotImpl;
                 CPDFCircleAnnotation circleAnnotation = circleAnnot.onGetAnnotation();
-                style.setLineColor(circleAnnotation.getBorderColor());
+                style.setBorderColor(circleAnnotation.getBorderColor());
                 style.setLineColorOpacity(circleAnnotation.getBorderAlpha());
                 style.setFillColor(circleAnnotation.getFillColor());
                 style.setFillColorOpacity(circleAnnotation.getFillAlpha());
@@ -187,7 +187,7 @@ public class CAnnotImplStyle implements CStyleProvider {
             case ANNOT_ARROW:
                 CPDFLineAnnotImpl lineAnnot = (CPDFLineAnnotImpl) annotImpl;
                 CPDFLineAnnotation lineAnnotation = lineAnnot.onGetAnnotation();
-                style.setLineColor(lineAnnotation.getBorderColor());
+                style.setBorderColor(lineAnnotation.getBorderColor());
                 style.setLineColorOpacity(lineAnnotation.getBorderAlpha());
                 style.setFillColor(lineAnnotation.getFillColor());
                 style.setFillColorOpacity(lineAnnotation.getFillAlpha());
@@ -208,7 +208,7 @@ public class CAnnotImplStyle implements CStyleProvider {
                 CPDFFreetextAnnotImpl freetextAnnot = (CPDFFreetextAnnotImpl) annotImpl;
                 CPDFFreetextAnnotation freetextAnnotation = freetextAnnot.onGetAnnotation();
                 CPDFTextAttribute textAttribute = freetextAnnotation.getFreetextDa();
-                style.setTextColor(textAttribute.getColor());
+                style.setFontColor(textAttribute.getColor());
                 style.setTextColorOpacity(freetextAnnotation.getAlpha());
                 style.setFontType(CPDFTextAttribute.FontNameHelper.getFontType(textAttribute.getFontName()));
                 style.setFontBold(CPDFTextAttribute.FontNameHelper.isBold(textAttribute.getFontName()));

+ 29 - 29
compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfstyle/CPDFGlobalAnnotStyle.java

@@ -203,22 +203,22 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
                     CPDFTextfieldAttr textFieldAttr = attribute.getTextfieldAttr();
                     textFieldAttr.setBorderWidth(params.getBorderWidth());
                     textFieldAttr.setBorderColor(params.getLineColor());
-                    textFieldAttr.setBgColor(params.getFillColor());
+                    textFieldAttr.setFillColor(params.getFillColor());
                     String textFieldFontName = CPDFTextAttribute.FontNameHelper.obtainFontName(params.getFontType(), params.isFontBold(), params.isFontItalic());
                     textFieldAttr.setTextAttribute(new CPDFTextAttribute(textFieldFontName, params.getFontSize(), params.getTextColor()));
                     textFieldAttr.setMultiline(params.isFormMultiLine());
                     switch (params.getAlignment()) {
                         case LEFT:
-                            textFieldAttr.setAlignment(CPDFTextAlignment.ALIGNMENT_LEFT);
+                            textFieldAttr.setTextAlignment(CPDFTextAlignment.ALIGNMENT_LEFT);
                             break;
                         case CENTER:
-                            textFieldAttr.setAlignment(CPDFTextAlignment.ALIGNMENT_CENTER);
+                            textFieldAttr.setTextAlignment(CPDFTextAlignment.ALIGNMENT_CENTER);
                             break;
                         case RIGHT:
-                            textFieldAttr.setAlignment(CPDFTextAlignment.ALIGNMENT_RIGHT);
+                            textFieldAttr.setTextAlignment(CPDFTextAlignment.ALIGNMENT_RIGHT);
                             break;
                         default:
-                            textFieldAttr.setAlignment(CPDFTextAlignment.ALIGNMENT_UNKNOWN);
+                            textFieldAttr.setTextAlignment(CPDFTextAlignment.ALIGNMENT_UNKNOWN);
                             break;
                     }
                     break;
@@ -226,31 +226,31 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
                     CPDFCheckboxAttr checkboxAttr = attribute.getCheckboxAttr();
                     checkboxAttr.setCheckStyle(params.getCheckStyle());
                     checkboxAttr.setBorderWidth(params.getBorderWidth());
-                    checkboxAttr.setCheckColor(params.getColor());
+                    checkboxAttr.setColor(params.getColor());
                     checkboxAttr.setBorderColor(params.getLineColor());
-                    checkboxAttr.setBgColor(params.getFillColor());
+                    checkboxAttr.setFillColor(params.getFillColor());
                     checkboxAttr.setChecked(params.isChecked());
                     break;
                 case FORM_RADIO_BUTTON:
                     CPDFRadiobuttonAttr radiobuttonAttr = attribute.getRadiobuttonAttr();
                     radiobuttonAttr.setCheckStyle(params.getCheckStyle());
                     radiobuttonAttr.setBorderWidth(params.getBorderWidth());
-                    radiobuttonAttr.setCheckColor(params.getColor());
+                    radiobuttonAttr.setColor(params.getColor());
                     radiobuttonAttr.setBorderColor(params.getLineColor());
-                    radiobuttonAttr.setBgColor(params.getFillColor());
+                    radiobuttonAttr.setFillColor(params.getFillColor());
                     radiobuttonAttr.setChecked(params.isChecked());
                     break;
                 case FORM_LIST_BOX:
                     CPDFListboxAttr listBoxAttr = attribute.getListboxAttr();
                     listBoxAttr.setFontSize(params.getFontSize());
                     listBoxAttr.setFontColor(params.getTextColor());
-                    listBoxAttr.setBgColor(params.getFillColor());
+                    listBoxAttr.setFillColor(params.getFillColor());
                     listBoxAttr.setBorderWidth(params.getBorderWidth());
                     listBoxAttr.setBorderColor(params.getLineColor());
                     break;
                 case FORM_COMBO_BOX:
                     CPDFComboboxAttr comboBoxAttr = attribute.getComboboxAttr();
-                    comboBoxAttr.setBgColor(params.getFillColor());
+                    comboBoxAttr.setFillColor(params.getFillColor());
                     comboBoxAttr.setFontSize(params.getFontSize());
                     comboBoxAttr.setFontColor(params.getTextColor());
                     comboBoxAttr.setBorderWidth(params.getBorderWidth());
@@ -258,7 +258,7 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
                     break;
                 case FORM_PUSH_BUTTON:
                     CPDFPushButtonAttr pushButtonAttr = attribute.getPushButtonAttr();
-                    pushButtonAttr.setBgColor(params.getFillColor());
+                    pushButtonAttr.setFillColor(params.getFillColor());
                     pushButtonAttr.setBorderColor(params.getLineColor());
                     pushButtonAttr.setBorderWidth(params.getBorderWidth());
                     pushButtonAttr.setFontColor(params.getTextColor());
@@ -316,7 +316,7 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
                 CPDFSquareAttr squareAttr = attribute.getSquareAttr();
                 style.setFillColor(squareAttr.getFillColor());
                 style.setFillColorOpacity(squareAttr.getFillAlpha());
-                style.setLineColor(squareAttr.getBorderColor());
+                style.setBorderColor(squareAttr.getBorderColor());
                 style.setLineColorOpacity(squareAttr.getBorderAlpha());
                 style.setBorderWidth(squareAttr.getBorderWidth());
                 style.setBorderStyle(squareAttr.getBorderStyle());
@@ -325,7 +325,7 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
                 CPDFCircleAttr circleAttr = attribute.getCircleAttr();
                 style.setFillColor(circleAttr.getFillColor());
                 style.setFillColorOpacity(circleAttr.getFillAlpha());
-                style.setLineColor(circleAttr.getBorderColor());
+                style.setBorderColor(circleAttr.getBorderColor());
                 style.setLineColorOpacity(circleAttr.getBorderAlpha());
                 style.setBorderWidth(circleAttr.getBorderWidth());
                 style.setBorderStyle(circleAttr.getBorderStyle());
@@ -333,7 +333,7 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
             case ANNOT_LINE:
             case ANNOT_ARROW:
                 CPDFLineAttr lineAttr = attribute.getLineAttr();
-                style.setLineColor(lineAttr.getBorderColor());
+                style.setBorderColor(lineAttr.getBorderColor());
                 style.setLineColorOpacity(lineAttr.getBorderAlpha());
                 style.setFillColor(lineAttr.getFillColor());
                 style.setFillColorOpacity(lineAttr.getFillAlpha());
@@ -369,7 +369,7 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
                 }
                 style.setTextColorOpacity(freetextAttr.getAlpha());
                 CPDFTextAttribute textAttribute = freetextAttr.getTextAttribute();
-                style.setTextColor(textAttribute.getColor());
+                style.setFontColor(textAttribute.getColor());
                 style.setFontType(CPDFTextAttribute.FontNameHelper.getFontType(textAttribute.getFontName()));
                 style.setFontBold(CPDFTextAttribute.FontNameHelper.isBold(textAttribute.getFontName()));
                 style.setFontItalic(CPDFTextAttribute.FontNameHelper.isItalic(textAttribute.getFontName()));
@@ -380,16 +380,16 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
                 //text fields
                 style.setHideForm(false);
                 style.setFormMultiLine(textFieldAttr.isMultiline());
-                style.setTextColor(textFieldAttr.getFontColor());
-                style.setLineColor(textFieldAttr.getBorderColor());
-                style.setFillColor(textFieldAttr.getBgColor());
+                style.setFontColor(textFieldAttr.getFontColor());
+                style.setBorderColor(textFieldAttr.getBorderColor());
+                style.setFillColor(textFieldAttr.getFillColor());
                 CPDFTextAttribute.FontNameHelper.FontType fontType = CPDFTextAttribute.FontNameHelper.getFontType(textFieldAttr.getFontName());
                 style.setFontType(fontType);
                 style.setFontBold(CPDFTextAttribute.FontNameHelper.isBold(textFieldAttr.getFontName()));
                 style.setFontItalic(CPDFTextAttribute.FontNameHelper.isItalic(textFieldAttr.getFontName()));
                 style.setFontSize((int) textFieldAttr.getFontSize());
                 style.setFormDefaultValue("");
-                switch (textFieldAttr.getAlignment()) {
+                switch (textFieldAttr.getTextAlignment()) {
                     case ALIGNMENT_LEFT:
                         style.setAlignment(CAnnotStyle.Alignment.LEFT);
                         break;
@@ -407,9 +407,9 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
             case FORM_LIST_BOX:
                 CPDFListboxAttr listboxAttr = attribute.getListboxAttr();
                 style.setFontSize((int) listboxAttr.getFontSize());
-                style.setTextColor(listboxAttr.getFontColor());
-                style.setFillColor(listboxAttr.getBgColor());
-                style.setLineColor(listboxAttr.getBorderColor());
+                style.setFontColor(listboxAttr.getFontColor());
+                style.setFillColor(listboxAttr.getFillColor());
+                style.setBorderColor(listboxAttr.getBorderColor());
                 style.setBorderWidth(listboxAttr.getBorderWidth());
                 CPDFTextAttribute.FontNameHelper.FontType listBoxFontType = CPDFTextAttribute.FontNameHelper.getFontType(listboxAttr.getFontName());
                 style.setFontType(listBoxFontType);
@@ -419,9 +419,9 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
             case FORM_COMBO_BOX:
                 CPDFComboboxAttr comboBoxAttr = attribute.getComboboxAttr();
                 style.setFontSize((int) comboBoxAttr.getFontSize());
-                style.setTextColor(comboBoxAttr.getFontColor());
-                style.setFillColor(comboBoxAttr.getBgColor());
-                style.setLineColor(comboBoxAttr.getBorderColor());
+                style.setFontColor(comboBoxAttr.getFontColor());
+                style.setFillColor(comboBoxAttr.getFillColor());
+                style.setBorderColor(comboBoxAttr.getBorderColor());
                 style.setBorderWidth(comboBoxAttr.getBorderWidth());
                 CPDFTextAttribute.FontNameHelper.FontType comBoBoxFontType = CPDFTextAttribute.FontNameHelper.getFontType(comboBoxAttr.getFontName());
                 style.setFontType(comBoBoxFontType);
@@ -432,9 +432,9 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
                 CPDFPushButtonAttr pushButtonAttr = attribute.getPushButtonAttr();
                 //text fields
                 style.setHideForm(false);
-                style.setTextColor(pushButtonAttr.getFontColor());
-                style.setLineColor(pushButtonAttr.getBorderColor());
-                style.setFillColor(pushButtonAttr.getBgColor());
+                style.setFontColor(pushButtonAttr.getFontColor());
+                style.setBorderColor(pushButtonAttr.getBorderColor());
+                style.setFillColor(pushButtonAttr.getFillColor());
                 CPDFTextAttribute.FontNameHelper.FontType pushButtonFontType = CPDFTextAttribute.FontNameHelper.getFontType(pushButtonAttr.getFontName());
                 style.setFontType(pushButtonFontType);
                 style.setFontBold(CPDFTextAttribute.FontNameHelper.isBold(pushButtonAttr.getFontName()));

+ 2 - 2
compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfstyle/CAnnotStyle.java

@@ -158,7 +158,7 @@ public class CAnnotStyle implements Serializable {
         return lineColor;
     }
 
-    public void setLineColor(@ColorInt int lineColor) {
+    public void setBorderColor(@ColorInt int lineColor) {
         boolean update = lineColor != this.lineColor;
         this.lineColor = lineColor;
         Log.e("CAnnotStyle", "setLineColor(" + lineColor + ", update:" + update + ")");
@@ -258,7 +258,7 @@ public class CAnnotStyle implements Serializable {
         return textColor;
     }
 
-    public void setTextColor(@ColorInt int textColor) {
+    public void setFontColor(@ColorInt int textColor) {
         boolean update = textColor != this.textColor;
         this.textColor = textColor;
         Log.e("CAnnotStyle", "setTextColor(" + textColor + ", update:" + update + ")");

+ 13 - 13
compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfstyle/manager/CStyleManager.java

@@ -298,7 +298,7 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
                                 float borderWidth,
                                 CPDFBorderStyle borderStyle) {
             CAnnotStyle style = new CAnnotStyle(type);
-            style.setLineColor(lineColor);
+            style.setBorderColor(lineColor);
             style.setLineColorOpacity(lineColorOpacity);
             style.setFillColor(fillColor);
             style.setFillColorOpacity(fillColorAlpha);
@@ -321,7 +321,7 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
                                      CPDFLineAnnotation.LineType startLineType,
                                      CPDFLineAnnotation.LineType tailLineType) {
             CAnnotStyle style = new CAnnotStyle(CStyleType.ANNOT_ARROW);
-            style.setLineColor(lineColor);
+            style.setBorderColor(lineColor);
             style.setLineColorOpacity(lineColorOpacity);
             style.setFillColor(fillColor);
             style.setFillColorOpacity(fillColorAlpha);
@@ -344,7 +344,7 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
                                    @IntRange(from = 0, to = 255) int textColorOpacity,
                                    @IntRange(from = 0, to = 100) int fontSize) {
             CAnnotStyle style = new CAnnotStyle(CStyleType.ANNOT_FREETEXT);
-            style.setTextColor(textColor);
+            style.setFontColor(textColor);
             style.setTextColorOpacity(textColorOpacity);
             style.setFontSize(fontSize);
             attrSet.add(style);
@@ -358,9 +358,9 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
                                     int borderWidth,
                                     boolean multiLine) {
             CAnnotStyle style = new CAnnotStyle(CStyleType.FORM_TEXT_FIELD);
-            style.setLineColor(borderColor);
+            style.setBorderColor(borderColor);
             style.setFillColor(fillColor);
-            style.setTextColor(textColor);
+            style.setFontColor(textColor);
             style.setBorderWidth(borderWidth);
             style.setFormMultiLine(multiLine);
             style.setFontSize(fontSize);
@@ -374,7 +374,7 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
                                    int borderWidth,
                                    CPDFWidget.CheckStyle checkStyle) {
             CAnnotStyle style = new CAnnotStyle(CStyleType.FORM_CHECK_BOX);
-            style.setLineColor(borderColor);
+            style.setBorderColor(borderColor);
             style.setFillColor(fillColor);
             style.setColor(checkBoxColor);
             style.setBorderWidth(borderWidth);
@@ -389,7 +389,7 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
                                       int borderWidth,
                                       CPDFWidget.CheckStyle checkStyle) {
             CAnnotStyle style = new CAnnotStyle(CStyleType.FORM_RADIO_BUTTON);
-            style.setLineColor(borderColor);
+            style.setBorderColor(borderColor);
             style.setFillColor(fillColor);
             style.setColor(checkBoxColor);
             style.setBorderWidth(borderWidth);
@@ -406,8 +406,8 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
                 @FloatRange(from = 0F, to = 100F) float borderWidth) {
             CAnnotStyle style = new CAnnotStyle(CStyleType.FORM_LIST_BOX);
             style.setFillColor(fillColor);
-            style.setLineColor(borderColor);
-            style.setTextColor(textColor);
+            style.setBorderColor(borderColor);
+            style.setFontColor(textColor);
             style.setFontSize(fontSize);
             style.setBorderWidth(borderWidth);
             attrSet.add(style);
@@ -422,8 +422,8 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
                 @FloatRange(from = 0F, to = 100F) float borderWidth) {
             CAnnotStyle style = new CAnnotStyle(CStyleType.FORM_COMBO_BOX);
             style.setFillColor(fillColor);
-            style.setLineColor(borderColor);
-            style.setTextColor(textColor);
+            style.setBorderColor(borderColor);
+            style.setFontColor(textColor);
             style.setFontSize(fontSize);
             style.setBorderWidth(borderWidth);
             attrSet.add(style);
@@ -439,8 +439,8 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
                 String buttonTitle) {
             CAnnotStyle style = new CAnnotStyle(CStyleType.FORM_PUSH_BUTTON);
             style.setFillColor(fillColor);
-            style.setLineColor(borderColor);
-            style.setTextColor(textColor);
+            style.setBorderColor(borderColor);
+            style.setFontColor(textColor);
             style.setFontSize(fontSize);
             style.setBorderWidth(borderWidth);
             style.setFormDefaultValue(buttonTitle);

+ 1 - 1
compdfkit-tools/src/main/java/com/compdfkit/tools/edit/pdfproperties/CEditTextProperFragment.java

@@ -271,7 +271,7 @@ public class CEditTextProperFragment extends CBasicPropertiesFragment
     public void color(int color) {
         if (viewModel != null && viewModel.getStyle() != null) {
             setUpdatePropertyType(CAnnotStyle.EditUpdatePropertyType.TextColor);
-            viewModel.getStyle().setTextColor(color);
+            viewModel.getStyle().setFontColor(color);
             setUpdatePropertyType(CAnnotStyle.EditUpdatePropertyType.All);
         }
     }

+ 1 - 1
compdfkit-tools/src/main/java/com/compdfkit/tools/edit/pdfproperties/pdfstyle/CEditSelectionStyle.java

@@ -168,7 +168,7 @@ public class CEditSelectionStyle implements CStyleProvider {
             } else if (alignType == CPDFEditTextArea.PDFEditAlignType.PDFEditAlignRight) {
                 style.setAlignment(CAnnotStyle.Alignment.RIGHT);
             }
-            style.setTextColor(textSelections.getColor());
+            style.setFontColor(textSelections.getColor());
             int fontsize = (int) textSelections.getFontSize();
             style.setFontSize(fontsize > 0 ? fontsize : 25);
             String fontname = textSelections.getFontName();

+ 2 - 2
compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdfcheckbox/CheckBoxStyleFragment.java

@@ -85,7 +85,7 @@ public class CheckBoxStyleFragment extends CBasicPropertiesFragment implements V
         viewModel.addStyleChangeListener(this);
         borderColorListView.setOnColorSelectListener(color -> {
             if (viewModel != null) {
-                viewModel.getStyle().setLineColor(color);
+                viewModel.getStyle().setBorderColor(color);
             }
         });
         borderColorListView.setColorPickerClickListener(() -> {
@@ -95,7 +95,7 @@ public class CheckBoxStyleFragment extends CBasicPropertiesFragment implements V
                 colorPickerFragment.showAlphaSliderBar(false);
                 colorPickerFragment.setColorPickerListener(color -> {
                     if (viewModel != null) {
-                        viewModel.getStyle().setLineColor(color);
+                        viewModel.getStyle().setBorderColor(color);
                     }
                 });
             });

+ 4 - 4
compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdflistbox/CListBoxStyleFragment.java

@@ -113,7 +113,7 @@ public class CListBoxStyleFragment extends CBasicPropertiesFragment implements V
         viewModel.addStyleChangeListener(this);
         borderColorListView.setOnColorSelectListener(color -> {
             if (viewModel != null) {
-                viewModel.getStyle().setLineColor(color);
+                viewModel.getStyle().setBorderColor(color);
             }
         });
         borderColorListView.setColorPickerClickListener(() -> {
@@ -123,7 +123,7 @@ public class CListBoxStyleFragment extends CBasicPropertiesFragment implements V
                 colorPickerFragment.showAlphaSliderBar(false);
                 colorPickerFragment.setColorPickerListener(color -> {
                     if (viewModel != null) {
-                        viewModel.getStyle().setLineColor(color);
+                        viewModel.getStyle().setBorderColor(color);
                     }
                 });
             });
@@ -147,7 +147,7 @@ public class CListBoxStyleFragment extends CBasicPropertiesFragment implements V
         });
         textColorListView.setOnColorSelectListener(color -> {
             if (viewModel != null) {
-                viewModel.getStyle().setTextColor(color);
+                viewModel.getStyle().setFontColor(color);
             }
         });
         textColorListView.setColorPickerClickListener(() -> {
@@ -157,7 +157,7 @@ public class CListBoxStyleFragment extends CBasicPropertiesFragment implements V
                 colorPickerFragment.showAlphaSliderBar(false);
                 colorPickerFragment.setColorPickerListener(color -> {
                     if (viewModel != null) {
-                        viewModel.getStyle().setTextColor(color);
+                        viewModel.getStyle().setFontColor(color);
                     }
                 });
             });

+ 4 - 4
compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdfpushbutton/CPushButtonStyleFragment.java

@@ -121,7 +121,7 @@ public class CPushButtonStyleFragment extends CBasicPropertiesFragment implement
         viewModel.addStyleChangeListener(this);
         borderColorListView.setOnColorSelectListener(color -> {
             if (viewModel != null) {
-                viewModel.getStyle().setLineColor(color);
+                viewModel.getStyle().setBorderColor(color);
             }
         });
         borderColorListView.setColorPickerClickListener(() -> {
@@ -131,7 +131,7 @@ public class CPushButtonStyleFragment extends CBasicPropertiesFragment implement
                 colorPickerFragment.showAlphaSliderBar(false);
                 colorPickerFragment.setColorPickerListener(color -> {
                     if (viewModel != null) {
-                        viewModel.getStyle().setLineColor(color);
+                        viewModel.getStyle().setBorderColor(color);
                     }
                 });
             });
@@ -155,7 +155,7 @@ public class CPushButtonStyleFragment extends CBasicPropertiesFragment implement
         });
         textColorListView.setOnColorSelectListener(color -> {
             if (viewModel != null) {
-                viewModel.getStyle().setTextColor(color);
+                viewModel.getStyle().setFontColor(color);
             }
         });
         textColorListView.setColorPickerClickListener(() -> {
@@ -165,7 +165,7 @@ public class CPushButtonStyleFragment extends CBasicPropertiesFragment implement
                 colorPickerFragment.showAlphaSliderBar(false);
                 colorPickerFragment.setColorPickerListener(color -> {
                     if (viewModel != null) {
-                        viewModel.getStyle().setTextColor(color);
+                        viewModel.getStyle().setFontColor(color);
                     }
                 });
             });

+ 45 - 45
compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdfstyle/CFormStyle.java

@@ -62,9 +62,9 @@ public class CFormStyle implements CStyleProvider {
                 CPDFTextWidget textWidget = (CPDFTextWidget) pdfAnnotation;
                 textWidget.setFieldName(style.getFormFieldName());
                 textWidget.setFontSize(style.getFontSize());
-                textWidget.setFontRGBColor(style.getTextColor());
-                textWidget.setWidgetBgRGBColor(style.getFillColor());
-                textWidget.setWidgetBorderRGBColor(style.getLineColor());
+                textWidget.setFontColor(style.getTextColor());
+                textWidget.setFillColor(style.getFillColor());
+                textWidget.setBorderColor(style.getLineColor());
                 textWidget.setBorderWidth(style.getBorderWidth());
                 textWidget.setMultiLine(style.isFormMultiLine());
                 textWidget.setHidden(style.isHideForm());
@@ -73,16 +73,16 @@ public class CFormStyle implements CStyleProvider {
                 textWidget.setText(style.getFormDefaultValue());
                 switch (style.getAlignment()) {
                     case LEFT:
-                        textWidget.setJustification(CPDFTextAlignment.ALIGNMENT_LEFT);
+                        textWidget.setTextAlignment(CPDFTextAlignment.ALIGNMENT_LEFT);
                         break;
                     case CENTER:
-                        textWidget.setJustification(CPDFTextAlignment.ALIGNMENT_CENTER);
+                        textWidget.setTextAlignment(CPDFTextAlignment.ALIGNMENT_CENTER);
                         break;
                     case RIGHT:
-                        textWidget.setJustification(CPDFTextAlignment.ALIGNMENT_RIGHT);
+                        textWidget.setTextAlignment(CPDFTextAlignment.ALIGNMENT_RIGHT);
                         break;
                     default:
-                        textWidget.setJustification(CPDFTextAlignment.ALIGNMENT_UNKNOWN);
+                        textWidget.setTextAlignment(CPDFTextAlignment.ALIGNMENT_UNKNOWN);
                         break;
                 }
                 textWidget.updateAp();
@@ -92,10 +92,10 @@ public class CFormStyle implements CStyleProvider {
                 }
             } else if (baseAnnotImpl instanceof CPDFCheckboxWidgetImpl) {
                 CPDFCheckboxWidget checkboxWidget = (CPDFCheckboxWidget) pdfAnnotation;
-                checkboxWidget.setWidgetCheckStyle(style.getCheckStyle());
-                checkboxWidget.setWidgetCheckColor(style.getColor());
-                checkboxWidget.setWidgetBorderRGBColor(style.getLineColor());
-                checkboxWidget.setWidgetBgRGBColor(style.getFillColor());
+                checkboxWidget.setCheckStyle(style.getCheckStyle());
+                checkboxWidget.setColor(style.getColor());
+                checkboxWidget.setBorderColor(style.getLineColor());
+                checkboxWidget.setFillColor(style.getFillColor());
                 checkboxWidget.setHidden(style.isHideForm());
                 checkboxWidget.setFieldName(style.getFormFieldName());
                 checkboxWidget.setChecked(style.isChecked());
@@ -106,10 +106,10 @@ public class CFormStyle implements CStyleProvider {
                 }
             } else if (baseAnnotImpl instanceof CPDFRadiobuttonWidgetImpl) {
                 CPDFRadiobuttonWidget radiobuttonWidget = (CPDFRadiobuttonWidget) pdfAnnotation;
-                radiobuttonWidget.setWidgetCheckStyle(style.getCheckStyle());
-                radiobuttonWidget.setWidgetCheckColor(style.getColor());
-                radiobuttonWidget.setWidgetBorderRGBColor(style.getLineColor());
-                radiobuttonWidget.setWidgetBgRGBColor(style.getFillColor());
+                radiobuttonWidget.setCheckStyle(style.getCheckStyle());
+                radiobuttonWidget.setColor(style.getColor());
+                radiobuttonWidget.setBorderColor(style.getLineColor());
+                radiobuttonWidget.setFillColor(style.getFillColor());
                 radiobuttonWidget.setHidden(style.isHideForm());
                 radiobuttonWidget.setFieldName(style.getFormFieldName());
                 radiobuttonWidget.setChecked(style.isChecked());
@@ -124,12 +124,12 @@ public class CFormStyle implements CStyleProvider {
                 listBoxWidget.setHidden(style.isHideForm());
                 listBoxWidget.setBorderWidth(2);
                 listBoxWidget.setFontSize(style.getFontSize());
-                listBoxWidget.setFontRGBColor(style.getTextColor());
-                listBoxWidget.setWidgetBgRGBColor(style.getFillColor());
+                listBoxWidget.setFontColor(style.getTextColor());
+                listBoxWidget.setFillColor(style.getFillColor());
                 if (style.getLineColor() == Color.TRANSPARENT){
                     listBoxWidget.setBorderWidth(0);
                 }
-                listBoxWidget.setWidgetBorderRGBColor(style.getLineColor());
+                listBoxWidget.setBorderColor(style.getLineColor());
                 String fontName = CPDFTextAttribute.FontNameHelper.obtainFontName(style.getFontType(), style.isFontBold(), style.isFontItalic());
                 listBoxWidget.setFontName(fontName);
                 listBoxWidget.updateAp();
@@ -143,12 +143,12 @@ public class CFormStyle implements CStyleProvider {
                 comboBoxWidget.setHidden(style.isHideForm());
                 comboBoxWidget.setBorderWidth(2);
                 comboBoxWidget.setFontSize(style.getFontSize());
-                comboBoxWidget.setFontRGBColor(style.getTextColor());
-                comboBoxWidget.setWidgetBgRGBColor(style.getFillColor());
+                comboBoxWidget.setFontColor(style.getTextColor());
+                comboBoxWidget.setFillColor(style.getFillColor());
                 if (style.getLineColor() == Color.TRANSPARENT){
                     comboBoxWidget.setBorderWidth(0);
                 }
-                comboBoxWidget.setWidgetBorderRGBColor(style.getLineColor());
+                comboBoxWidget.setBorderColor(style.getLineColor());
                 String fontName = CPDFTextAttribute.FontNameHelper.obtainFontName(style.getFontType(), style.isFontBold(), style.isFontItalic());
                 comboBoxWidget.setFontName(fontName);
                 comboBoxWidget.updateAp();
@@ -162,9 +162,9 @@ public class CFormStyle implements CStyleProvider {
                 pushButtonWidget.setHidden(style.isHideForm());
                 pushButtonWidget.setBorderWidth(2);
                 pushButtonWidget.setFontSize(style.getFontSize());
-                pushButtonWidget.setFontRGBColor(style.getTextColor());
-                pushButtonWidget.setWidgetBgRGBColor(style.getFillColor());
-                pushButtonWidget.setWidgetBorderRGBColor(style.getLineColor());
+                pushButtonWidget.setFontColor(style.getTextColor());
+                pushButtonWidget.setFillColor(style.getFillColor());
+                pushButtonWidget.setBorderColor(style.getLineColor());
                 String fontName = CPDFTextAttribute.FontNameHelper.obtainFontName(style.getFontType(), style.isFontBold(), style.isFontItalic());
                 pushButtonWidget.setFontName(fontName);
                 pushButtonWidget.setButtonTitle(style.getFormDefaultValue());
@@ -187,9 +187,9 @@ public class CFormStyle implements CStyleProvider {
             style.setFormFieldName(textWidget.getFieldName());
             style.setHideForm(textWidget.isHidden());
             style.setFormMultiLine(textWidget.isMultiLine());
-            style.setTextColor(textWidget.getFontRGBColor());
-            style.setLineColor(textWidget.getWidgetBorderRGBColor());
-            style.setFillColor(textWidget.getWidgetBgRGBColor());
+            style.setFontColor(textWidget.getFontColor());
+            style.setBorderColor(textWidget.getBorderColor());
+            style.setFillColor(textWidget.getFillColor());
             CPDFTextAttribute.FontNameHelper.FontType fontType = CPDFTextAttribute.FontNameHelper.getFontType(textWidget.getFontName());
             style.setFontType(fontType);
             style.setBorderWidth(textWidget.getBorderWidth());
@@ -197,7 +197,7 @@ public class CFormStyle implements CStyleProvider {
             style.setFontItalic(CPDFTextAttribute.FontNameHelper.isItalic(textWidget.getFontName()));
             style.setFontSize((int) textWidget.getFontSize());
             style.setFormDefaultValue(textWidget.getText());
-            switch (textWidget.getJustification()) {
+            switch (textWidget.getTextAlignment()) {
                 case ALIGNMENT_LEFT:
                     style.setAlignment(CAnnotStyle.Alignment.LEFT);
                     break;
@@ -213,28 +213,28 @@ public class CFormStyle implements CStyleProvider {
             }
         } else if (baseAnnotImpl instanceof CPDFCheckboxWidgetImpl) {
             CPDFCheckboxWidget textWidget = (CPDFCheckboxWidget) pdfAnnotation;
-            style.setColor(textWidget.getWidgetCheckColor());
-            style.setLineColor(textWidget.getWidgetBorderRGBColor());
-            style.setFillColor(textWidget.getWidgetBgRGBColor());
-            style.setCheckStyle(textWidget.getWidgetCheckStyle());
+            style.setColor(textWidget.getColor());
+            style.setBorderColor(textWidget.getBorderColor());
+            style.setFillColor(textWidget.getFillColor());
+            style.setCheckStyle(textWidget.getCheckStyle());
             style.setFormFieldName(textWidget.getFieldName());
             style.setHideForm(textWidget.isHidden());
             style.setChecked(textWidget.isChecked());
         } else if (baseAnnotImpl instanceof CPDFRadiobuttonWidgetImpl){
             CPDFRadiobuttonWidget textWidget = (CPDFRadiobuttonWidget) pdfAnnotation;
-            style.setColor(textWidget.getWidgetCheckColor());
-            style.setLineColor(textWidget.getWidgetBorderRGBColor());
-            style.setFillColor(textWidget.getWidgetBgRGBColor());
-            style.setCheckStyle(textWidget.getWidgetCheckStyle());
+            style.setColor(textWidget.getColor());
+            style.setBorderColor(textWidget.getBorderColor());
+            style.setFillColor(textWidget.getFillColor());
+            style.setCheckStyle(textWidget.getCheckStyle());
             style.setFormFieldName(textWidget.getFieldName());
             style.setHideForm(textWidget.isHidden());
             style.setChecked(textWidget.isChecked());
         } else if (baseAnnotImpl instanceof CPDFListboxWidgetImpl){
             CPDFListboxWidget listBoxWidget = (CPDFListboxWidget) pdfAnnotation;
             style.setBorderWidth(2);
-            style.setLineColor(listBoxWidget.getWidgetBorderRGBColor());
-            style.setFillColor(listBoxWidget.getWidgetBgRGBColor());
-            style.setTextColor(listBoxWidget.getFontRGBColor());
+            style.setBorderColor(listBoxWidget.getBorderColor());
+            style.setFillColor(listBoxWidget.getFillColor());
+            style.setFontColor(listBoxWidget.getFontColor());
             style.setFontSize((int) listBoxWidget.getFontSize());
             style.setFormFieldName(listBoxWidget.getFieldName());
             style.setHideForm(listBoxWidget.isHidden());
@@ -245,9 +245,9 @@ public class CFormStyle implements CStyleProvider {
         } else if (baseAnnotImpl instanceof CPDFComboboxWidgetImpl){
             CPDFComboboxWidget comboBoxWidget = (CPDFComboboxWidget) pdfAnnotation;
             style.setBorderWidth(2);
-            style.setLineColor(comboBoxWidget.getWidgetBorderRGBColor());
-            style.setFillColor(comboBoxWidget.getWidgetBgRGBColor());
-            style.setTextColor(comboBoxWidget.getFontRGBColor());
+            style.setBorderColor(comboBoxWidget.getBorderColor());
+            style.setFillColor(comboBoxWidget.getFillColor());
+            style.setFontColor(comboBoxWidget.getFontColor());
             style.setFontSize((int) comboBoxWidget.getFontSize());
             style.setFormFieldName(comboBoxWidget.getFieldName());
             style.setHideForm(comboBoxWidget.isHidden());
@@ -258,9 +258,9 @@ public class CFormStyle implements CStyleProvider {
         } else if (baseAnnotImpl instanceof CPDFPushbuttonWidgetImpl){
             CPDFPushbuttonWidget pushButtonWidget = (CPDFPushbuttonWidget) pdfAnnotation;
             style.setBorderWidth(2);
-            style.setLineColor(pushButtonWidget.getWidgetBorderRGBColor());
-            style.setFillColor(pushButtonWidget.getWidgetBgRGBColor());
-            style.setTextColor(pushButtonWidget.getFontRGBColor());
+            style.setBorderColor(pushButtonWidget.getBorderColor());
+            style.setFillColor(pushButtonWidget.getFillColor());
+            style.setFontColor(pushButtonWidget.getFontColor());
             style.setFontSize((int) pushButtonWidget.getFontSize());
             style.setFormFieldName(pushButtonWidget.getFieldName());
             style.setHideForm(pushButtonWidget.isHidden());

+ 4 - 4
compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdftextfield/CTextFieldStyleFragment.java

@@ -158,7 +158,7 @@ public class CTextFieldStyleFragment extends CBasicPropertiesFragment implements
         viewModel.addStyleChangeListener(this);
         borderColorListView.setOnColorSelectListener(color -> {
             if (viewModel != null) {
-                viewModel.getStyle().setLineColor(color);
+                viewModel.getStyle().setBorderColor(color);
             }
         });
         borderColorListView.setColorPickerClickListener(() -> {
@@ -168,7 +168,7 @@ public class CTextFieldStyleFragment extends CBasicPropertiesFragment implements
                 colorPickerFragment.showAlphaSliderBar(false);
                 colorPickerFragment.setColorPickerListener(color -> {
                     if (viewModel != null) {
-                        viewModel.getStyle().setLineColor(color);
+                        viewModel.getStyle().setBorderColor(color);
                     }
                 });
             });
@@ -192,7 +192,7 @@ public class CTextFieldStyleFragment extends CBasicPropertiesFragment implements
         });
         textColorListView.setOnColorSelectListener(color -> {
             if (viewModel != null) {
-                viewModel.getStyle().setTextColor(color);
+                viewModel.getStyle().setFontColor(color);
             }
         });
         textColorListView.setColorPickerClickListener(() -> {
@@ -202,7 +202,7 @@ public class CTextFieldStyleFragment extends CBasicPropertiesFragment implements
                 colorPickerFragment.showAlphaSliderBar(false);
                 colorPickerFragment.setColorPickerListener(color -> {
                     if (viewModel != null) {
-                        viewModel.getStyle().setTextColor(color);
+                        viewModel.getStyle().setFontColor(color);
                     }
                 });
             });