01: /*
02: * Created on 12/10/2004
03: *
04: * ============================================================================
05: * GNU Lesser General Public License
06: * ============================================================================
07: *
08: * Swing Components - visit http://sf.net/projects/gfd
09: *
10: * Copyright (C) 2004 Igor Regis da Silva Simões
11: *
12: * This library is free software; you can redistribute it and/or
13: * modify it under the terms of the GNU Lesser General Public
14: * License as published by the Free Software Foundation; either
15: * version 2.1 of the License, or (at your option) any later version.
16: *
17: * This library is distributed in the hope that it will be useful,
18: * but WITHOUT ANY WARRANTY; without even the implied warranty of
19: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20: * Lesser General Public License for more details.
21: *
22: * You should have received a copy of the GNU Lesser General Public
23: * License along with this library; if not, write to the Free Software
24: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
25: */
26: package br.com.gfpshare.beans;
27:
28: import java.awt.Dimension;
29: import java.awt.Graphics;
30:
31: import javax.swing.JInternalFrame;
32: import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
33:
34: /**
35: * @author Igor Regis da Silva Simoes
36: */
37: public class BotoesInternalFrame extends BasicInternalFrameTitlePane {
38: private static JInternalFrame duble = new JInternalFrame() {
39: {
40: setIconifiable(true);
41: setMaximizable(true);
42: setResizable(true);
43: setClosable(true);
44: }
45: };
46:
47: /**
48: * @param f
49: */
50: public BotoesInternalFrame(JInternalFrame f) {
51: super (f == null ? duble : f);
52: setSize(100, 21);
53: setPreferredSize(new Dimension(100, 21));
54: setMinimumSize(new Dimension(100, 21));
55: }
56:
57: /**
58: * @param f
59: */
60: public void setFrame(JInternalFrame f) {
61: frame = f == null ? duble : f;
62: }
63:
64: @Override
65: protected void addSubComponents() {
66: add(iconButton);
67: add(maxButton);
68: add(closeButton);
69: }
70:
71: /**
72: * @see javax.swing.JComponent#updateUI()
73: */
74: @Override
75: public void updateUI() {
76: installDefaults();
77: super .updateUI();
78: setButtonIcons();
79: }
80:
81: /**
82: * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
83: */
84: @Override
85: public void paintComponent(Graphics g) {
86: //Não pintamos todo o componente
87: }
88: }
|