001: /*
002: The contents of this file are subject to the Common Public Attribution License
003: Version 1.0 (the "License"); you may not use this file except in compliance with
004: the License. You may obtain a copy of the License at
005: http://www.projity.com/license . The License is based on the Mozilla Public
006: License Version 1.1 but Sections 14 and 15 have been added to cover use of
007: software over a computer network and provide for limited attribution for the
008: Original Developer. In addition, Exhibit A has been modified to be consistent
009: with Exhibit B.
010:
011: Software distributed under the License is distributed on an "AS IS" basis,
012: WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
013: specific language governing rights and limitations under the License. The
014: Original Code is OpenProj. The Original Developer is the Initial Developer and
015: is Projity, Inc. All portions of the code written by Projity are Copyright (c)
016: 2006, 2007. All Rights Reserved. Contributors Projity, Inc.
017:
018: Alternatively, the contents of this file may be used under the terms of the
019: Projity End-User License Agreeement (the Projity License), in which case the
020: provisions of the Projity License are applicable instead of those above. If you
021: wish to allow use of your version of this file only under the terms of the
022: Projity License and not to allow others to use your version of this file under
023: the CPAL, indicate your decision by deleting the provisions above and replace
024: them with the notice and other provisions required by the Projity License. If
025: you do not delete the provisions above, a recipient may use your version of this
026: file under either the CPAL or the Projity License.
027:
028: [NOTE: The text of this license may differ slightly from the text of the notices
029: in Exhibits A and B of the license at http://www.projity.com/license. You should
030: use the latest text at http://www.projity.com/license for your modifications.
031: You may not remove this license text from the source files.]
032:
033: Attribution Information: Attribution Copyright Notice: Copyright � 2006, 2007
034: Projity, Inc. Attribution Phrase (not exceeding 10 words): Powered by OpenProj,
035: an open source solution from Projity. Attribution URL: http://www.projity.com
036: Graphic Image as provided in the Covered Code as file: openproj_logo.png with
037: alternatives listed on http://www.projity.com/logo
038:
039: Display of Attribution Information is required in Larger Works which are defined
040: in the CPAL as a work which combines Covered Code or portions thereof with code
041: not governed by the terms of the CPAL. However, in addition to the other notice
042: obligations, all copies of the Covered Code in Executable and Source Code form
043: distributed must, as a form of attribution of the original author, include on
044: each user interface screen the "OpenProj" logo visible to all users. The
045: OpenProj logo should be located horizontally aligned with the menu bar and left
046: justified on the top left of the screen adjacent to the File menu. The logo
047: must be at least 100 x 25 pixels. When users click on the "OpenProj" logo it
048: must direct them back to http://www.projity.com.
049: */
050: package com.projity.graphic.configuration.shape;
051:
052: import java.awt.Color;
053: import java.util.HashMap;
054:
055: /**
056: * These are standard colors that are found all over the internet
057: */
058: public class Colors {
059: public static final Color ALICE_BLUE = new Color(0xf0f8ff);
060: public static final Color ANTIQUE_WHITE = new Color(0xfaebd7);
061: public static final Color AQUAMARINE = new Color(0x7fffd4);
062: public static final Color AZURE = new Color(0xf0ffff);
063: public static final Color BEIGE = new Color(0xf5f5dc);
064: public static final Color BISQUE = new Color(0xffe4c4);
065: public static final Color BLACK = new Color(0x000000);
066: public static final Color BLANCHED_ALMOND = new Color(0xffebcd);
067: public static final Color BLUE = new Color(0x0000ff);
068: public static final Color BLUE_VIOLET = new Color(0x8a2be2);
069: public static final Color BROWN = new Color(0xa52a2a);
070: public static final Color BURLY_WOOD = new Color(0xdeb887);
071: public static final Color CADET_BLUE = new Color(0x5f9ea0);
072: public static final Color CHARTREUSE = new Color(0x7fff00);
073: public static final Color CHOCOLATE = new Color(0xd2691e);
074: public static final Color CORAL = new Color(0xff7f50);
075: public static final Color CORNFLOWER_BLUE = new Color(0x6495ed);
076: public static final Color CORNSILK = new Color(0xfff8dc);
077: public static final Color CYAN = new Color(0x00ffff);
078: public static final Color DARK_GOLDENROD = new Color(0xb8860b);
079: public static final Color DARK_GREEN = new Color(0x006400);
080: public static final Color DARK_KHAKI = new Color(0xbdb76b);
081: public static final Color DARK_OLIVE_GREEN = new Color(0x556b2f);
082: public static final Color DARK_ORANGE = new Color(0xff8c00);
083: public static final Color DARK_ORCHID = new Color(0x9932cc);
084: public static final Color DARK_SALMON = new Color(0xe9967a);
085: public static final Color DARK_SEA_GREEN = new Color(0x8fbc8f);
086: public static final Color DARK_SLATE_BLUE = new Color(0x483d8b);
087: public static final Color DARK_SLATE_GRAY = new Color(0x2f4f4f);
088: public static final Color DARK_TURQUOISE = new Color(0x00ced1);
089: public static final Color DARK_VIOLET = new Color(0x9400d3);
090: public static final Color DEEP_PINK = new Color(0xff1493);
091: public static final Color DEEP_SKY_BLUE = new Color(0x00bfff);
092: public static final Color DIM_GRAY = new Color(0x696969);
093: public static final Color DODGER_BLUE = new Color(0x1e90ff);
094: public static final Color FIRE_BRICK = new Color(0xb22222);
095: public static final Color FLORAL_WHITE = new Color(0xfffaf0);
096: public static final Color FOREST_GREEN = new Color(0x228b22);
097: public static final Color GREEN = new Color(0x00ff00);
098: public static final Color GAINSBORO = new Color(0xdcdcdc);
099: public static final Color GHOST_WHITE = new Color(0xf8f8ff);
100: public static final Color GOLD = new Color(0xffd700);
101: public static final Color GOLDENROD = new Color(0xdaa520);
102: public static final Color GRAY = new Color(0xbebebe);
103: public static final Color HONEYDEW = new Color(0xf0fff0);
104: public static final Color HOT_PINK = new Color(0xff69b4);
105: public static final Color INDIAN_RED = new Color(0xcd5c5c);
106: public static final Color IVORY = new Color(0xfffff0);
107: public static final Color KHAKI = new Color(0xf0e68c);
108: public static final Color LAVENDER = new Color(0xe6e6fa);
109: public static final Color LAVENDER_BLUSH = new Color(0xfff0f5);
110: public static final Color LAWN_GREEN = new Color(0x7cfc00);
111: public static final Color LEMON_CHIFFON = new Color(0xfffacd);
112: public static final Color LIGHT_BLUE = new Color(0xadd8e6);
113: public static final Color LIGHT_CORAL = new Color(0xf08080);
114: public static final Color LIGHT_CYAN = new Color(0xe0ffff);
115: public static final Color LIGHT_GOLDENROD = new Color(0xeedd82);
116: public static final Color LIGHT_GOLDENROD_YELLOW = new Color(
117: 0xfafad2);
118: public static final Color LIGHT_GRAY = new Color(0xd3d3d3);
119: public static final Color LIGHT_GREY = new Color(0xd3d3d3);
120: public static final Color LIGHT_PINK = new Color(0xffb6c1);
121: public static final Color LIGHT_SALMON = new Color(0xffa07a);
122: public static final Color LIGHT_SEA_GREEN = new Color(0x20b2aa);
123: public static final Color LIGHT_SKY_BLUE = new Color(0x87cefa);
124: public static final Color LIGHT_SLATE_BLUE = new Color(0x8470ff);
125: public static final Color LIGHT_SLATE_GRAY = new Color(0x778899);
126: public static final Color LIGHT_SLATE_GREY = new Color(0x778899);
127: public static final Color LIGHT_STEEL_BLUE = new Color(0xb0c4de);
128: public static final Color LIGHT_YELLOW = new Color(0xffffe0);
129: public static final Color LIME_GREEN = new Color(0x32cd32);
130: public static final Color LINEN = new Color(0xfaf0e6);
131: public static final Color MAGENTA = new Color(0xff00ff);
132: public static final Color MAROON = new Color(0xb03060);
133: public static final Color MEDIUM_AQUAMARINE = new Color(0x66cdaa);
134: public static final Color MEDIUM_BLUE = new Color(0x0000cd);
135: public static final Color MEDIUM_ORCHID = new Color(0xba55d3);
136: public static final Color MEDIUM_PURPLE = new Color(0x9370db);
137: public static final Color MEDIUM_SEA_GREEN = new Color(0xcb371);
138: public static final Color MEDIUM_SLATE_BLUE = new Color(0x7b68ee);
139: public static final Color MEDIUM_SPRING_GREEN = new Color(0x00fa9a);
140: public static final Color MEDIUM_TURQUOISE = new Color(0x48d1cc);
141: public static final Color MEDIUM_VIOLET_RED = new Color(0xc71585);
142: public static final Color MIDNIGHT_BLUE = new Color(0x191970);
143: public static final Color MINT_CREAM = new Color(0xf5fffa);
144: public static final Color MISTY_ROSE = new Color(0xffe4e1);
145: public static final Color MOCCASIN = new Color(0xffe4b5);
146: public static final Color NAVAJO_WHITE = new Color(0xffdead);
147: public static final Color NAVY = new Color(0x000080);
148: public static final Color NAVY_BLUE = new Color(0x000080);
149: public static final Color OLD_LACE = new Color(0xfdf5e6);
150: public static final Color OLIVE_DRAB = new Color(0x6b8e23);
151: public static final Color ORANGE = new Color(0xffa500);
152: public static final Color ORANGE_RED = new Color(0xff4500);
153: public static final Color ORCHID = new Color(0xda70d6);
154: public static final Color PALE_GOLDENROD = new Color(0xeee8aa);
155: public static final Color PALE_GREEN = new Color(0x98fb98);
156: public static final Color PALE_YELLOW = new Color(0xfbfb56);
157: public static final Color PALE_TURQUOISE = new Color(0xafeeee);
158: public static final Color PALE_VIOLET_RED = new Color(0xdb7093);
159: public static final Color PAPAYA_WHIP = new Color(0xffefd5);
160: public static final Color PEACH_PUFF = new Color(0xffdab9);
161: public static final Color PERU = new Color(0xcd853f);
162: public static final Color PINK = new Color(0xffc0cb);
163: public static final Color PLUM = new Color(0xdda0dd);
164: public static final Color POWDER_BLUE = new Color(0xb0e0e6);
165: public static final Color PURPLE = new Color(0xa020f0);
166: public static final Color RED = new Color(0xff0000);
167: public static final Color ROSY_BROWN = new Color(0xbc8f8f);
168: public static final Color ROYAL_BLUE = new Color(0x4169e1);
169: public static final Color SADDLE_BROWN = new Color(0x8b4513);
170: public static final Color SALMON = new Color(0xfa8072);
171: public static final Color SANDY_BROWN = new Color(0xf4a460);
172: public static final Color SEA_GREEN = new Color(0x2e8b57);
173: public static final Color SEASHELL = new Color(0xfff5ee);
174: public static final Color SIENNA = new Color(0xa0522d);
175: public static final Color SKY_BLUE = new Color(0x87ceeb);
176: public static final Color SLATE_BLUE = new Color(0x6a5acd);
177: public static final Color SLATE_GRAY = new Color(0x708090);
178: public static final Color SNOW = new Color(0xfffafa);
179: public static final Color SPRING_GREEN = new Color(0x00ff7f);
180: public static final Color STEEL_BLUE = new Color(0x4682b4);
181: public static final Color TAN = new Color(0xd2b48c);
182: public static final Color THISTLE = new Color(0xd8bfd8);
183: public static final Color TOMATO = new Color(0xff6347);
184: public static final Color TURQUOISE = new Color(0x40e0d0);
185: public static final Color VIOLET = new Color(0xee82ee);
186: public static final Color VIOLET_RED = new Color(0xd02090);
187: public static final Color WHEAT = new Color(0xf5deb3);
188: public static final Color WHITE = new Color(0xffffff);
189: public static final Color WHITE_SMOKE = new Color(0xf5f5f5);
190: public static final Color YELLOW = new Color(0xffff00);
191: public static final Color YELLOW_GREEN = new Color(0x9acd32);
192:
193: // A few added for OpenProj
194: public static final Color NORMAL_YELLOW = new Color(0xffffb0);
195: public static final Color NORMAL_LIGHT_YELLOW = new Color(0xffffe0);
196: public static final Color MULTIPROJET1 = new Color(0xececec);
197: public static final Color MULTIPROJET0 = new Color(0xdcecec);
198: public static final Color VERY_LIGHT_GRAY = new Color(0xEAEAEA);
199:
200: private static Object[][] data = { { "ALICE_BLUE", ALICE_BLUE },
201: { "ANTIQUE_WHITE", ANTIQUE_WHITE },
202: { "AQUAMARINE", AQUAMARINE }, { "AZURE", AZURE },
203: { "BEIGE", BEIGE }, { "BISQUE", BISQUE },
204: { "BLACK", BLACK }, { "BLANCHED_ALMOND", BLANCHED_ALMOND },
205: { "BLUE", BLUE }, { "BLUE_VIOLET", BLUE_VIOLET },
206: { "BROWN", BROWN }, { "BURLY_WOOD", BURLY_WOOD },
207: { "CADET_BLUE", CADET_BLUE }, { "CHARTREUSE", CHARTREUSE },
208: { "CHOCOLATE", CHOCOLATE }, { "CORAL", CORAL },
209: { "CORNFLOWER_BLUE", CORNFLOWER_BLUE },
210: { "CORNSILK", CORNSILK }, { "CYAN", CYAN },
211: { "DARK_GOLDENROD", DARK_GOLDENROD },
212: { "DARK_GREEN", DARK_GREEN }, { "DARK_KHAKI", DARK_KHAKI },
213: { "DARK_OLIVE_GREEN", DARK_OLIVE_GREEN },
214: { "DARK_ORANGE", DARK_ORANGE },
215: { "DARK_ORCHID", DARK_ORCHID },
216: { "DARK_SALMON", DARK_SALMON },
217: { "DARK_SEA_GREEN", DARK_SEA_GREEN },
218: { "DARK_SLATE_BLUE", DARK_SLATE_BLUE },
219: { "DARK_SLATE_GRAY", DARK_SLATE_GRAY },
220: { "DARK_TURQUOISE", DARK_TURQUOISE },
221: { "DARK_VIOLET", DARK_VIOLET }, { "DEEP_PINK", DEEP_PINK },
222: { "DEEP_SKY_BLUE", DEEP_SKY_BLUE },
223: { "DIM_GRAY", DIM_GRAY }, { "DODGER_BLUE", DODGER_BLUE },
224: { "FIRE_BRICK", FIRE_BRICK },
225: { "FLORAL_WHITE", FLORAL_WHITE },
226: { "FOREST_GREEN", FOREST_GREEN }, { "GREEN", GREEN },
227: { "GAINSBORO", GAINSBORO }, { "GHOST_WHITE", GHOST_WHITE },
228: { "GOLD", GOLD }, { "GOLDENROD", GOLDENROD },
229: { "GRAY", GRAY }, { "HONEYDEW", HONEYDEW },
230: { "HOT_PINK", HOT_PINK }, { "INDIAN_RED", INDIAN_RED },
231: { "IVORY", IVORY }, { "KHAKI", KHAKI },
232: { "LAVENDER", LAVENDER },
233: { "LAVENDER_BLUSH", LAVENDER_BLUSH },
234: { "LAWN_GREEN", LAWN_GREEN },
235: { "LEMON_CHIFFON", LEMON_CHIFFON },
236: { "LIGHT_BLUE", LIGHT_BLUE },
237: { "LIGHT_CORAL", LIGHT_CORAL },
238: { "LIGHT_CYAN", LIGHT_CYAN },
239: { "LIGHT_GOLDENROD", LIGHT_GOLDENROD },
240: { "LIGHT_GOLDENROD_YELLOW", LIGHT_GOLDENROD_YELLOW },
241: { "LIGHT_GRAY", LIGHT_GRAY }, { "LIGHT_GREY", LIGHT_GREY },
242: { "LIGHT_PINK", LIGHT_PINK },
243: { "LIGHT_SALMON", LIGHT_SALMON },
244: { "LIGHT_SEA_GREEN", LIGHT_SEA_GREEN },
245: { "LIGHT_SKY_BLUE", LIGHT_SKY_BLUE },
246: { "LIGHT_SLATE_BLUE", LIGHT_SLATE_BLUE },
247: { "LIGHT_SLATE_GRAY", LIGHT_SLATE_GRAY },
248: { "LIGHT_SLATE_GREY", LIGHT_SLATE_GREY },
249: { "LIGHT_STEEL_BLUE", LIGHT_STEEL_BLUE },
250: { "LIGHT_YELLOW", LIGHT_YELLOW },
251: { "LIME_GREEN", LIME_GREEN }, { "LINEN", LINEN },
252: { "MAGENTA", MAGENTA }, { "MAROON", MAROON },
253: { "MEDIUM_AQUAMARINE", MEDIUM_AQUAMARINE },
254: { "MEDIUM_BLUE", MEDIUM_BLUE },
255: { "MEDIUM_ORCHID", MEDIUM_ORCHID },
256: { "MEDIUM_PURPLE", MEDIUM_PURPLE },
257: { "MEDIUM_SEA_GREEN", MEDIUM_SEA_GREEN },
258: { "MEDIUM_SLATE_BLUE", MEDIUM_SLATE_BLUE },
259: { "MEDIUM_SPRING_GREEN", MEDIUM_SPRING_GREEN },
260: { "MEDIUM_TURQUOISE", MEDIUM_TURQUOISE },
261: { "MEDIUM_VIOLET_RED", MEDIUM_VIOLET_RED },
262: { "MIDNIGHT_BLUE", MIDNIGHT_BLUE },
263: { "MINT_CREAM", MINT_CREAM }, { "MISTY_ROSE", MISTY_ROSE },
264: { "MOCCASIN", MOCCASIN }, { "NAVAJO_WHITE", NAVAJO_WHITE },
265: { "NAVY", NAVY }, { "NAVY_BLUE", NAVY_BLUE },
266: { "OLD_LACE", OLD_LACE }, { "OLIVE_DRAB", OLIVE_DRAB },
267: { "ORANGE", ORANGE }, { "ORANGE_RED", ORANGE_RED },
268: { "ORCHID", ORCHID }, { "PALE_GOLDENROD", PALE_GOLDENROD },
269: { "PALE_GREEN", PALE_GREEN },
270: { "PALE_TURQUOISE", PALE_TURQUOISE },
271: { "PALE_VIOLET_RED", PALE_VIOLET_RED },
272: { "PAPAYA_WHIP", PAPAYA_WHIP },
273: { "PEACH_PUFF", PEACH_PUFF }, { "PERU", PERU },
274: { "PINK", PINK }, { "PLUM", PLUM },
275: { "POWDER_BLUE", POWDER_BLUE }, { "PURPLE", PURPLE },
276: { "RED", RED }, { "ROSY_BROWN", ROSY_BROWN },
277: { "ROYAL_BLUE", ROYAL_BLUE },
278: { "SADDLE_BROWN", SADDLE_BROWN }, { "SALMON", SALMON },
279: { "SANDY_BROWN", SANDY_BROWN }, { "SEA_GREEN", SEA_GREEN },
280: { "SEASHELL", SEASHELL }, { "SIENNA", SIENNA },
281: { "SKY_BLUE", SKY_BLUE }, { "SLATE_BLUE", SLATE_BLUE },
282: { "SLATE_GRAY", SLATE_GRAY }, { "SNOW", SNOW },
283: { "SPRING_GREEN", SPRING_GREEN },
284: { "STEEL_BLUE", STEEL_BLUE }, { "TAN", TAN },
285: { "THISTLE", THISTLE }, { "TOMATO", TOMATO },
286: { "TURQUOISE", TURQUOISE }, { "VIOLET", VIOLET },
287: { "VIOLET_RED", VIOLET_RED }, { "WHEAT", WHEAT },
288: { "WHITE", WHITE }, { "WHITE_SMOKE", WHITE_SMOKE },
289: { "YELLOW", YELLOW }, { "YELLOW_GREEN", YELLOW_GREEN },
290: { "NORMAL_YELLOW", NORMAL_YELLOW },
291: { "NORMAL_LIGHT_YELLOW", NORMAL_LIGHT_YELLOW },
292: { "MULTIPROJET1", MULTIPROJET1 },
293: { "MULTIPROJET0", MULTIPROJET0 },
294: { "VERY_LIGHT_GRAY", VERY_LIGHT_GRAY } };
295:
296: private static HashMap colorMap = null;
297:
298: public static HashMap getColors() {
299: if (colorMap == null) {
300: colorMap = new HashMap();
301: for (int i = 0; i < data.length; i++) {
302: Object row[] = data[i];
303: colorMap.put(row[0], row[1]);
304: }
305: }
306: return colorMap;
307: }
308:
309: public static Color findColor(String key) {
310: Color found = (Color) getColors().get(key);
311: if (found == null) // if not a standard color, then assume that it needs to be parsed by color
312: found = Color.getColor(key);
313: return found;
314: }
315:
316: }
|