01: /*
02: * Copyright (C) 2005 Jeff Tassin
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package com.jeta.swingbuilder.gui.border;
20:
21: import com.jeta.forms.store.properties.BorderProperty;
22: import com.jeta.forms.store.properties.TitledBorderProperty;
23:
24: /**
25: * View that is used to create and edit bevel borders
26: *
27: * @author Jeff Tassin
28: */
29: public class TitledBorderView extends AbstractBorderView {
30:
31: /**
32: * ctor
33: */
34: public TitledBorderView() {
35: this (null);
36: }
37:
38: /**
39: * ctor
40: */
41: public TitledBorderView(TitledBorderProperty bp) {
42: super ("com/jeta/swingbuilder/gui/border/titledBorder.frm");
43: if (bp == null) {
44: setBorderProperty(new TitledBorderProperty());
45: } else {
46: setBorderProperty(bp);
47: }
48: getView().setBorder(
49: javax.swing.BorderFactory.createEmptyBorder(10, 10, 10,
50: 10));
51: }
52:
53: /**
54: * Creates a border property based on the view inputs
55: */
56: public BorderProperty createBorderProperty() {
57: TitledBorderProperty tp = new TitledBorderProperty();
58: setTitle(tp);
59: return tp;
60: }
61:
62: /**
63: * @return a description for this view. Typically used for a title in a
64: * dialog
65: */
66: public String getDescription() {
67: return "Titled Border";
68: }
69:
70: /**
71: * Updates this view based on the given border settings
72: */
73: public void setBorderProperty(BorderProperty border) {
74: super.setBorderProperty(border);
75: }
76: }
|