01: // @@
02: // @@
03: /*
04: * Wi.Ser Framework
05: *
06: * LGPL Version: 1.8.1, 20-September-2007
07: * Copyright (C) 2005-2006 Dirk von der Weiden <dvdw@imail.de>
08: *
09: * This library is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU Lesser General Public
11: * License as published by the Free Software Foundation; either
12: * version 2 of the License, or (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17: * Lesser General Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public
20: * License along with this library located in LGPL.txt in the
21: * license directory; if not, write to the
22: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23: * Boston, MA 02111-1307, USA.
24: *
25: * If this agreement does not cover your requirements, please contact us
26: * via email to get detailed information about the commercial license
27: * or our service offerings!
28: *
29: */
30: // @@
31: package de.ug2t.channel.ho.client.swing;
32:
33: import java.awt.*;
34:
35: import javax.swing.*;
36:
37: import de.ug2t.unifiedGui.interfaces.*;
38:
39: final class MyJSeparator extends JComponent {
40: /**
41: * <p>
42: * Does...
43: * </p>
44: * <p>
45: *
46: * @return a Type with
47: * </p>
48: * <p>
49: * @param
50: * </p>
51: */
52: public void paint(Graphics g) {
53: int wi = (int) this .getPreferredSize().getWidth();
54: if (wi != 0) {
55: g.drawLine(0, 0, wi, 0);
56: } else {
57: g.drawLine(0, 0, this .getBounds().width, 0);
58: }
59: }
60: }
61:
62: public final class HoSwingSeparatorLine extends HoSwingComponent
63: implements IUnSeparator {
64: private JComponent pem_swingObj = null;
65:
66: /**
67: * @param xName
68: * @param xAppl
69: * @throws Exception
70: */
71: public HoSwingSeparatorLine(String xName, int xLen,
72: IUnApplication xAppl) throws Exception {
73: super (xName, xAppl);
74:
75: this .pem_swingObj = new MyJSeparator();
76: this .pdm_realSwingCmp = this .pem_swingObj;
77: this .pcmf_setValue(xName);
78:
79: this .pem_swingObj.setPreferredSize(new Dimension(xLen, 1));
80: this .pem_swingObj.setMinimumSize(new Dimension(xLen, 1));
81: this .pem_swingObj.setMaximumSize(new Dimension(xLen, 1));
82:
83: ((HoSwingClient) xAppl).pcmf_addKeyDispatcher(this);
84: }
85: }
|