From: <bma...@us...> - 2008-09-05 14:30:46
|
Revision: 3892 http://fudaa.svn.sourceforge.net/fudaa/?rev=3892&view=rev Author: bmarchan Date: 2008-09-05 14:30:52 +0000 (Fri, 05 Sep 2008) Log Message: ----------- Merge from FudaaModeleur_TC1 3861:3891 Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorLigneBriseePanel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorPanelInterface.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrGisProjectEditor.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanEditorPanel.java Property Changed: ---------------- branches/FudaaModeleur_TC1Bis/ branches/FudaaModeleur_TC1Bis/fudaa_devel/aide/src/bu/ branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISVisitorGeometryCollector.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/interpolation/InterpolationTargetGISAdapter.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java Property changes on: branches/FudaaModeleur_TC1Bis ___________________________________________________________________ Modified: svn:mergeinfo - /branches/Br_FudaaModeleur_TF:3445-3850 + /branches/Br_FudaaModeleur_TF:3445-3850 /branches/FudaaModeleur_TC1:3861-3891 Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/aide/src/bu ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/FudaaModeleur_TC1/fudaa_devel/aide/src/bu:3861-3891 Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISVisitorGeometryCollector.java ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/FudaaModeleur_TC1/fudaa_devel/ctulu/src/org/fudaa/ctulu/gis/GISVisitorGeometryCollector.java:3861-3891 Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ctulu/src/org/fudaa/ctulu/interpolation/InterpolationTargetGISAdapter.java ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/FudaaModeleur_TC1/fudaa_devel/ctulu/src/org/fudaa/ctulu/interpolation/InterpolationTargetGISAdapter.java:3861-3891 Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/FudaaModeleur_TC1/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java:3861-3891 Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/FudaaModeleur_TC1/fudaa_devel/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java:3861-3891 Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2008-09-05 13:44:23 UTC (rev 3891) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/CalqueGISEditionAction.java 2008-09-05 14:30:52 UTC (rev 3892) @@ -49,6 +49,7 @@ editor_=_editor; setScene(_scene); setEnabled(isTargetValid(null)); + setResizable(true); // setEnabled(editor_ != null && editor_.isEditable(target_)); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java 2008-09-05 13:44:23 UTC (rev 3891) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/BPaletteEdition.java 2008-09-05 14:30:52 UTC (rev 3892) @@ -83,7 +83,7 @@ public BPaletteEdition() { super(); - setLayout(new BuVerticalLayout(0, true, false)); + setLayout(new BuVerticalLayout(0, true, true)); buildGlobalsActions(this); editorPanel_ = new BuPanel(); editorPanel_.setLayout(new BuBorderLayout()); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2008-09-05 13:44:23 UTC (rev 3891) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2008-09-05 14:30:52 UTC (rev 3892) @@ -278,26 +278,14 @@ protected ZEditorPanelInterface getToolPanel() { ZEditorPanelInterface newPanel = null; if (isCalqueDessin(state_)) { - if (editorPanel_ != null && editorPanel_.getClass().equals(ZEditorLigneBriseePanel.class)) { - // ((ZEditorLigneBriseePanel) editorPanel_).updateEditor(this); - editorPanel_.targetChanged(getTarget()); - return editorPanel_; - } if (palette_ != null) { - newPanel = new ZEditorLigneBriseePanel(this); + // Recr\xE9\xE9, car peut changer en fonction de la forme en cours. + newPanel = new ZEditorLigneBriseePanel(this,getForme()); } } else if (isStateGlobalMove()) { newPanel = new ZCalqueDeplacementPanel(move_, getXYFormatter()); } -// else if ("GLOBAL_ROTATE".equals(state_)) { -// // Uniquement s'il n'a pas encore \xE9t\xE9 cr\xE9\xE9. -// if (pnRotation_==null) { -// pnRotation_=new ZEditorRotationPanel(sceneEditor_,getXYFormatter()); -// getSupport().addSelectionListener(pnRotation_); -// } -// newPanel=pnRotation_; -// } if (newPanel != null) { newPanel.targetChanged(getTarget()); } @@ -399,18 +387,7 @@ * @return le calque de dessin */ protected final ZCalqueEditionInteraction buildCalqueDessin(final String _com) { - int forme = -1; - if ("GLOBAL_ADD_POINT".equals(_com)) { - forme = DeForme.POINT; - } else if ("GLOBAL_ADD_POLYLIGNE".equals(_com)) { - forme = DeForme.LIGNE_BRISEE; - } else if ("GLOBAL_ADD_POLYGONE".equals(_com)) { - forme = DeForme.POLYGONE; - } else if ("GLOBAL_ADD_RECTANGLE".equals(_com)) { - forme = DeForme.RECTANGLE; - } else if ("GLOBAL_ADD_SEMIS".equals(_com)) { - forme = DeForme.MULTI_POINT; - } + int forme=getForme(); if (forme >= 0) { if (dessin_ == null) { dessin_ = new ZCalqueEditionInteraction(this); @@ -424,6 +401,25 @@ return null; } + /** + * @return La forme en construction en fonction de l'action en cours. + */ + protected int getForme() { + int forme = -1; + if ("GLOBAL_ADD_POINT".equals(state_)) { + forme = DeForme.POINT; + } else if ("GLOBAL_ADD_POLYLIGNE".equals(state_)) { + forme = DeForme.LIGNE_BRISEE; + } else if ("GLOBAL_ADD_POLYGONE".equals(state_)) { + forme = DeForme.POLYGONE; + } else if ("GLOBAL_ADD_RECTANGLE".equals(state_)) { + forme = DeForme.RECTANGLE; + } else if ("GLOBAL_ADD_SEMIS".equals(state_)) { + forme = DeForme.MULTI_POINT; + } + return forme; + } + EbliActionSimple actionDelete_; EbliActionSimple actionCancel_; Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorLigneBriseePanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorLigneBriseePanel.java 2008-09-05 13:44:23 UTC (rev 3891) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorLigneBriseePanel.java 2008-09-05 14:30:52 UTC (rev 3892) @@ -7,6 +7,7 @@ */ package org.fudaa.ebli.calque.edition; +import java.awt.BorderLayout; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -18,6 +19,8 @@ import java.util.Map; import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; import javax.swing.table.AbstractTableModel; import com.memoire.bu.*; @@ -33,6 +36,7 @@ import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.geometrie.GrPolyligne; +import org.fudaa.ebli.ressource.EbliResource; /** * Un panneau d'\xE9dition d'une ligne bris\xE9e qui s'affiche lorsque l'outil ligne bris\xE9e est s\xE9lectionn\xE9. @@ -190,20 +194,17 @@ private ValueModel tableModel_; - BuButton btEditer_; - BuButton btReprise_; BuButton btSaveLine_; ZEditionAttibutesContainer container_; - BuDesktop desktop_; - ZCalqueEditionInteraction edition_; - BuPalette editionDialog_; - Map editorAttribute_; + + /** Type de g\xE9ometrie a \xE9diter */ + int typeForme_; EbliFormatterInterface formatter_; @@ -217,9 +218,10 @@ /** * @param _editor l'editeur parent + * @param _typeForme Le type de g\xE9om\xE9trie a \xE9diter. */ - public ZEditorLigneBriseePanel(final ZEditorDefault _editor) { - setLayout(new BuVerticalLayout(2, false, false)); + public ZEditorLigneBriseePanel(final ZEditorDefault _editor, int _typeForme) { + setLayout(new BuVerticalLayout(2, true, true)); if (_editor.getTarget() != null && _editor.getTarget().getModelEditable().getGeomData() != null) { attributes_ = _editor.getTarget().getModelEditable().getGeomData().getAttributes(); } @@ -246,51 +248,53 @@ btReprise_.setIcon(palette_.getSelectedButton().getIcon()); } add(btReprise_); - if (canUseEditorButton()) { - if (btEditer_ == null) { - btEditer_ = new BuButton(); - btEditer_.setText(EbliLib.getS("Editer")); - btEditer_.addActionListener(this); - } + if (isParametersEditable()) { add(btSaveLine_); - add(btEditer_); } updateFeaturePanel(); if (tableModel_ != null) { tableModel_.updateAtomic(); } - desktop_ = _editor.getDesktop(); + typeForme_=_typeForme; + addParametersPanel(); + formatter_ = _editor.getXYFormatter(); } - private void showEditionDialog() { - if (desktop_ != null) { - if (editionDialog_ == null) { - tableModel_ = createValueModel(); - editionDialog_ = new BuPalette(); - editionDialog_.setClosable(true); - editionDialog_.setResizable(true); - final BuTable tb = new BuTable(tableModel_); - final BuScrollPane sp = new BuScrollPane(tb); - sp.setPreferredWidth(120); - sp.setPreferredHeight(60); - editionDialog_.setContent(sp); - editionDialog_.setVisible(true); - editionDialog_.pack(); - tb.getColumnModel().getColumn(0).setWidth(10); - desktop_.addInternalFrame(editionDialog_); + /** + * Ajoute le panneau pour pr\xE9ciser les parametres de g\xE9om\xE9trie. + */ + private void addParametersPanel() { + FuLog.trace("Type de g\xE9om\xE9trie en cours: "+typeForme_); + if (!isParametersEditable()) return; - // on place la fenetre en dessus de ce panneau - final Point desktopPt = desktop_.getLocationOnScreen(); - final Point p = this.getLocationOnScreen(); - editionDialog_.setLocation(p.x - desktopPt.x, p.y + getHeight() + 5 - desktopPt.y); - } else { - desktop_.addInternalFrame(editionDialog_); - } - } + if (typeForme_==DeForme.RECTANGLE || typeForme_==DeForme.LIGNE_BRISEE || + typeForme_==DeForme.POLYGONE || typeForme_==DeForme.MULTI_POINT) + add(getPolyParametersPanel()); + else if (typeForme_==DeForme.ELLIPSE) + FuLog.error("Not implemented"); } + + /** + * @return un panneau de coordonn\xE9es modifiables lors de la cr\xE9ation d'une + * polyligne ou rectangle. + */ + private JPanel getPolyParametersPanel() { + BuPanel pn=new BuPanel(); + pn.setLayout(new BorderLayout()); + pn.setBorder(new EmptyBorder(2, 2, 2, 2)); + tableModel_=createValueModel(); + final BuTable tb=new BuTable(tableModel_); + final BuScrollPane sp=new BuScrollPane(tb); + sp.setPreferredWidth(190); + sp.setPreferredHeight(60); + tb.getColumnModel().getColumn(0).setWidth(10); + pn.add(new BuLabel(EbliResource.EBLI.getString("Coordonn\xE9es")), BorderLayout.NORTH); + pn.add(sp, BorderLayout.CENTER); + return pn; + } - protected final boolean canUseEditorButton() { + protected final boolean isParametersEditable() { if (edition_ == null) { return false; } @@ -308,7 +312,7 @@ * @return le modele a utiliser pour afficher les valeurs */ protected ValueModel createValueModel() { - if (canUseEditorButton()) { + if (isParametersEditable()) { return new ValueModel(); } return null; @@ -348,8 +352,6 @@ public void actionPerformed(final ActionEvent _e) { if (_e.getSource() == btReprise_) { edition_.setGele(false); - } else if (_e.getSource() == btEditer_) { - showEditionDialog(); } else if (_e.getSource() == btSaveLine_) { (edition_.getFormeEnCours()).addCurrentForme(); } @@ -388,17 +390,10 @@ } public void close() { - desktop_ = null; btReprise_ = null; - if (editionDialog_ != null) { - editionDialog_.dispose(); - } } public void editionStopped() { - if (editionDialog_ != null) { - editionDialog_.dispose(); - } btSaveLine_.setEnabled(false); } @@ -452,11 +447,12 @@ if (!Arrays.equals(newAtt, attributes_)) { attributes_ = newAtt; container_ = null; + removeAll(); + updateFeaturePanel(); if (tableModel_ != null) { tableModel_.updateAtomicArrays(); } - removeAll(); - updateFeaturePanel(); + addParametersPanel(); } } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorPanelInterface.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorPanelInterface.java 2008-09-05 13:44:23 UTC (rev 3891) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/ebli/src/org/fudaa/ebli/calque/edition/ZEditorPanelInterface.java 2008-09-05 14:30:52 UTC (rev 3892) @@ -36,7 +36,7 @@ void calqueInteractionChanged(); /** - * Le calque editable cible est modifi\xE9. + * Appel\xE9 lorsqu'un changement de calque cible est affectu\xE9. * @param _target Le calque editable cible. */ void targetChanged(ZCalqueEditable _target); Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrGisProjectEditor.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrGisProjectEditor.java 2008-09-05 13:44:23 UTC (rev 3891) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrGisProjectEditor.java 2008-09-05 14:30:52 UTC (rev 3892) @@ -187,7 +187,7 @@ protected ZEditorPanelInterface getToolPanel() { if (isSIplanTarget() && isCalqueDessin(getCurrentAction())) { - return new TrSiPlanEditorPanel(this); + return new TrSiPlanEditorPanel(this,getForme()); } return super.getToolPanel(); } Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanEditorPanel.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanEditorPanel.java 2008-09-05 13:44:23 UTC (rev 3891) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrSiPlanEditorPanel.java 2008-09-05 14:30:52 UTC (rev 3892) @@ -40,7 +40,7 @@ } protected ValueModel createValueModel() { - if (canUseEditorButton()) { + if (isParametersEditable()) { return new SiPlanTableModel(); } return null; @@ -51,8 +51,8 @@ /** * @param _editor */ - public TrSiPlanEditorPanel(final TrGisProjectEditor _editor) { - super(_editor); + public TrSiPlanEditorPanel(final TrGisProjectEditor _editor, int _forme) { + super(_editor,_forme); final TrSiProfilLayer layer = (TrSiProfilLayer) _editor.getTrPanel().getLayerSiProfiles(); if (layer == null) { @@ -100,11 +100,7 @@ updateTz(); final AbstractTableModel model = TrSiPlanEditorPanel.this.getTableModel(); if (model != null) { - if (cb_.isSelected()) { - model.fireTableRowsInserted(2, 2); - } else { - model.fireTableRowsDeleted(2, 2); - } + model.fireTableStructureChanged(); } } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |