Menu

[b98dae]: / G4P / src / g4p_controls / GConstants.java  Maximize  Restore  History

Download this file

205 lines (169 with data), 7.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/*
Part of the GUI for Processing library
http://www.lagers.org.uk/g4p/index.html
http://gui4processing.googlecode.com/svn/trunk/
Copyright (c) 2008-09 Peter Lager
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
package g4p_controls;
import java.awt.Font;
import java.awt.font.TextAttribute;
import javax.swing.JOptionPane;
/**
* These constants can all be available to the Processor.
*
* @author Peter Lager
*
*/
public interface GConstants {
int RED_SCHEME = 0;
int GREEN_SCHEME = 1;
int YELLOW_SCHEME = 2;
int PURPLE_SCHEME = 3;
int ORANGE_SCHEME = 4;
int CYAN_SCHEME = 5;
int BLUE_SCHEME = 6;
int GOLD_SCHEME = 7;
int SCHEME_8 = 8;
int SCHEME_9 = 9;
int SCHEME_10 = 10;
int SCHEME_11 = 11;
int SCHEME_12 = 12;
int SCHEME_13 = 13;
int SCHEME_14 = 14;
int SCHEME_15 = 15;
// Keyboard values not covered by Processing
char HOME = java.awt.event.KeyEvent.VK_HOME;
char END = java.awt.event.KeyEvent.VK_END;
// Configuration constants
// GRoundControl
int CTRL_ANGULAR = 0x00000501;
int CTRL_HORIZONTAL = 0x00000502;
int CTRL_VERTICAL = 0x00000503;
// GWindow
int EXIT_APP = 0x00000f01;
int CLOSE_WINDOW = 0x00000f02;
int KEEP_OPEN = 0x00000f03;
int HIDE_WINDOW = 0x00000f04;
// ### GUI build constants ###
int USER_COL_SCHEME = 0x00010102;
// The min alpha level for a control to respond to mouse and keyboard
int ALPHA_BLOCK = 128;
// The min alpha before a pixel is considered for a hot spot
int ALPHA_PICK = 48;
// ### Scroll bar policy constants ###
/** Do not create or display any scrollbars for the text control. */
int SCROLLBARS_NONE = 0x0000;
/** Create and display vertical scrollbar only. */
int SCROLLBARS_VERTICAL_ONLY = 0x0001;
/** Create and display horizontal scrollbar only. */
int SCROLLBARS_HORIZONTAL_ONLY = 0x0002;
/** Create and display both vertical and horizontal scrollbars. */
int SCROLLBARS_BOTH = 0x0003;
/** whether to hide when not required */
int SCROLLBARS_AUTOHIDE = 0x1000;
// Slider / numeric display types
// Also used to filter in GTextField
int INTEGER = 0;
int DECIMAL = 1;
int EXPONENT = 2;
// Text orientation for sliders
int ORIENT_LEFT = -1;
int ORIENT_TRACK = 0;
int ORIENT_RIGHT = 1;
// Mouse wheel direction constants. FORWARD is default
// Do not change these values as they are used directly
int FORWARD = 1; // Default value
int REVERSE = -1;
// Stick mode
int X4 = 1;
int X8 = 2;
// Font style
int PLAIN = Font.PLAIN;
int BOLD = Font.BOLD;
int ITALIC = Font.ITALIC;
// Modal dialog messages
// Message types
int PLAIN_MESSAGE = JOptionPane.PLAIN_MESSAGE;
int ERROR_MESSAGE = JOptionPane.ERROR_MESSAGE;
int INFO_MESSAGE = JOptionPane.INFORMATION_MESSAGE;
int WARN_MESSAGE = JOptionPane.WARNING_MESSAGE;
int QUERY_MESSAGE = JOptionPane.QUESTION_MESSAGE;
// Option types
int YES_NO = JOptionPane.YES_NO_OPTION;
int YES_NO_CANCEL = JOptionPane.YES_NO_CANCEL_OPTION;
int OK_CANCEL = JOptionPane.OK_CANCEL_OPTION;
// Replies to option types
int OK = JOptionPane.OK_OPTION;
int YES = JOptionPane.YES_OPTION; // Has same int value as OK
int NO = JOptionPane.NO_OPTION;
int CANCEL = JOptionPane.CANCEL_OPTION;
int CLOSED = JOptionPane.CLOSED_OPTION;
// New one to reperesent undefined option
int UNDEFINED = Integer.MAX_VALUE;
// Attribute:- fontface Value Type:- String font family name e.g. "Times New Roman"
TextAttribute FAMILY = TextAttribute.FAMILY;
// Attribute:- font weight Value Type:- Float in range (0.5 to 2.75)
TextAttribute WEIGHT = TextAttribute.WEIGHT;
// Predefined constants for font weight
Float WEIGHT_EXTRA_LIGHT = new Float(0.5f);
Float WEIGHT_LIGHT = new Float(0.75f);
Float WEIGHT_DEMILIGHT = new Float(0.875f);
Float WEIGHT_REGULAR = new Float(1.0f);
Float WEIGHT_SEMIBOLD = new Float(1.25f);
Float WEIGHT_MEDIUM = new Float(1.5f);
Float WEIGHT_DEMIBOLD = new Float(1.75f);
Float WEIGHT_BOLD = new Float(2.0f);
Float WEIGHT_HEAVY = new Float(2.25f);
Float WEIGHT_EXTRABOLD = new Float(2.5f);
Float WEIGHT_ULTRABOLD = new Float(2.75f);
// Attribute:- font width Value Type:- Float in range (0.75 to 1.5)
TextAttribute WIDTH = TextAttribute.WIDTH;
// Predefined constants for font width
Float WIDTH_CONDENSED = new Float(0.75f);
Float WIDTH_SEMI_CONDENSED = new Float(0.875f);
Float WIDTH_REGULAR = new Float(1.0f);
Float WIDTH_SEMI_EXTENDED = new Float(1.25f);
Float WIDTH_EXTENDED = new Float(1.5f);
// Attribute:- font posture Value Type:- Float in range (0.0 to 0.20)
TextAttribute POSTURE = TextAttribute.POSTURE;
// Predefined constants for font posture (plain or italic)
Float POSTURE_REGULAR = new Float(0.0f);
Float POSTURE_OBLIQUE = new Float(0.20f);
// Attribute:- font size Value Type:- Float
TextAttribute SIZE = TextAttribute.SIZE;
// Attribute:- font superscript Value Type:- Integer (1 : super or -1 subscript)
TextAttribute SUPERSCRIPT = TextAttribute.SUPERSCRIPT;
// Predefined constants for font super/subscript
Integer SUPERSCRIPT_SUPER = new Integer(1);
Integer SUPERSCRIPT_SUB = new Integer(-1);
Integer SUPERSCRIPT_OFF = new Integer(0);
// Attribute:- font foreground and background colour Value Type:- Color
TextAttribute FOREGROUND = TextAttribute.FOREGROUND;
TextAttribute BACKGROUND = TextAttribute.BACKGROUND;
// Attribute:- font strike through Value:- Boolean
TextAttribute STRIKETHROUGH = TextAttribute.STRIKETHROUGH;
// Predefined constants for font strike through on/off
Boolean STRIKETHROUGH_ON = new Boolean(true);
Boolean STRIKETHROUGH_OFF = new Boolean(false);
// Attribute:- underline Value:- Boolean
TextAttribute UNDERLINE = TextAttribute.UNDERLINE;
// Predefined constants for font strike through on/off
int UNDERLINE_ON = TextAttribute.UNDERLINE_ON; // 0 / true);
int UNDERLINE_OFF = Integer.valueOf(-1);
// TextAttribute JUSTIFICATION = TextAttribute.JUSTIFICATION;
// Float JUSTIFICATION_FULL = new Float(1.0f);
// Float JUSTIFICATION_NONE = new Float(0.0f);
// int EAST = 123;
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.