001: package net.sourceforge.squirrel_sql.plugins.syntax;
002:
003: /*
004: * Copyright (C) 2003 Colin Bell
005: * colbell@users.sourceforge.net
006: *
007: * This is based on the text editor demonstration class that comes with
008: * the Ostermiller Syntax Highlighter Copyright (C) 2001 Stephen Ostermiller
009: * http://ostermiller.org/contact.pl?regarding=Syntax+Highlighting
010: *
011: * This program is free software; you can redistribute it and/or
012: * modify it under the terms of the GNU General Public License
013: * as published by the Free Software Foundation; either version 2
014: * of the License, or any later version.
015: *
016: * This program is distributed in the hope that it will be useful,
017: * but WITHOUT ANY WARRANTY; without even the implied warranty of
018: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
019: * GNU General Public License for more details.
020: *
021: * You should have received a copy of the GNU General Public License
022: * along with this program; if not, write to the Free Software
023: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
024: */
025: import java.awt.Color;
026:
027: /**
028: * Defines the attributes for a syntax style.
029: *
030: * @author <A HREF="mailto:colbell@users.sourceforge.net">Colin Bell</A>
031: */
032: public class SyntaxStyle {
033: /** name fo this style. */
034: private String _name;
035:
036: /** Is this an italic style. */
037: private boolean _isItalic = false;
038:
039: /** Is this an bold style. */
040: private boolean _isBold = false;
041:
042: private int _textRGB = Color.black.getRGB();
043:
044: private int _backgroundRGB = Color.white.getRGB();
045:
046: /**
047: * Default ctor.
048: */
049: public SyntaxStyle() {
050: super ();
051: }
052:
053: /**
054: * Copy ctor.
055: */
056: public SyntaxStyle(SyntaxStyle rhs) {
057: super ();
058: setName(rhs.getName());
059: setItalic(rhs.isItalic());
060: setBold(rhs.isBold());
061: setTextRGB(rhs.getTextRGB());
062: setBackgroundRGB(rhs.getBackgroundRGB());
063: }
064:
065: /**
066: * Retrieve the name of this style.
067: *
068: * @return The name of this style.
069: */
070: public String getName() {
071: return _name;
072: }
073:
074: /**
075: * Set the name of this style.
076: *
077: * @value The name of this style.
078: */
079: public void setName(String value) {
080: _name = value;
081: }
082:
083: /**
084: * Is this an italic style?
085: *
086: * @return <TT>true</TT> if this is an italic style.
087: */
088: public boolean isItalic() {
089: return _isItalic;
090: }
091:
092: /**
093: * Specify whether this is an italic style.
094: *
095: * @param value <TT>true</TT> if this is an italic style.
096: */
097: public void setItalic(boolean value) {
098: _isItalic = value;
099: }
100:
101: /**
102: * Is this a bold style?
103: *
104: * @return <TT>true</TT> if this is a bold style.
105: */
106: public boolean isBold() {
107: return _isBold;
108: }
109:
110: /**
111: * Specify whether this is a bold style.
112: *
113: * @param value <TT>true</TT> if this is a bold style.
114: */
115: public void setBold(boolean value) {
116: _isBold = value;
117: }
118:
119: /**
120: * Retrieve the RGB value for the text color.
121: *
122: * @return RGB value for text color.
123: */
124: public int getTextRGB() {
125: return _textRGB;
126: }
127:
128: /**
129: * Set the RGB value for the text color.
130: *
131: * @param value The RGB value for text color.
132: */
133: public void setTextRGB(int value) {
134: _textRGB = value;
135: }
136:
137: /**
138: * Retrieve the RGB value for the background color.
139: *
140: * @return RGB value for text color.
141: */
142: public int getBackgroundRGB() {
143: return _backgroundRGB;
144: }
145:
146: /**
147: * Set the RGB value for the background color.
148: *
149: * @param value The RGB value for text color.
150: */
151: public void setBackgroundRGB(int value) {
152: _backgroundRGB = value;
153: }
154: }
|