You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ColorScaleFormatting.java 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * ====================================================================
  3. * Licensed to the Apache Software Foundation (ASF) under one or more
  4. * contributor license agreements. See the NOTICE file distributed with
  5. * this work for additional information regarding copyright ownership.
  6. * The ASF licenses this file to You under the Apache License, Version 2.0
  7. * (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. * ====================================================================
  18. */
  19. package org.apache.poi.ss.usermodel;
  20. import org.apache.poi.hssf.record.cf.Threshold;
  21. /**
  22. * High level representation for the Color Scale / Colour Scale /
  23. * Color Gradient Formatting component of Conditional Formatting settings
  24. */
  25. public interface ColorScaleFormatting {
  26. /**
  27. * How many control points should be used to map
  28. * the colours? Normally 2 or 3
  29. */
  30. int getNumControlPoints();
  31. /**
  32. * Sets the number of control points to use to map
  33. * the colours. Should normally be 2 or 3.
  34. * <p>After updating, you need to ensure that the
  35. * {@link Threshold} count and Color count match
  36. */
  37. void setNumControlPoints(int num);
  38. /**
  39. * Gets the list of colours that are interpolated
  40. * between.
  41. */
  42. Color[] getColors();
  43. /**
  44. * Sets the list of colours that are interpolated
  45. * between. The number must match {@link #getNumControlPoints()}
  46. */
  47. void setColors(Color[] colors);
  48. /**
  49. * Gets the list of thresholds
  50. */
  51. ConditionalFormattingThreshold[] getThresholds();
  52. /**
  53. * Sets the of thresholds. The number must match
  54. * {@link #getNumControlPoints()}
  55. */
  56. void setThresholds(ConditionalFormattingThreshold[] thresholds);
  57. /**
  58. * Creates a new, empty Threshold
  59. */
  60. ConditionalFormattingThreshold createThreshold();
  61. }