mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 06:16:14 +08:00

git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@206 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049
188 lines
11 KiB
XML
188 lines
11 KiB
XML
<?xml version="1.0" encoding="utf-16"?>
|
|
<CLAS CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" VERSION="1" LANGU="E" DESCRIPT="Excel legacy color palette" UUID="00235A8D06891EE0A99EAB131A4E70BD" CATEGORY="00" EXPOSURE="2" STATE="1" RELEASE="0" AUTHOR="BCUSER" CREATEDON="20110702" CHANGEDON="00000000" CHGDANYON="00000000" CLSCCINCL="X" FIXPT="X" UNICODE="X" R3RELEASE="702" CLSBCCAT="00" DURATION_TYPE="0 " RISK_LEVEL="0 ">
|
|
<publicSection>class ZCL_EXCEL_LEGACY_PALETTE definition
|
|
public
|
|
create public .
|
|
|
|
public section.
|
|
*"* public components of class ZCL_EXCEL_LEGACY_PALETTE
|
|
*"* do not include other source files here!!!
|
|
type-pools ABAP .
|
|
|
|
methods CONSTRUCTOR .
|
|
methods IS_MODIFIED
|
|
returning
|
|
value(EP_MODIFIED) type ABAP_BOOL .
|
|
methods GET_COLOR
|
|
importing
|
|
!IP_INDEX type I
|
|
returning
|
|
value(EP_COLOR) type ZEXCEL_STYLE_COLOR_ARGB
|
|
raising
|
|
ZCX_EXCEL .
|
|
methods GET_COLORS
|
|
returning
|
|
value(EP_COLORS) type ZEXCEL_T_STYLE_COLOR_ARGB .
|
|
methods SET_COLOR
|
|
importing
|
|
!IP_INDEX type I
|
|
!IP_COLOR type ZEXCEL_STYLE_COLOR_ARGB .</publicSection>
|
|
<protectedSection>protected section.
|
|
*"* protected components of class ZCL_EXCEL_LEGACY_PALETTE
|
|
*"* do not include other source files here!!!</protectedSection>
|
|
<privateSection>private section.
|
|
*"* private components of class ZCL_EXCEL_LEGACY_PALETTE
|
|
*"* do not include other source files here!!!
|
|
|
|
data MODIFIED type ABAP_BOOL value ABAP_FALSE. "#EC NOTEXT .
|
|
data COLORS type ZEXCEL_T_STYLE_COLOR_ARGB .</privateSection>
|
|
<localImplementation>*"* use this source file for the definition and implementation of
|
|
*"* local helper classes, interface definitions and type
|
|
*"* declarations</localImplementation>
|
|
<localTypes>*"* use this source file for any type of declarations (class
|
|
*"* definitions, interfaces or type declarations) you need for
|
|
*"* components in the private section</localTypes>
|
|
<localMacros>*"* use this source file for any macro definitions you need
|
|
*"* in the implementation part of the class</localMacros>
|
|
<textPool/>
|
|
<classDocumentation/>
|
|
<typeUsage CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" TYPEGROUP="ABAP" VERSION="1" TPUTYPE="0" EXPLICIT="X" IMPLICIT="X"/>
|
|
<forwardDeclaration>ABAP</forwardDeclaration>
|
|
<attribute CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="COLORS" VERSION="1" LANGU="E" DESCRIPT="Table of RGB colors" EXPOSURE="0" STATE="1" EDITORDER="2 " AUTHOR="BCUSER" CREATEDON="20110703" CHANGEDON="00000000" ATTDECLTYP="0" ATTEXPVIRT="0" TYPTYPE="1" TYPE="ZEXCEL_T_STYLE_COLOR_ARGB" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " R3RELEASE="702" TYPESRC_LENG="0 "/>
|
|
<attribute CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="MODIFIED" VERSION="1" LANGU="E" EXPOSURE="0" STATE="1" EDITORDER="1 " AUTHOR="BCUSER" CREATEDON="20110702" CHANGEDON="00000000" ATTDECLTYP="0" ATTVALUE="ABAP_FALSE" ATTEXPVIRT="0" TYPTYPE="1" TYPE="ABAP_BOOL" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " R3RELEASE="702" TYPESRC_LENG="0 "/>
|
|
<method CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="CONSTRUCTOR" VERSION="1" LANGU="E" DESCRIPT="CONSTRUCTOR" EXPOSURE="2" STATE="1" EDITORDER="1 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110703" CHANGEDON="00000000" MTDTYPE="2" MTDDECLTYP="0" R3RELEASE="702" BCMTDCAT="00" BCMTDSYN="0">
|
|
<source>METHOD constructor.
|
|
" default Excel palette based on
|
|
" http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.indexedcolors.aspx
|
|
|
|
APPEND '00000000' TO colors.
|
|
APPEND '00FFFFFF' TO colors.
|
|
APPEND '00FF0000' TO colors.
|
|
APPEND '0000FF00' TO colors.
|
|
APPEND '000000FF' TO colors.
|
|
APPEND '00FFFF00' TO colors.
|
|
APPEND '00FF00FF' TO colors.
|
|
APPEND '0000FFFF' TO colors.
|
|
APPEND '00000000' TO colors.
|
|
APPEND '00FFFFFF' TO colors.
|
|
|
|
APPEND '00FF0000' TO colors.
|
|
APPEND '0000FF00' TO colors.
|
|
APPEND '000000FF' TO colors.
|
|
APPEND '00FFFF00' TO colors.
|
|
APPEND '00FF00FF' TO colors.
|
|
APPEND '0000FFFF' TO colors.
|
|
APPEND '00800000' TO colors.
|
|
APPEND '00008000' TO colors.
|
|
APPEND '00000080' TO colors.
|
|
APPEND '00808000' TO colors.
|
|
|
|
APPEND '00800080' TO colors.
|
|
APPEND '00008080' TO colors.
|
|
APPEND '00C0C0C0' TO colors.
|
|
APPEND '00808080' TO colors.
|
|
APPEND '009999FF' TO colors.
|
|
APPEND '00993366' TO colors.
|
|
APPEND '00FFFFCC' TO colors.
|
|
APPEND '00CCFFFF' TO colors.
|
|
APPEND '00660066' TO colors.
|
|
APPEND '00FF8080' TO colors.
|
|
|
|
APPEND '000066CC' TO colors.
|
|
APPEND '00CCCCFF' TO colors.
|
|
APPEND '00000080' TO colors.
|
|
APPEND '00FF00FF' TO colors.
|
|
APPEND '00FFFF00' TO colors.
|
|
APPEND '0000FFFF' TO colors.
|
|
APPEND '00800080' TO colors.
|
|
APPEND '00800000' TO colors.
|
|
APPEND '00008080' TO colors.
|
|
APPEND '000000FF' TO colors.
|
|
|
|
APPEND '0000CCFF' TO colors.
|
|
APPEND '00CCFFFF' TO colors.
|
|
APPEND '00CCFFCC' TO colors.
|
|
APPEND '00FFFF99' TO colors.
|
|
APPEND '0099CCFF' TO colors.
|
|
APPEND '00FF99CC' TO colors.
|
|
APPEND '00CC99FF' TO colors.
|
|
APPEND '00FFCC99' TO colors.
|
|
APPEND '003366FF' TO colors.
|
|
APPEND '0033CCCC' TO colors.
|
|
|
|
APPEND '0099CC00' TO colors.
|
|
APPEND '00FFCC00' TO colors.
|
|
APPEND '00FF9900' TO colors.
|
|
APPEND '00FF6600' TO colors.
|
|
APPEND '00666699' TO colors.
|
|
APPEND '00969696' TO colors.
|
|
APPEND '00003366' TO colors.
|
|
APPEND '00339966' TO colors.
|
|
APPEND '00003300' TO colors.
|
|
APPEND '00333300' TO colors.
|
|
|
|
APPEND '00993300' TO colors.
|
|
APPEND '00993366' TO colors.
|
|
APPEND '00333399' TO colors.
|
|
APPEND '00333333' TO colors.
|
|
|
|
ENDMETHOD.</source>
|
|
<methodDocumentation/>
|
|
</method>
|
|
<method CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="GET_COLOR" VERSION="1" LANGU="E" DESCRIPT="Get color" EXPOSURE="2" STATE="1" EDITORDER="3 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110702" CHANGEDBY="BCUSER" CHANGEDON="20110703" MTDTYPE="0" MTDDECLTYP="0" MTDNEWEXC="X" R3RELEASE="702" BCMTDCAT="00" BCMTDSYN="0">
|
|
<parameter CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="GET_COLOR" SCONAME="IP_INDEX" VERSION="1" LANGU="E" DESCRIPT="0 - based index" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110703" CHANGEDBY="BCUSER" CHANGEDON="20110703" PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="I"/>
|
|
<parameter CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="GET_COLOR" SCONAME="EP_COLOR" VERSION="1" LANGU="E" DESCRIPT="Color ARGB" CMPTYPE="1" MTDTYPE="0" EDITORDER="2 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110703" CHANGEDON="00000000" PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="ZEXCEL_STYLE_COLOR_ARGB"/>
|
|
<exception CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="GET_COLOR" SCONAME="ZCX_EXCEL" VERSION="1" LANGU="E" DESCRIPT="Exceptions for ABAP2XLSX" MTDTYPE="0" EDITORDER="1 " AUTHOR="BCUSER" CREATEDON="20110703" CHANGEDON="00000000"/>
|
|
<source>METHOD get_color.
|
|
DATA: lv_index type i.
|
|
|
|
lv_index = ip_index + 1.
|
|
READ TABLE colors INTO ep_color INDEX lv_index.
|
|
IF sy-subrc <> 0.
|
|
RAISE EXCEPTION TYPE zcx_excel
|
|
EXPORTING
|
|
error = 'Invalid color index'.
|
|
ENDIF.
|
|
ENDMETHOD.</source>
|
|
<methodDocumentation/>
|
|
</method>
|
|
<method CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="GET_COLORS" VERSION="1" LANGU="E" DESCRIPT="Get all colors" EXPOSURE="2" STATE="1" EDITORDER="4 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110702" CHANGEDBY="BCUSER" CHANGEDON="20110703" MTDTYPE="0" MTDDECLTYP="0" R3RELEASE="702" BCMTDCAT="00" BCMTDSYN="0">
|
|
<parameter CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="GET_COLORS" SCONAME="EP_COLORS" VERSION="1" LANGU="E" DESCRIPT="Table of RGB colors" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110703" CHANGEDON="00000000" PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="ZEXCEL_T_STYLE_COLOR_ARGB"/>
|
|
<source>METHOD get_colors.
|
|
ep_colors = colors.
|
|
ENDMETHOD.</source>
|
|
<methodDocumentation/>
|
|
</method>
|
|
<method CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="IS_MODIFIED" VERSION="1" LANGU="E" DESCRIPT="Is the palette modified from standard?" EXPOSURE="2" STATE="1" EDITORDER="2 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110702" CHANGEDBY="BCUSER" CHANGEDON="20110703" MTDTYPE="0" MTDDECLTYP="0" R3RELEASE="702" BCMTDCAT="00" BCMTDSYN="0">
|
|
<parameter CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="IS_MODIFIED" SCONAME="EP_MODIFIED" VERSION="1" LANGU="E" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110703" CHANGEDON="00000000" PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="1" TYPE="ABAP_BOOL"/>
|
|
<source>METHOD is_modified.
|
|
ep_modified = modified.
|
|
ENDMETHOD.</source>
|
|
<methodDocumentation/>
|
|
</method>
|
|
<method CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="SET_COLOR" VERSION="1" LANGU="E" DESCRIPT="Set (replace) color" EXPOSURE="2" STATE="1" EDITORDER="5 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110702" CHANGEDBY="BCUSER" CHANGEDON="20110703" MTDTYPE="0" MTDDECLTYP="0" R3RELEASE="702" BCMTDCAT="00" BCMTDSYN="0">
|
|
<parameter CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="SET_COLOR" SCONAME="IP_INDEX" VERSION="1" LANGU="E" DESCRIPT="0 - based index" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110703" CHANGEDBY="BCUSER" CHANGEDON="20110703" PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="I"/>
|
|
<parameter CLSNAME="ZCL_EXCEL_LEGACY_PALETTE" CMPNAME="SET_COLOR" SCONAME="IP_COLOR" VERSION="1" LANGU="E" DESCRIPT="Color ARGB" CMPTYPE="1" MTDTYPE="0" EDITORDER="2 " DISPID="0 " AUTHOR="BCUSER" CREATEDON="20110703" CHANGEDON="00000000" PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="ZEXCEL_STYLE_COLOR_ARGB"/>
|
|
<source>METHOD set_color.
|
|
DATA: lv_index TYPE i.
|
|
|
|
FIELD-SYMBOLS: <lv_color> LIKE LINE OF colors.
|
|
|
|
lv_index = ip_index + 1.
|
|
READ TABLE colors ASSIGNING <lv_color> INDEX lv_index.
|
|
IF sy-subrc <> 0.
|
|
RAISE EXCEPTION TYPE zcx_excel
|
|
EXPORTING
|
|
error = 'Invalid color index'.
|
|
ENDIF.
|
|
|
|
IF <lv_color> <> ip_color.
|
|
modified = abap_true.
|
|
<lv_color> = ip_color.
|
|
ENDIF.
|
|
|
|
ENDMETHOD.</source>
|
|
<methodDocumentation/>
|
|
</method>
|
|
</CLAS>
|