Revision 9392 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/gui/Popupmenu.java
Popupmenu.java | ||
---|---|---|
52 | 52 |
import javax.swing.JPopupMenu; |
53 | 53 |
|
54 | 54 |
import com.iver.andami.PluginServices; |
55 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
56 |
import com.iver.cit.gvsig.gui.layout.fframes.FFrameLegend; |
|
57 | 55 |
import com.iver.cit.gvsig.project.documents.layout.FLayoutGraphics; |
56 |
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameLegend; |
|
58 | 57 |
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame; |
58 |
import com.iver.cit.gvsig.project.documents.layout.tools.listener.ILayoutGraphicListener; |
|
59 | 59 |
|
60 | 60 |
|
61 | 61 |
/** |
... | ... | |
147 | 147 |
}); |
148 | 148 |
m_refresh.addActionListener(new ActionListener() { |
149 | 149 |
public void actionPerformed(ActionEvent e) { |
150 |
m_layout.fullRefresh(); |
|
150 |
m_layout.getLayoutControl().fullRefresh();
|
|
151 | 151 |
} |
152 | 152 |
}); |
153 | 153 |
m_terminate.addActionListener(new ActionListener() { |
154 | 154 |
public void actionPerformed(ActionEvent e) { |
155 |
m_layout.endGraphic(); |
|
155 |
if (m_layout.getLayoutControl().getCurrentLayoutTool().getListener() instanceof ILayoutGraphicListener) { |
|
156 |
((ILayoutGraphicListener)m_layout.getLayoutControl().getCurrentLayoutTool().getListener()).endGraphic(); |
|
157 |
} |
|
156 | 158 |
} |
157 | 159 |
}); |
158 | 160 |
this.show(m_layout, m_p.x, m_p.y); |
159 | 161 |
} |
160 | 162 |
|
161 | 163 |
private void setEnables() { |
162 |
if ((m_layout.getTool()==Layout.POLYLINE ||
|
|
163 |
m_layout.getTool()==Layout.POLYGON)&&
|
|
164 |
m_layout.getGeometryAdapter().getPoints().length>0){ |
|
164 |
if ((m_layout.getLayoutControl().getCurrentTool().equals("layoutaddpolyline") ||
|
|
165 |
m_layout.getLayoutControl().getCurrentTool().equals("layoutaddpolygon"))&&
|
|
166 |
m_layout.getLayoutControl().getGeometryAdapter().getPoints().length>0){
|
|
165 | 167 |
|
166 | 168 |
m_refresh.setVisible(false); |
167 | 169 |
m_selecAll.setVisible(false); |
... | ... | |
174 | 176 |
return; |
175 | 177 |
} |
176 | 178 |
m_terminate.setVisible(false); |
177 |
IFFrame[] fframes=m_layout.getFFrameSelected(); |
|
178 |
m_selecAll.setEnabled(m_layout.isEditable()); |
|
179 |
if (fframes.length==0 || !m_layout.isEditable()) { |
|
179 |
IFFrame[] fframes=m_layout.getLayoutContext().getFFrameSelected();
|
|
180 |
m_selecAll.setEnabled(m_layout.getLayoutContext().isEditable());
|
|
181 |
if (fframes.length==0 || !m_layout.getLayoutContext().isEditable()) {
|
|
180 | 182 |
m_properties.setEnabled(false); |
181 | 183 |
m_behind.setEnabled(false); |
182 | 184 |
m_before.setEnabled(false); |
Also available in: Unified diff