root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / layout / fframes / gui / dialogs / FFrameGroupDialog.java @ 9392
History | View | Annotate | Download (4.54 KB)
1 |
package com.iver.cit.gvsig.project.documents.layout.fframes.gui.dialogs; |
---|---|
2 |
|
3 |
import java.awt.geom.Rectangle2D; |
4 |
|
5 |
import javax.swing.JPanel; |
6 |
|
7 |
import com.iver.andami.PluginServices; |
8 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
9 |
import com.iver.cit.gvsig.project.documents.layout.FLayoutUtilities; |
10 |
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameGroup; |
11 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
12 |
import com.iver.cit.gvsig.project.documents.layout.fframes.gui.JPRotation; |
13 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
14 |
|
15 |
|
16 |
/**
|
17 |
* Di?logo de un grupo de fframe del Layout.
|
18 |
*
|
19 |
* @author Vicente Caballero Navarro
|
20 |
*/
|
21 |
public class FFrameGroupDialog extends JPanel implements IFFrameDialog { |
22 |
private javax.swing.JPanel jContentPane = null; |
23 |
private javax.swing.JButton bAceptar = null; |
24 |
private javax.swing.JButton bCancelar = null; |
25 |
private Rectangle2D rect = new Rectangle2D.Double(); |
26 |
private FFrameGroup fframegroup = null; |
27 |
private Layout m_layout = null; |
28 |
private boolean isAcepted = false; |
29 |
private JPRotation pRotation = null; |
30 |
private FFrameGroup newFFrameGroup;
|
31 |
|
32 |
|
33 |
/**
|
34 |
* This is the default constructor
|
35 |
*
|
36 |
* @param layout Referencia al Layout.
|
37 |
* @param fframe Referencia al fframe de imagen.
|
38 |
*/
|
39 |
public FFrameGroupDialog(Layout layout, FFrameGroup fframe) {
|
40 |
super();
|
41 |
fframegroup = fframe; |
42 |
m_layout = layout; |
43 |
initialize(); |
44 |
} |
45 |
|
46 |
/**
|
47 |
* Inserta el rect?ngulo que ocupar? el fframe de imagen.
|
48 |
*
|
49 |
* @param r Rect?ngulo.
|
50 |
*/
|
51 |
public void setRectangle(Rectangle2D r) { |
52 |
rect.setRect(r); |
53 |
} |
54 |
|
55 |
/**
|
56 |
* This method initializes this
|
57 |
*/
|
58 |
private void initialize() { |
59 |
this.setLayout(null); |
60 |
this.add(getJContentPane(), null); |
61 |
this.setSize(196, 191); |
62 |
getPRotation().setRotation(fframegroup.getRotation()); |
63 |
} |
64 |
|
65 |
/**
|
66 |
* This method initializes jContentPane
|
67 |
*
|
68 |
* @return javax.swing.JPanel
|
69 |
*/
|
70 |
private javax.swing.JPanel getJContentPane() {
|
71 |
if (jContentPane == null) { |
72 |
jContentPane = new javax.swing.JPanel();
|
73 |
jContentPane.setLayout(null);
|
74 |
jContentPane.add(getBAceptar(), null);
|
75 |
jContentPane.add(getBCancelar(), null);
|
76 |
jContentPane.setSize(192, 186); |
77 |
jContentPane.setLocation(0, 0); |
78 |
jContentPane.add(getPRotation(), null);
|
79 |
} |
80 |
|
81 |
return jContentPane;
|
82 |
} |
83 |
|
84 |
/**
|
85 |
* This method initializes bAceptar
|
86 |
*
|
87 |
* @return javax.swing.JButton
|
88 |
*/
|
89 |
private javax.swing.JButton getBAceptar() {
|
90 |
if (bAceptar == null) { |
91 |
bAceptar = new javax.swing.JButton();
|
92 |
bAceptar.setSize(85, 26); |
93 |
bAceptar.setText(PluginServices.getText(this, "Aceptar")); |
94 |
bAceptar.setLocation(7, 147); |
95 |
bAceptar.addActionListener(new java.awt.event.ActionListener() {
|
96 |
|
97 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
98 |
newFFrameGroup=(FFrameGroup)fframegroup.cloneFFrame(m_layout); |
99 |
newFFrameGroup.setBoundBox(FLayoutUtilities.toSheetRect( |
100 |
rect, m_layout.getLayoutControl().getAT())); |
101 |
newFFrameGroup.setRotation(getPRotation().getRotation()); |
102 |
PluginServices.getMDIManager().closeWindow(FFrameGroupDialog.this); |
103 |
//m_layout.refresh();
|
104 |
isAcepted = true;
|
105 |
} |
106 |
}); |
107 |
} |
108 |
|
109 |
return bAceptar;
|
110 |
} |
111 |
|
112 |
/**
|
113 |
* This method initializes bCancelar
|
114 |
*
|
115 |
* @return javax.swing.JButton
|
116 |
*/
|
117 |
private javax.swing.JButton getBCancelar() {
|
118 |
if (bCancelar == null) { |
119 |
bCancelar = new javax.swing.JButton();
|
120 |
bCancelar.setSize(85, 26); |
121 |
bCancelar.setText(PluginServices.getText(this, "Cancelar")); |
122 |
bCancelar.setLocation(99, 147); |
123 |
bCancelar.addActionListener(new java.awt.event.ActionListener() {
|
124 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
125 |
PluginServices.getMDIManager().closeWindow(FFrameGroupDialog.this); |
126 |
} |
127 |
}); |
128 |
} |
129 |
|
130 |
return bCancelar;
|
131 |
} |
132 |
|
133 |
/* (non-Javadoc)
|
134 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo()
|
135 |
*/
|
136 |
public WindowInfo getWindowInfo() {
|
137 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
|
138 |
m_viewinfo.setTitle(PluginServices.getText(this,
|
139 |
"propiedades_marco_imagenes"));
|
140 |
|
141 |
return m_viewinfo;
|
142 |
} |
143 |
|
144 |
/**
|
145 |
* @see com.iver.cit.gvsig.project.documents.layout.fframes.gui.dialogs.IFFrameDialog#getIsAcepted()
|
146 |
*/
|
147 |
public boolean getIsAcepted() { |
148 |
return isAcepted;
|
149 |
} |
150 |
|
151 |
/**
|
152 |
* @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
|
153 |
*/
|
154 |
public void viewActivated() { |
155 |
} |
156 |
|
157 |
/**
|
158 |
* This method initializes pRotation
|
159 |
*
|
160 |
* @return javax.swing.JPanel
|
161 |
*/
|
162 |
private JPRotation getPRotation() {
|
163 |
if (pRotation == null) { |
164 |
pRotation = new JPRotation();
|
165 |
pRotation.setBounds(30, 10, 120, 120); |
166 |
} |
167 |
return pRotation;
|
168 |
} |
169 |
|
170 |
public IFFrame getFFrame() {
|
171 |
return newFFrameGroup;
|
172 |
} |
173 |
} // @jve:decl-index=0:visual-constraint="10,10"
|
174 |
|