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.editor;
20:
21: import java.awt.BorderLayout;
22:
23: import javax.swing.JButton;
24: import javax.swing.JPanel;
25:
26: import com.jeta.forms.gui.form.GridView;
27:
28: /**
29: * Represents a row or column header that can be clicked or dragged to allow the
30: * user to change the row/column specs on a form layout.
31: *
32: * @author Jeff Tassin
33: */
34: public class MarginCell extends JPanel {
35: /**
36: * The one based index (either row or column index)
37: */
38: private int m_index;
39:
40: /**
41: * The orientation of the cell (horizontal/vertical )
42: */
43: private Orientation m_orientation;
44:
45: /**
46: * @directed
47: */
48: private GridView m_gridview;
49:
50: /**
51: * ctor for a cell in a margin
52: *
53: * @param orientation
54: * the orientation of the cell (vertical/horizontal)
55: * @param index
56: * the 1-based index of the cell
57: * @param view
58: * the grid view associated with this cell
59: */
60: public MarginCell(Orientation orientation, int index, GridView view) {
61: m_index = index;
62: m_orientation = orientation;
63: m_gridview = view;
64: setLayout(new BorderLayout());
65: JButton btn = new JButton("");
66: btn.setFocusPainted(false);
67: add(btn, BorderLayout.CENTER);
68: }
69:
70: }
|