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.

HwmfBrushStyle.java 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.hwmf.record;
  16. /**
  17. * A 16-bit unsigned integer that defines the brush style. The legal values for this
  18. * field are defined as follows: if the value is not BS_PATTERN, BS_DIBPATTERNPT MUST be
  19. * assumed.
  20. */
  21. public enum HwmfBrushStyle {
  22. /**
  23. * A brush that paints a single, constant color, either solid or dithered.
  24. */
  25. BS_SOLID(0x0000),
  26. /**
  27. * A brush that does nothing. Using a BS_NULL brush in a graphics operation
  28. * MUST have the same effect as using no brush at all.
  29. */
  30. BS_NULL(0x0001),
  31. /**
  32. * A brush that paints a predefined simple pattern, or "hatch", onto a solid background.
  33. */
  34. BS_HATCHED(0x0002),
  35. /**
  36. * A brush that paints a pattern defined by a bitmap, which MAY be a Bitmap16
  37. * Object or a DeviceIndependentBitmap (DIB) Object.
  38. */
  39. BS_PATTERN(0x0003),
  40. /**
  41. * Not supported
  42. */
  43. BS_INDEXED(0x0004),
  44. /**
  45. * A pattern brush specified by a DIB.
  46. */
  47. BS_DIBPATTERN(0x0005),
  48. /**
  49. * A pattern brush specified by a DIB.
  50. */
  51. BS_DIBPATTERNPT(0x0006),
  52. /**
  53. * Not supported
  54. */
  55. BS_PATTERN8X8(0x0007),
  56. /**
  57. * Not supported
  58. */
  59. BS_DIBPATTERN8X8(0x0008),
  60. /**
  61. * Not supported
  62. */
  63. BS_MONOPATTERN(0x0009);
  64. int flag;
  65. HwmfBrushStyle(int flag) {
  66. this.flag = flag;
  67. }
  68. public static HwmfBrushStyle valueOf(int flag) {
  69. for (HwmfBrushStyle bs : values()) {
  70. if (bs.flag == flag) return bs;
  71. }
  72. return null;
  73. }
  74. }