[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

Themes

Class Themes

java.lang.Object
com.grapecity.documents.excel.Themes

public class Themes extends Object
表示主题管理器。

使用此类可按名称访问主题,并创建可应用于工作簿的自定义主题。Themes 实例可用于获取内置主题和已添加的自定义主题。


 Themes themes = new Themes();
 ITheme theme = themes.get(Themes.GetBerlin().getName());
 workbook.setTheme(theme);
 
  • Constructor Details

    • Themes

      public Themes()
  • Method Details

    • get

      public final ITheme get(String name)
      获取具有指定名称的主题。

      此方法先搜索内置主题,然后搜索添加到此 Themes 集合中的自定义主题。主题名称匹配不区分大小写,并忽略 name 中的前导和尾随空白。

      
       Themes themes = new Themes();
       ITheme theme = themes.get(Themes.GetOfficeTheme().getName());
       workbook.setTheme(theme);
       
      Parameters:
      name - 要搜索的主题名称。不得为 null;将忽略前导和尾随空白。
      Returns:
      匹配的 ITheme;如果没有内置主题或自定义主题与指定名称匹配,则为 null。
      Throws:
      NullPointerException - 如果 name 为 null。
    • add

      public ITheme add(String themeName, ITheme baseTheme)
      基于指定的基主题创建新的自定义主题。

      如果 baseTheme 为 null,则从 Office 主题创建新主题。如果 themeName 为 null 或空,则自动生成唯一的自定义主题名称。

      
       Themes themes = new Themes();
       ITheme baseTheme = Themes.GetBadge();
       ITheme customTheme = themes.add("Custom Badge", baseTheme);
       workbook.setTheme(customTheme);
       
      Parameters:
      themeName - 新主题的名称。如果为 null 或空,则生成唯一名称。如果非空,则忽略大小写时不得与内置主题或现有自定义主题名称匹配。
      baseTheme - 要复制作为新主题基础的主题。如果为 null,则使用 Office 主题。
      Returns:
      新创建的 ITheme。
      Throws:
      IllegalArgumentException - 如果 themeName 非空且不是有效的主题名称。
    • add

      public ITheme add(String themeName)
      创建具有指定名称的新主题。

      此方法会转发到 add(String,ITheme),并以 null 作为基主题,因此新主题将从 Office 主题创建并添加到此 Themes 集合。

      
       Themes themes = new Themes();
       ITheme theme = themes.add("Custom Theme");
       workbook.setTheme(theme);
       
      Parameters:
      themeName - 新主题的名称。如果为 null 或空,则自动生成自定义主题名称。如果非空,则名称必须有效。
      Returns:
      新创建的 ITheme。
      Throws:
      IllegalArgumentException - 如果 themeName 非空且不是有效的主题名称。
    • getCount

      public final int getCount()
      获取此主题集合中的主题数量。

      返回的值包括内置主题以及添加到集合中的任何自定义主题。

      
       Themes themes = new Themes();
       themes.add("Custom Theme");
       int count = themes.getCount();
       
      Returns:
      集合中的主题总数。
    • GetOfficeTheme

      public static ITheme GetOfficeTheme()
      指定 Office 主题。
      
       ITheme theme = Themes.GetOfficeTheme();
       workbook.setTheme(theme);
       
      Returns:
      Office 主题.
    • GetBadge

      public static ITheme GetBadge()
      指定 Badge 主题。
      
       ITheme theme = Themes.GetBadge();
       workbook.setTheme(theme);
       
      Returns:
      Badge 主题.
    • GetBanded

      public static ITheme GetBanded()
      指定 Banded 主题。
      
       ITheme theme = Themes.GetBanded();
       workbook.setTheme(theme);
       
      Returns:
      Banded 主题.
    • GetBasis

      public static ITheme GetBasis()
      指定 Basis 主题。
      
       ITheme theme = Themes.GetBasis();
       workbook.setTheme(theme);
       
      Returns:
      Basis 主题.
    • GetBerlin

      public static ITheme GetBerlin()
      指定 Berlin 主题。
      
       ITheme theme = Themes.GetBerlin();
       workbook.setTheme(theme);
       
      Returns:
      Berlin 主题.
    • GetCelestial

      public static ITheme GetCelestial()
      指定 Celestial 主题。
      
       ITheme theme = Themes.GetCelestial();
       workbook.setTheme(theme);
       
      Returns:
      Celestial 主题.
    • GetCircuit

      public static ITheme GetCircuit()
      指定 Circuit 主题。
      
       ITheme theme = Themes.GetCircuit();
       workbook.setTheme(theme);
       
      Returns:
      Circuit 主题.
    • GetCrop

      public static ITheme GetCrop()
      指定 Crop 主题。
      
       ITheme theme = Themes.GetCrop();
       workbook.setTheme(theme);
       
      Returns:
      Crop 主题.
    • GetDamask

      public static ITheme GetDamask()
      指定 Damask 主题。
      
       ITheme theme = Themes.GetDamask();
       workbook.setTheme(theme);
       
      Returns:
      Damask 主题.
    • GetDepth

      public static ITheme GetDepth()
      指定 Depth 主题。
      
       ITheme theme = Themes.GetDepth();
       workbook.setTheme(theme);
       
      Returns:
      Depth 主题.
    • GetDividend

      public static ITheme GetDividend()
      指定 Dividend 主题。
      
       ITheme theme = Themes.GetDividend();
       workbook.setTheme(theme);
       
      Returns:
      Dividend 主题.
    • GetDroplet

      public static ITheme GetDroplet()
      指定 Droplet 主题。
      
       ITheme theme = Themes.GetDroplet();
       workbook.setTheme(theme);
       
      Returns:
      Droplet 主题.
    • GetFacet

      public static ITheme GetFacet()
      指定 Facet 主题。
      
       ITheme theme = Themes.GetFacet();
       workbook.setTheme(theme);
       
      Returns:
      Facet 主题.
    • GetFeathered

      public static ITheme GetFeathered()
      指定 Feathered 主题。
      
       ITheme theme = Themes.GetFeathered();
       workbook.setTheme(theme);
       
      Returns:
      Feathered 主题.
    • GetFrame

      public static ITheme GetFrame()
      指定 Frame 主题。
      
       ITheme theme = Themes.GetFrame();
       workbook.setTheme(theme);
       
      Returns:
      Frame 主题.
    • GetGallery

      public static ITheme GetGallery()
      指定 Gallery 主题。
      
       ITheme theme = Themes.GetGallery();
       workbook.setTheme(theme);
       
      Returns:
      Gallery 主题.
    • GetHeadlines

      public static ITheme GetHeadlines()
      指定 Headlines 主题。
      
       ITheme theme = Themes.GetHeadlines();
       workbook.setTheme(theme);
       
      Returns:
      Headlines 主题.
    • GetIntegral

      public static ITheme GetIntegral()
      指定 Integral 主题。
      
       ITheme theme = Themes.GetIntegral();
       workbook.setTheme(theme);
       
      Returns:
      Integral 主题.
    • GetIonBoardroom

      public static ITheme GetIonBoardroom()
      指定 IonBoardroom 主题。
      
       ITheme theme = Themes.GetIonBoardroom();
       workbook.setTheme(theme);
       
      Returns:
      IonBoardroom 主题.
    • GetIon

      public static ITheme GetIon()
      指定 Ion 主题。
      
       ITheme theme = Themes.GetIon();
       workbook.setTheme(theme);
       
      Returns:
      Ion 主题.
    • GetMainEvent

      public static ITheme GetMainEvent()
      指定 MainEvent 主题。
      
       ITheme theme = Themes.GetMainEvent();
       workbook.setTheme(theme);
       
      Returns:
      MainEvent 主题.
    • GetMesh

      public static ITheme GetMesh()
      指定 Mesh 主题。
      
       ITheme theme = Themes.GetMesh();
       workbook.setTheme(theme);
       
      Returns:
      Mesh 主题.
    • GetMetropolitan

      public static ITheme GetMetropolitan()
      指定 Metropolitan 主题。
      
       ITheme theme = Themes.GetMetropolitan();
       workbook.setTheme(theme);
       
      Returns:
      Metropolitan 主题.
    • GetOrganic

      public static ITheme GetOrganic()
      指定 Organic 主题。
      
       ITheme theme = Themes.GetOrganic();
       workbook.setTheme(theme);
       
      Returns:
      Organic 主题.
    • GetParcel

      public static ITheme GetParcel()
      指定 Parcel 主题。
      
       ITheme theme = Themes.GetParcel();
       workbook.setTheme(theme);
       
      Returns:
      Parcel 主题.
    • GetParallax

      public static ITheme GetParallax()
      指定 Parallax 主题。
      
       ITheme theme = Themes.GetParallax();
       workbook.setTheme(theme);
       
      Returns:
      Parallax 主题.
    • GetQuotable

      public static ITheme GetQuotable()
      指定 Quotable 主题。
      
       ITheme theme = Themes.GetQuotable();
       workbook.setTheme(theme);
       
      Returns:
      Quotable 主题.
    • GetRetrospect

      public static ITheme GetRetrospect()
      指定 Retrospect 主题。
      
       ITheme theme = Themes.GetRetrospect();
       workbook.setTheme(theme);
       
      Returns:
      Retrospect 主题.
    • GetSavon

      public static ITheme GetSavon()
      指定 Savon 主题。
      
       ITheme theme = Themes.GetSavon();
       workbook.setTheme(theme);
       
      Returns:
      Savon 主题.
    • GetSlate

      public static ITheme GetSlate()
      指定 Slate 主题。
      
       ITheme theme = Themes.GetSlate();
       workbook.setTheme(theme);
       
      Returns:
      Slate 主题.
    • GetSlice

      public static ITheme GetSlice()
      指定 Slice 主题。
      
       ITheme theme = Themes.GetSlice();
       workbook.setTheme(theme);
       
      Returns:
      Slice 主题.
    • GetVaporTrail

      public static ITheme GetVaporTrail()
      指定 VaporTrail 主题。
      
       ITheme theme = Themes.GetVaporTrail();
       workbook.setTheme(theme);
       
      Returns:
      VaporTrail 主题.
    • GetView

      public static ITheme GetView()
      指定 View 主题。
      
       ITheme theme = Themes.GetView();
       workbook.setTheme(theme);
       
      Returns:
      View 主题.
    • GetWisp

      public static ITheme GetWisp()
      指定 Wisp 主题。
      
       ITheme theme = Themes.GetWisp();
       workbook.setTheme(theme);
       
      Returns:
      Wisp 主题.
    • GetWoodType

      public static ITheme GetWoodType()
      指定 WoodType 主题。
      
       ITheme theme = Themes.GetWoodType();
       workbook.setTheme(theme);
       
      Returns:
      WoodType 主题.
    • GetOffice2007

      public static ITheme GetOffice2007()
      指定 Office2007。
      
       ITheme theme = Themes.GetOffice2007();
       workbook.setTheme(theme);
       
      Returns:
      Office2007.
    • GetApex

      public static ITheme GetApex()
      指定 Apex 主题。
      
       ITheme theme = Themes.GetApex();
       workbook.setTheme(theme);
       
      Returns:
      Apex 主题.
    • GetAspect

      public static ITheme GetAspect()
      指定 Aspect 主题。
      
       ITheme theme = Themes.GetAspect();
       workbook.setTheme(theme);
       
      Returns:
      Aspect 主题.
    • GetCivic

      public static ITheme GetCivic()
      指定 Civic 主题。
      
       ITheme theme = Themes.GetCivic();
       workbook.setTheme(theme);
       
      Returns:
      Civic 主题.
    • GetConcourse

      public static ITheme GetConcourse()
      指定 Concourse 主题。
      
       ITheme theme = Themes.GetConcourse();
       workbook.setTheme(theme);
       
      Returns:
      Concourse 主题.
    • GetEquity

      public static ITheme GetEquity()
      指定 Equity 主题。
      
       ITheme theme = Themes.GetEquity();
       workbook.setTheme(theme);
       
      Returns:
      Equity 主题.
    • GetFlow

      public static ITheme GetFlow()
      指定 Flow 主题。
      
       ITheme theme = Themes.GetFlow();
       workbook.setTheme(theme);
       
      Returns:
      Flow 主题.
    • GetFoundry

      public static ITheme GetFoundry()
      指定 Foundry 主题。
      
       ITheme theme = Themes.GetFoundry();
       workbook.setTheme(theme);
       
      Returns:
      Foundry 主题.
    • GetMedian

      public static ITheme GetMedian()
      指定 Median 主题。
      
       ITheme theme = Themes.GetMedian();
       workbook.setTheme(theme);
       
      Returns:
      Median 主题.
    • GetMetro

      public static ITheme GetMetro()
      指定 Metro 主题。
      
       ITheme theme = Themes.GetMetro();
       workbook.setTheme(theme);
       
      Returns:
      Metro 主题.
    • GetModule

      public static ITheme GetModule()
      指定 Module 主题。
      
       ITheme theme = Themes.GetModule();
       workbook.setTheme(theme);
       
      Returns:
      Module 主题.
    • GetOpulent

      public static ITheme GetOpulent()
      指定 Opulent 主题。
      
       ITheme theme = Themes.GetOpulent();
       workbook.setTheme(theme);
       
      Returns:
      Opulent 主题.
    • GetOriel

      public static ITheme GetOriel()
      指定 Oriel 主题。
      
       ITheme theme = Themes.GetOriel();
       workbook.setTheme(theme);
       
      Returns:
      Oriel 主题.
    • GetOrigin

      public static ITheme GetOrigin()
      指定 Origin 主题。
      
       ITheme theme = Themes.GetOrigin();
       workbook.setTheme(theme);
       
      Returns:
      Origin 主题.
    • GetPaper

      public static ITheme GetPaper()
      指定 Paper 主题。
      
       ITheme theme = Themes.GetPaper();
       workbook.setTheme(theme);
       
      Returns:
      Paper 主题.
    • GetSolstice

      public static ITheme GetSolstice()
      指定 Solstice 主题。
      
       ITheme theme = Themes.GetSolstice();
       workbook.setTheme(theme);
       
      Returns:
      Solstice 主题.
    • GetTechnic

      public static ITheme GetTechnic()
      指定 Technic 主题。
      
       ITheme theme = Themes.GetTechnic();
       workbook.setTheme(theme);
       
      Returns:
      Technic 主题.
    • GetTrek

      public static ITheme GetTrek()
      指定 Trek 主题。
      
       ITheme theme = Themes.GetTrek();
       workbook.setTheme(theme);
       
      Returns:
      Trek 主题.
    • GetUrban

      public static ITheme GetUrban()
      指定 Urban 主题。
      
       ITheme theme = Themes.GetUrban();
       workbook.setTheme(theme);
       
      Returns:
      Urban 主题.
    • GetVerve

      public static ITheme GetVerve()
      指定 Verve 主题。
      
       ITheme theme = Themes.GetVerve();
       workbook.setTheme(theme);
       
      Returns:
      Verve 主题.