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.images;
20:
21: import javax.swing.BorderFactory;
22: import javax.swing.ImageIcon;
23:
24: import com.jeta.forms.store.properties.IconProperty;
25:
26: /**
27: * View for editing the properties of an image in a form. This is basically an
28: * image properties view with a preview window.
29: *
30: * @author Jeff Tassin
31: */
32: public class ImageAssignmentView extends ImagePropertiesView {
33: /**
34: * ctor
35: */
36: public ImageAssignmentView(IconProperty iProp) {
37: super ("com/jeta/swingbuilder/gui/images/imageAssignment.frm",
38: iProp);
39: getView().getLabel(ImagePropertiesNames.ID_IMAGE_PREVIEW_LABEL)
40: .setText("");
41: getView()
42: .getPanel(ImagePropertiesNames.ID_IMAGE_PREVIEW_PANEL)
43: .setBorder(
44: BorderFactory
45: .createLineBorder(java.awt.Color.black));
46: setController(new ImagePropertiesController(this ));
47:
48: }
49:
50: /**
51: * Sets the image for this view
52: */
53: public void setImage(ImageIcon image) {
54: super.setImage(image);
55: getView().getLabel(ImagePropertiesNames.ID_IMAGE_PREVIEW_LABEL)
56: .setIcon(image);
57: }
58: }
|