| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
package com.drew.metadata.pcx; |
| 23 |
|
| 24 |
import com.drew.lang.annotations.NotNull; |
| 25 |
import com.drew.lang.annotations.Nullable; |
| 26 |
import com.drew.metadata.TagDescriptor; |
| 27 |
|
| 28 |
import static com.drew.metadata.pcx.PcxDirectory.*; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
@SuppressWarnings("WeakerAccess") |
| 34 |
public class PcxDescriptor extends TagDescriptor<PcxDirectory> |
| 35 |
{ |
| 36 |
public PcxDescriptor(@NotNull PcxDirectory directory) |
| 37 |
{ |
| 38 |
super(directory); |
| 39 |
} |
| 40 |
|
| 41 |
@Override |
| 42 |
public String getDescription(int tagType) |
| 43 |
{ |
| 44 |
switch (tagType) { |
| 45 |
case TAG_VERSION: |
| 46 |
return getVersionDescription(); |
| 47 |
case TAG_COLOR_PLANES: |
| 48 |
return getColorPlanesDescription(); |
| 49 |
case TAG_PALETTE_TYPE: |
| 50 |
return getPaletteTypeDescription(); |
| 51 |
default: |
| 52 |
return super.getDescription(tagType); |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
@Nullable |
| 57 |
public String getVersionDescription() |
| 58 |
{ |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
return getIndexedDescription(TAG_VERSION, |
| 63 |
"2.5 with fixed EGA palette information", |
| 64 |
null, |
| 65 |
"2.8 with modifiable EGA palette information", |
| 66 |
"2.8 without palette information (default palette)", |
| 67 |
"PC Paintbrush for Windows", |
| 68 |
"3.0 or better"); |
| 69 |
} |
| 70 |
|
| 71 |
@Nullable |
| 72 |
public String getColorPlanesDescription() |
| 73 |
{ |
| 74 |
return getIndexedDescription(TAG_COLOR_PLANES, 3, |
| 75 |
"24-bit color", |
| 76 |
"16 colors"); |
| 77 |
} |
| 78 |
|
| 79 |
@Nullable |
| 80 |
public String getPaletteTypeDescription() |
| 81 |
{ |
| 82 |
return getIndexedDescription(TAG_PALETTE_TYPE, 1, |
| 83 |
"Color or B&W", |
| 84 |
"Grayscale"); |
| 85 |
} |
| 86 |
} |