001: /**
002: * LibreSource
003: * Copyright (C) 2004-2008 Artenum SARL / INRIA
004: * http://www.libresource.org - contact@artenum.com
005: *
006: * This file is part of the LibreSource software,
007: * which can be used and distributed under license conditions.
008: * The license conditions are provided in the LICENSE.TXT file
009: * at the root path of the packaging that enclose this file.
010: * More information can be found at
011: * - http://dev.libresource.org/home/license
012: *
013: * Initial authors :
014: *
015: * Guillaume Bort / INRIA
016: * Francois Charoy / Universite Nancy 2
017: * Julien Forest / Artenum
018: * Claude Godart / Universite Henry Poincare
019: * Florent Jouille / INRIA
020: * Sebastien Jourdain / INRIA / Artenum
021: * Yves Lerumeur / Artenum
022: * Pascal Molli / Universite Henry Poincare
023: * Gerald Oster / INRIA
024: * Mariarosa Penzi / Artenum
025: * Gerard Sookahet / Artenum
026: * Raphael Tani / INRIA
027: *
028: * Contributors :
029: *
030: * Stephane Bagnier / Artenum
031: * Amadou Dia / Artenum-IUP Blois
032: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033: */package com.artenum.so6.dataflow;
034:
035: import java.awt.BasicStroke;
036: import java.awt.Color;
037: import java.awt.Stroke;
038:
039: /**
040: * @author Sebastien
041: */
042: public class StyleManager {
043: private static StyleManager manager;
044:
045: // Color
046: private Color BGColor;
047: private Color synchronizerBGColor;
048: private Color synchronizerFGColor;
049: private Color synchronizerBorderColor;
050: private Color connectionBGColor;
051: private Color connectionFGColor;
052: private Color connectionBorderColor;
053: private Color wsUpToDateColor;
054: private Color wsNeedUpdateColor;
055: private Color electricalConnectorColor;
056: private Color electricalWireColor;
057:
058: // Stroke
059: private Stroke electricalWireStroke;
060: private Stroke groupSelectionStroke;
061:
062: private StyleManager() {
063: BGColor = Color.WHITE;
064:
065: synchronizerBGColor = Color.BLACK;
066: synchronizerFGColor = Color.WHITE;
067: synchronizerBorderColor = Color.BLACK;
068:
069: connectionBGColor = Color.BLACK;
070: connectionFGColor = new Color(10, 200, 10);
071: connectionBorderColor = Color.BLACK;
072:
073: wsUpToDateColor = new Color(100, 200, 200);
074: wsNeedUpdateColor = new Color(200, 100, 200);
075:
076: electricalConnectorColor = Color.LIGHT_GRAY;
077: electricalWireColor = new Color(80, 50, 50);
078:
079: // Stroke
080: electricalWireStroke = new BasicStroke(1.5F);
081: groupSelectionStroke = new BasicStroke(1.5F);
082: }
083:
084: public static StyleManager getInstance() {
085: if (manager == null) {
086: manager = new StyleManager();
087: }
088:
089: return manager;
090: }
091:
092: public Stroke getElectricalWireStroke() {
093: return electricalWireStroke;
094: }
095:
096: public Stroke getGroupSelectionStroke() {
097: return groupSelectionStroke;
098: }
099:
100: public Color getSynchronizerBGColor() {
101: return synchronizerBGColor;
102: }
103:
104: public Color getSynchronizerBorderColor() {
105: return synchronizerBorderColor;
106: }
107:
108: public Color getSynchronizerFGColor() {
109: return synchronizerFGColor;
110: }
111:
112: public Color getBGColor() {
113: return BGColor;
114: }
115:
116: public Color getConnectionBGColor() {
117: return connectionBGColor;
118: }
119:
120: public Color getConnectionBorderColor() {
121: return connectionBorderColor;
122: }
123:
124: public Color getConnectionFGColor() {
125: return connectionFGColor;
126: }
127:
128: public Color getElectricalConnectorColor() {
129: return electricalConnectorColor;
130: }
131:
132: public Color getElectricalWireColor() {
133: return electricalWireColor;
134: }
135:
136: public Color getWsNeedUpdateColor() {
137: return wsNeedUpdateColor;
138: }
139:
140: public Color getWsUpToDateColor() {
141: return wsUpToDateColor;
142: }
143: }
|