001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.unifiedGui;
032:
033: import java.awt.*;
034:
035: import de.ug2t.kernel.*;
036: import de.ug2t.unifiedGui.interfaces.*;
037:
038: public class UnBoxStyle {
039: public UnBoxBorder pcm_bLeft = null;
040: public UnBoxBorder pcm_bRight = null;
041: public UnBoxBorder pcm_bTop = null;
042: public UnBoxBorder pcm_bBottom = null;
043:
044: public int pcm_marginLeft = 0;
045: public int pcm_marginTop = 0;
046: public int pcm_marginRight = 0;
047: public int pcm_marginBottom = 0;
048:
049: public int pcm_paddingLeft = 0;
050: public int pcm_paddingTop = 0;
051: public int pcm_paddingRight = 0;
052: public int pcm_paddingBottom = 0;
053: private String pcm_align = "CENTER";
054: private int pcm_iAlign = GridBagConstraints.CENTER;
055:
056: public UnBoxStyle() {
057: return;
058: }
059:
060: public int pcmf_getIAlign() {
061: return (this .pcm_iAlign);
062: }
063:
064: public String pcmf_getAlign() {
065: return (pcm_align);
066: }
067:
068: public void pcmf_setAlign(String xAlign) {
069: try {
070: this .pcm_iAlign = java.awt.GridBagConstraints.class
071: .getDeclaredField(xAlign).getInt(null);
072: this .pcm_align = xAlign;
073: } catch (Exception e) {
074: KeLog.pcmf_log("ug2t", "no valid alignment: " + xAlign,
075: this , KeLog.ERROR);
076: }
077: }
078:
079: public void pcmf_setPadding(int xDir, int xWidth) {
080: switch (xDir) {
081: case IUnBox.LEFT:
082: this .pcm_paddingLeft = xWidth;
083: break;
084: case IUnBox.RIGHT:
085: this .pcm_paddingRight = xWidth;
086: break;
087: case IUnBox.TOP:
088: this .pcm_paddingTop = xWidth;
089: break;
090: case IUnBox.BOTTOM:
091: this .pcm_paddingBottom = xWidth;
092: break;
093: }
094: }
095:
096: public void pcmf_setMargin(int xDir, int xWidth) {
097: switch (xDir) {
098: case IUnBox.LEFT:
099: this .pcm_marginLeft = xWidth;
100: break;
101: case IUnBox.RIGHT:
102: this .pcm_marginRight = xWidth;
103: break;
104: case IUnBox.TOP:
105: this .pcm_marginTop = xWidth;
106: break;
107: case IUnBox.BOTTOM:
108: this .pcm_marginBottom = xWidth;
109: break;
110: }
111: }
112:
113: public void pcmf_setBorder(int xDir, String xCol, int xWidth,
114: int xStyle) {
115: switch (xDir) {
116: case IUnBox.LEFT:
117: this .pcm_bLeft = new UnBoxBorder(xCol, xWidth, xStyle);
118: break;
119: case IUnBox.RIGHT:
120: this .pcm_bRight = new UnBoxBorder(xCol, xWidth, xStyle);
121: break;
122: case IUnBox.TOP:
123: this .pcm_bTop = new UnBoxBorder(xCol, xWidth, xStyle);
124: break;
125: case IUnBox.BOTTOM:
126: this .pcm_bBottom = new UnBoxBorder(xCol, xWidth, xStyle);
127: break;
128: }
129: }
130:
131: public UnBoxBorder pcmf_getBorder(int xDir) {
132: switch (xDir) {
133: case IUnBox.LEFT:
134: return (this .pcm_bLeft);
135: case IUnBox.RIGHT:
136: return (this .pcm_bRight);
137: case IUnBox.TOP:
138: return (this .pcm_bTop);
139: case IUnBox.BOTTOM:
140: return (this .pcm_bBottom);
141: default:
142: return (null);
143: }
144: }
145:
146: public int pcmf_getPadding(int xDir) {
147: switch (xDir) {
148: case IUnBox.LEFT:
149: return (this .pcm_paddingLeft);
150: case IUnBox.RIGHT:
151: return (this .pcm_paddingRight);
152: case IUnBox.TOP:
153: return (this .pcm_paddingTop);
154: case IUnBox.BOTTOM:
155: return (this .pcm_paddingBottom);
156: default:
157: return (0);
158: }
159: }
160:
161: public int pcmf_getMargin(int xDir) {
162: switch (xDir) {
163: case IUnBox.LEFT:
164: return (this .pcm_marginLeft);
165: case IUnBox.RIGHT:
166: return (this .pcm_marginRight);
167: case IUnBox.TOP:
168: return (this .pcm_marginTop);
169: case IUnBox.BOTTOM:
170: return (this .pcm_marginBottom);
171: default:
172: return (0);
173: }
174: }
175: }
|