From: <de...@us...> - 2013-09-13 09:22:49
|
Revision: 8500 http://sourceforge.net/p/fudaa/svn/8500 Author: deniger Date: 2013-09-13 09:22:47 +0000 (Fri, 13 Sep 2013) Log Message: ----------- corrections minor bugs Modified Paths: -------------- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonnees.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZSceneEditor.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/find/CalqueFindActionAbstract.java Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonnees.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonnees.java 2013-09-13 09:21:37 UTC (rev 8499) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonnees.java 2013-09-13 09:22:47 UTC (rev 8500) @@ -92,8 +92,7 @@ sentEvent = selection_.xor(_s); break; case EbliSelectionState.ACTION_REPLACE: - selection_.setSelection(_s); - sentEvent = true; + sentEvent = selection_.setSelection(_s); break; case EbliSelectionState.ACTION_AND: sentEvent = selection_.intersection(_s); Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZSceneEditor.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZSceneEditor.java 2013-09-13 09:21:37 UTC (rev 8499) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZSceneEditor.java 2013-09-13 09:22:47 UTC (rev 8500) @@ -195,6 +195,11 @@ GrBoite boite = null; for (ZCalqueAffichageDonneesInterface cq : scene_.getAllLayers()) { GrBoite boiteTmp = cq.getDomaineOnSelected(); + if (boiteTmp != null) { + if (boiteTmp.getDeltaX() <= 0 || boiteTmp.getDeltaY() <= 0) { + boiteTmp = cq.getZoomOnSelected(); + } + } if (boite == null) { boite = boiteTmp; } else { Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/find/CalqueFindActionAbstract.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/find/CalqueFindActionAbstract.java 2013-09-13 09:21:37 UTC (rev 8499) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/find/CalqueFindActionAbstract.java 2013-09-13 09:22:47 UTC (rev 8500) @@ -78,9 +78,9 @@ final EbliFindComponent poly = buildPolygoneComponent(_parent); final EbliFindComponent first = (expr_ == null) ? buildSimpleComp() : buildExprComp(); if (layer_ instanceof ZCalqueSondeInterface) { - final EbliFindComponent[] cmp = new EbliFindComponent[] { first, poly, new EbliFindComponentSonde() }; - final String[] str = new String[] { EbliLib.getS("Indices"), getPolygonStr(), EbliLib.getS("Interpolation") }; - final Icon[] ic = new BuIcon[] { BuResource.BU.getToolIcon("rechercher"), getPolygonIcon(), EbliResource.EBLI.getToolIcon("pointeur") }; + final EbliFindComponent[] cmp = new EbliFindComponent[]{first, poly, new EbliFindComponentSonde()}; + final String[] str = new String[]{EbliLib.getS("Indices"), getPolygonStr(), EbliLib.getS("Interpolation")}; + final Icon[] ic = new BuIcon[]{BuResource.BU.getToolIcon("rechercher"), getPolygonIcon(), EbliResource.EBLI.getToolIcon("pointeur")}; final EbliFindComponentComposite c = new EbliFindComponentComposite(cmp, str, ic); final ZCalqueSondeInterface sonde = (ZCalqueSondeInterface) layer_; if (sonde.isSondeActive()) { @@ -88,8 +88,8 @@ } return c; } - return new EbliFindComponentComposite(new EbliFindComponent[] { first, poly }, new String[] { EbliLib.getS("Rechercher:"), getPolygonStr() }, - new BuIcon[] { BuResource.BU.getToolIcon("rechercher"), getPolygonIcon() }); + return new EbliFindComponentComposite(new EbliFindComponent[]{first, poly}, new String[]{EbliLib.getS("Rechercher:"), getPolygonStr()}, + new BuIcon[]{BuResource.BU.getToolIcon("rechercher"), getPolygonIcon()}); } protected EbliFindComponent buildPolygoneComponent(final EbliFindable _parent) { @@ -197,7 +197,7 @@ if (b) { visu.getScene().fireSelectionEvent(); } - return b; + return selection != null && !selection.isEmpty(); } private boolean isSonde(final String _action) { @@ -229,5 +229,4 @@ public final String toString() { return ((ZCalqueAffichageDonneesInterface) layer_).getTitle(); } - } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2014-02-07 09:27:44
|
Revision: 8603 http://sourceforge.net/p/fudaa/svn/8603 Author: deniger Date: 2014-02-07 09:27:41 +0000 (Fri, 07 Feb 2014) Log Message: ----------- CRUE-603 Modified Paths: -------------- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalque.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/TreeDeleteCalqueAction.java Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalque.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalque.java 2014-02-07 08:04:26 UTC (rev 8602) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalque.java 2014-02-07 09:27:41 UTC (rev 8603) @@ -320,7 +320,9 @@ int ye = _ye; final int selRow = getRowForLocation(xe, ye); if (selRow != -1) { + final TreePath selPath = getPathForLocation(xe, ye); + getSelectionModel().setSelectionPath(selPath); final Object selObject = selPath.getLastPathComponent(); final JPopupMenu menu = buildPopupMenu((BCalque) selObject); // B.M. On abandonne ce calcul cens\xE9 mieux positionner le popupmenu : Si l'arbre Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/TreeDeleteCalqueAction.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/TreeDeleteCalqueAction.java 2014-02-07 08:04:26 UTC (rev 8602) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/TreeDeleteCalqueAction.java 2014-02-07 09:27:41 UTC (rev 8603) @@ -22,7 +22,7 @@ * @version $Id$ */ public class TreeDeleteCalqueAction extends EbliActionSimple { - + protected BArbreCalqueModel treeModel_; /** @@ -31,22 +31,22 @@ * @param _treeModel Le modele d'arbre. */ public TreeDeleteCalqueAction(BArbreCalqueModel _treeModel) { - super(EbliLib.getS("D\xE9truire"), EbliResource.EBLI.getIcon("detruire"), "DETRUIRE"); + super(EbliLib.getS("Supprimer"), EbliResource.EBLI.getIcon("detruire"), "DETRUIRE"); treeModel_ = _treeModel; } - + @Override public void updateStateBeforeShow() { super.updateStateBeforeShow(); setEnabled(treeModel_ != null && treeModel_.isEditable()); } - + @Override public void actionPerformed(final ActionEvent _e) { if (treeModel_ == null || !treeModel_.isEditable()) { return; } - + final BCalque[] c = treeModel_.getSelection(); if (c.length == 0) { return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2014-02-14 08:28:43
|
Revision: 8617 http://sourceforge.net/p/fudaa/svn/8617 Author: deniger Date: 2014-02-14 08:28:37 +0000 (Fri, 14 Feb 2014) Log Message: ----------- Modified Paths: -------------- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalque.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalqueModel.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BCalque.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesConfigure.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueCatchInteraction.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZEbliCalquesPanel.java Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalque.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalque.java 2014-02-13 16:34:05 UTC (rev 8616) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalque.java 2014-02-14 08:28:37 UTC (rev 8617) @@ -34,6 +34,7 @@ /** * Un menu pour le composant de cartographie utilisant des calques non bas\xE9s sur des mod\xE8le. + * * @see EbliFilleCalques * @deprecated */ @@ -57,11 +58,11 @@ addMenuItem(EbliResource.EBLI.getString("Actif"), "GELE_NON", null, true, 0, _arbre); addSeparator(); addMenuItem(EbliResource.EBLI.getString("En premier"), "PREMIER", EbliResource.EBLI.getIcon("enpremier"), true, 0, - _arbre); + _arbre); addMenuItem(CtuluLib.getS("Monter"), "MONTER", CtuluResource.CTULU.getIcon("monter"), true, 0, _arbre); addMenuItem(CtuluLib.getS("Descendre"), "DESCENDRE", CtuluResource.CTULU.getIcon("descendre"), true, 0, _arbre); addMenuItem(EbliResource.EBLI.getString("En dernier"), "DERNIER", EbliResource.EBLI.getIcon("endernier"), true, 0, - _arbre); + _arbre); addSeparator(); add(new JMenuItem(_arbre.actDelete_)); } @@ -133,7 +134,7 @@ @Override public void itemStateChanged(ItemEvent e) { if (cqEdite_ != null) {; - cqEdite_.setVisible(editor_.cbVisible_.isSelected()); + cqEdite_.setUserVisible(editor_.cbVisible_.isSelected()); fireEditingStopped(); } } @@ -147,7 +148,7 @@ @Override public void keyReleased(final KeyEvent _e) { if (_e.getKeyCode() == KeyEvent.VK_ENTER && editor_.r1_.getText() != null - && editor_.r1_.getText().trim().length() > 0) { + && editor_.r1_.getText().trim().length() > 0) { cqEdite_.setTitle(editor_.r1_.getText()); fireEditingStopped(); } @@ -216,7 +217,7 @@ return true; } // pour modifier le nom else if (e.getClickCount() == 2 && (e.getX() > r.x + cbWidth_ + cq.getIconWidth()) && (e.getX() < r.x + r.width) - && cq.isTitleModifiable()) { + && cq.isTitleModifiable()) { return true; } @@ -243,7 +244,7 @@ @Override public Component getTreeCellEditorComponent(final JTree _tree, final Object _value, final boolean _isSelected, - final boolean _expanded, final boolean _leaf, final int _row) { + final boolean _expanded, final boolean _leaf, final int _row) { cqEdite_ = (BCalque) _value; editor_.getTreeCellRendererComponent(_tree, _value, _isSelected, _expanded, _leaf, _row, true); editor_.r1_.setEditable(cqEdite_.isTitleModifiable()); @@ -271,10 +272,10 @@ boolean old = isEditable(); if (old != flag) { super.setEditable(flag); - + if (getArbreModel() != null) { getArbreModel().setEditable(flag); - + } } } @@ -498,8 +499,8 @@ } /** - * Representation d'un calque dans un cellule de l'arbre. Elle associe au nom du calque son icone, et la dessine devant. Elle - * dessine aussi l'etat du calque (attenue, rapide, gele) sous la forme d'une chaine de caracteres. Utilisee pour tous les lnk + * Representation d'un calque dans un cellule de l'arbre. Elle associe au nom du calque son icone, et la dessine devant. Elle dessine aussi l'etat + * du calque (attenue, rapide, gele) sous la forme d'une chaine de caracteres. Utilisee pour tous les lnk */ public static class ArbreCell1 extends JPanel implements TreeCellRenderer { @@ -582,19 +583,19 @@ @Override public Component getTreeCellRendererComponent(final JTree _tree, final Object _value, final boolean _selected, - final boolean _expanded, final boolean _leaf, final int _row, - final boolean _hasFocus) { + final boolean _expanded, final boolean _leaf, final int _row, + final boolean _hasFocus) { r1_.setText(_value.toString()); final Font ft = _tree.getFont(); r1_.setFont(ft); r2_.setFont(BuLib.deriveFont(ft, -2)); String calqueInfo = null; - String longTitle=null; + String longTitle = null; final StringBuffer s = new StringBuffer(); if (_value instanceof BCalque) { final BCalque calque = (BCalque) _value; r3_.setIcon(calque); - longTitle=calque.getLongTitle(); + longTitle = calque.getLongTitle(); // Si on souhaite pouvoir retailler l'icon du calque. // r3_.setIcon(CtuluLibImage.resize(calque,r3_.getPreferredSize().width,r3_.getPreferredSize().height)); @@ -650,7 +651,7 @@ } else { cbVisible_.setState(BuCheckBox3States.STATE_MIXED); } - } else if (!calque.isVisible()) { + } else if (!calque.isUserVisible()) { if (s.length() > 0) { s.append(CtuluLibString.ESPACE); } @@ -697,10 +698,11 @@ final JComponent cq = (JComponent) _value; final String link = CtuluLibSwing.getHelpUrl(cq); if (link == null) { - if (longTitle==null) + if (longTitle == null) { tooltip.append(_value.toString()); - else + } else { tooltip.append(longTitle); + } } else { tooltip.append("<a href=\"").append(link).append("\">").append(_value.toString()).append("</a>"); } @@ -729,8 +731,8 @@ } /** - * Representation d'un calque dans une cellule de l'arbre. Elle est toute simple: nom du calque dans un label. Utilisee dans les - * looks Windows et Motif + * Representation d'un calque dans une cellule de l'arbre. Elle est toute simple: nom du calque dans un label. Utilisee dans les looks Windows et + * Motif */ public static class ArbreCellLabel extends JLabel implements TreeCellRenderer { @@ -744,8 +746,8 @@ @Override public Component getTreeCellRendererComponent(final JTree _tree, final Object _value, final boolean _selected, - final boolean _expanded, final boolean _leaf, final int _row, - final boolean _hasFocus) { + final boolean _expanded, final boolean _leaf, final int _row, + final boolean _hasFocus) { this.setFont(_tree.getFont()); setIcon((Icon) _value); setText(_value.toString()); Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalqueModel.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalqueModel.java 2014-02-13 16:34:05 UTC (rev 8616) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BArbreCalqueModel.java 2014-02-14 08:28:37 UTC (rev 8617) @@ -56,7 +56,7 @@ public static final String LAYER_ADDED = "added"; public static final String LAYER_REMOVED = "removed"; private static final Object[] PROP_TO_LISTEN = CtuluLibArray.sort( - new String[]{"foreground", "visible", "attenue", + new String[]{"foreground", "visible", "attenue", "userVisible", "rapide", "ajustement", "paletteCouleur", "iconeChanged", "title", "nodeEdit", "alpha", "model"}); private static String getActLast() { @@ -226,6 +226,8 @@ quickRefresh(); } else if ("VISIBLE".equals(action)) { calque.setVisible(!calque.isVisible()); + } else if ("USER_VISIBLE".equals(action)) { + calque.setUserVisible(!calque.isVisible()); } else if ("SELECTABLE".equals(action) && (calque instanceof ZCalqueAffichageDonneesAbstract)) { ((ZCalqueAffichageDonneesAbstract) calque).setSelectable(!((ZCalqueAffichageDonneesAbstract) calque).isSelectable()); // refreshSelect = true; @@ -401,8 +403,8 @@ public void fillMenu(final BuMenu _m) { _m.addMenuItem(EbliResource.EBLI.getString("Centrer la vue"), getActCenter(), EbliResource.EBLI.getToolIcon("zoom-layer"), true, 0, this); - _m.addMenuItem(EbliResource.EBLI.getString("Visible"), "VISIBLE_OUI", null, editable, 0, this); - _m.addMenuItem(EbliResource.EBLI.getString("Cach\xE9"), "VISIBLE_NON", BuResource.BU.getIcon("cacher"), editable, 0, this); + _m.addMenuItem(EbliResource.EBLI.getString("Visible"), "USER_VISIBLE_OUI", null, editable, 0, this); + _m.addMenuItem(EbliResource.EBLI.getString("Cach\xE9"), "USER_VISIBLE_NON", BuResource.BU.getIcon("cacher"), editable, 0, this); _m.addSeparator(); _m.addMenuItem(EbliResource.EBLI.getString("S\xE9lectionnable"), "SET_SELECTABLE", EbliResource.EBLI.getIcon("fleche"), true, 0, this); @@ -490,9 +492,9 @@ if (_c instanceof ZCalqueAffichageDonneesAbstract) { ZCalqueAffichageDonneesAbstract cq = (ZCalqueAffichageDonneesAbstract) _c; if (cq.canSetSelectable()) { - BuCheckBoxMenuItem mi = - _m.addCheckBox(EbliResource.EBLI.getString("S\xE9lectionnable"), "SELECTABLE", EbliResource.EBLI.getIcon( - "fleche"), true, cq.isSelectable()); + BuCheckBoxMenuItem mi + = _m.addCheckBox(EbliResource.EBLI.getString("S\xE9lectionnable"), "SELECTABLE", EbliResource.EBLI.getIcon( + "fleche"), true, cq.isSelectable()); mi.addActionListener(this); } } @@ -769,4 +771,4 @@ @Override public void valueForPathChanged(final TreePath _path, final Object _newValue) { } -} \ No newline at end of file +} Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BCalque.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BCalque.java 2014-02-13 16:34:05 UTC (rev 8616) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BCalque.java 2014-02-14 08:28:37 UTC (rev 8617) @@ -1016,6 +1016,17 @@ } } + public boolean isUserVisible() { + return isVisible(); + } + + public void setUserVisible(boolean userVisible) { + if (isUserVisible() != userVisible) { + setVisible(userVisible); + firePropertyChange(BSelecteurCheckBox.PROP_USER_VISIBLE, !userVisible, userVisible); + } + } + /** * Controle si tous les calques descendants sont visible. * @@ -1059,4 +1070,4 @@ } return r; } -} \ No newline at end of file +} Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java 2014-02-13 16:34:05 UTC (rev 8616) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java 2014-02-14 08:28:37 UTC (rev 8617) @@ -819,6 +819,10 @@ return antialiasing_; } + protected boolean clearSelectionIfLayerNonVisible() { + return true; + } + /** * Efface la selection si le calque est rendu invisible. */ @@ -826,7 +830,7 @@ public void setVisible(boolean _b) { if (isVisible() != _b) { super.setVisible(_b); - if (!_b) { + if (!_b && clearSelectionIfLayerNonVisible()) { clearSelection(); } } Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesConfigure.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesConfigure.java 2014-02-13 16:34:05 UTC (rev 8616) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesConfigure.java 2014-02-14 08:28:37 UTC (rev 8617) @@ -21,8 +21,9 @@ * @version $Id: ZCalqueAffichageDonneesConfigure.java,v 1.4 2007-05-04 13:49:43 deniger Exp $ */ public class ZCalqueAffichageDonneesConfigure extends BCalqueSectionConfigure { + boolean addVisible_; - boolean addColor_=true; + boolean addColor_ = true; public final static String ANTIALIAS = "calque.antialias"; @@ -48,6 +49,10 @@ ((ZCalqueAffichageDonneesAbstract) target_).setVisible(((Boolean) _newProp).booleanValue()); return true; } + if (_key == BSelecteurCheckBox.PROP_USER_VISIBLE) { + ((ZCalqueAffichageDonneesAbstract) target_).setUserVisible(((Boolean) _newProp).booleanValue()); + return true; + } if (_key == ANTIALIAS) { ((ZCalqueAffichageDonneesAbstract) target_).antialiasing_ = ((Boolean) _newProp).booleanValue(); ((ZCalqueAffichageDonneesAbstract) target_).repaint(); @@ -67,6 +72,9 @@ if (_key == BSelecteurCheckBox.PROP_VISIBLE) { return Boolean.valueOf(target_.isVisible()); } + if (_key == BSelecteurCheckBox.PROP_USER_VISIBLE) { + return Boolean.valueOf(target_.isUserVisible()); + } return super.getProperty(_key); } @@ -74,7 +82,7 @@ public BSelecteurInterface[] createSelecteurs() { final List dest = new ArrayList(); if (addVisible_) { - dest.add(new BSelecteurCheckBox(BSelecteurCheckBox.PROP_VISIBLE, new BuCheckBox())); + dest.add(new BSelecteurCheckBox(BSelecteurCheckBox.PROP_USER_VISIBLE, new BuCheckBox())); } if (((ZCalqueAffichageDonneesAbstract) target_).isAntialiasSupported()) { final BSelecteurCheckBox cbAntialias = new BSelecteurCheckBox(ANTIALIAS); @@ -82,7 +90,7 @@ cbAntialias.setTooltip(EbliLib.getS("Permet de lisser les trac\xE9s")); dest.add(cbAntialias); } - if(addColor_) { + if (addColor_) { dest.add(new BSelecteurColorChooserBt()); } dest.add(new BSelecteurAlpha()); Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueCatchInteraction.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueCatchInteraction.java 2014-02-13 16:34:05 UTC (rev 8616) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueCatchInteraction.java 2014-02-14 08:28:37 UTC (rev 8617) @@ -31,6 +31,8 @@ * La tol\xE9rance en pixels pour l'accrochage */ private static int tolerancePixel_ = 4; + + private int keyAccrocheActive = KeyEvent.VK_N; /** * La scene */ @@ -84,6 +86,10 @@ public void mouseEntered(final MouseEvent _evt) { } + public void setKeyAccrocheActive(int keyAccrocheActive) { + this.keyAccrocheActive = keyAccrocheActive; + } + /** * Methode inactive. */ @@ -135,7 +141,7 @@ ptTmp_.x_ = _evt.getX(); ptTmp_.y_ = _evt.getY(); //Fred ajout de isCachingEnableForOneLayer: si aucun calque ne se souci du catchevent pas besoin de le calculer. - if (isCachingEnableForOneLayer() && !isGele() && scene_ != null && bcatch_) { + if (!isGele() && isCachingEnableForOneLayer() && scene_ != null && bcatch_) { mouseMoved(ptTmp_); } } @@ -258,7 +264,9 @@ } /** - * Gere lees actions 'suivant' et 'decrochage'.<p> U : pour inactiver le mode d'accrochage, N : Pour switcher de point accroch\xE9. + * Gere lees actions 'suivant' et 'decrochage' + * .<p> + * U : pour inactiver le mode d'accrochage, N : Pour switcher de point accroch\xE9. */ @Override public void keyPressed(KeyEvent e) { @@ -266,7 +274,7 @@ bcatch_ = false; fireCatchEvent(ZCatchEvent.UNCAUGHT, 0, 0); } - if (e.getKeyCode() == KeyEvent.VK_N) { + if (e.getKeyCode() == keyAccrocheActive) { if (selAccroch_.getNbSelectedItem() > 1) { iidxVertex_++; if (iidxVertex_ == idxVertices_.length) { @@ -283,7 +291,8 @@ } /** - * Gere le SHIFT.<p> SHIFT : pour reactiver le mode d'accrochage + * Gere le SHIFT.<p> + * SHIFT : pour reactiver le mode d'accrochage */ @Override public void keyReleased(KeyEvent e) { Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZEbliCalquesPanel.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2014-02-13 16:34:05 UTC (rev 8616) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZEbliCalquesPanel.java 2014-02-14 08:28:37 UTC (rev 8617) @@ -543,7 +543,7 @@ } } if (selected.length() > 0) { - if (info.length() > 0) { + if (info != null && info.length() > 0) { info = "|" + selected + " " + info; } else { info = "|" + selected; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2015-04-20 13:40:29
|
Revision: 9115 http://sourceforge.net/p/fudaa/svn/9115 Author: bmarchan Date: 2015-04-20 13:40:26 +0000 (Mon, 20 Apr 2015) Log Message: ----------- Palettes rotation+deplacement retaillables Modified Paths: -------------- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/SceneDeplacementAction.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/SceneRotationAction.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/BPaletteDeplacement.java Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/SceneDeplacementAction.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/SceneDeplacementAction.java 2015-04-20 09:44:41 UTC (rev 9114) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/SceneDeplacementAction.java 2015-04-20 13:40:26 UTC (rev 9115) @@ -45,6 +45,7 @@ */ public SceneDeplacementAction(final TreeSelectionModel _m, final ZEditorDefault _editor, EbliFormatterInterface _formatter, ZCalqueDeplacementInteraction _cqDep) { super(EbliLib.getS("D\xE9placer des objets"), EbliResource.EBLI.getToolIcon("fleche-deplacement"), "GLOBAL_MOVE", _m); + setResizable(true); formatter_=_formatter; pnCalques_=_editor.getPanel(); // Pour capter l'activation d'un autre calque. Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/SceneRotationAction.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/SceneRotationAction.java 2015-04-20 09:44:41 UTC (rev 9114) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/SceneRotationAction.java 2015-04-20 13:40:26 UTC (rev 9115) @@ -33,6 +33,7 @@ */ public SceneRotationAction(final TreeSelectionModel _m, final ZEditorInterface _editor, ZSceneEditor _sceneEditor, EbliFormatterInterface _formatter) { super(EbliLib.getS("Rotation des objets"), EbliResource.EBLI.getToolIcon("draw-rotation"), "GLOBAL_ROTATE", _m); + setResizable(true); formatter_=_formatter; setSceneEditor(_sceneEditor); setEnabled(isTargetValid(super.target_)); Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/BPaletteDeplacement.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/BPaletteDeplacement.java 2015-04-20 09:44:41 UTC (rev 9114) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/BPaletteDeplacement.java 2015-04-20 13:40:26 UTC (rev 9115) @@ -60,7 +60,7 @@ sceneEditor_ = _sceneEditor; tfDx_ = BuTextField.createDoubleField(); - tfDx_.setPreferredSize(new Dimension(70, tfDx_.getPreferredSize().height)); + tfDx_.setPreferredSize(new Dimension(90, tfDx_.getPreferredSize().height)); tfDx_.setValue(new Double(0)); tfDy_ = BuTextField.createDoubleField(); tfDy_.setValue(new Double(0)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2015-05-11 21:32:57
|
Revision: 9123 http://sourceforge.net/p/fudaa/svn/9123 Author: deniger Date: 2015-05-11 21:32:55 +0000 (Mon, 11 May 2015) Log Message: ----------- dev Modified Paths: -------------- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BVueCalque.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGrille.java Added Paths: ----------- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/AxeZoomProcessor.java Copied: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/AxeZoomProcessor.java (from rev 9122, trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/zoom/AxeZoomProcessor.java) =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/AxeZoomProcessor.java (rev 0) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/AxeZoomProcessor.java 2015-05-11 21:32:55 UTC (rev 9123) @@ -0,0 +1,57 @@ +package org.fudaa.ebli.calque; + +import java.awt.Insets; + +import org.fudaa.ebli.calque.BVueCalque; +import org.fudaa.ebli.geometrie.GrBoite; +import org.fudaa.ebli.repere.RepereEvent; +/** + * Redimensionnement du calque. + * @author Adrien + * + */ +public class AxeZoomProcessor { + + + public RepereEvent process(final Object _source, final GrBoite _boite, final double _rz, final int mrgHorizontal, final int mrgVertical, + boolean _rapide, boolean _changeZ, BVueCalque vue, boolean zoomX) { + + + final Insets insets = vue.getInsets(); + final double wd = _boite.getDeltaX(); + final double hd = _boite.getDeltaY(); + int margeGauche = mrgHorizontal; + int margeDroite = mrgHorizontal; + int margeHaut = mrgVertical; + int margeBas = mrgVertical; + + if (vue.getCalqueInsets() != null) { + //-- voir si le graphe ca joue mieux --// + //vue.getCalqueInsets().left = 0; + + margeGauche = vue.getCalqueInsets().left; + margeDroite = vue.getCalqueInsets().right; + margeHaut = vue.getCalqueInsets().top; + margeBas = vue.getCalqueInsets().bottom; + } + + final double wv = vue.getWidth() - insets.left - insets.right - margeGauche - margeDroite; + final double hv = vue.getHeight() - insets.top - insets.bottom - margeHaut - margeBas; + final RepereEvent repere = new RepereEvent(_source, _rapide); + // final double e = Math.max(wd / wv, hd / hv); + double e = zoomX?(wd / wv):hd / hv; + repere.ajouteTransformation(RepereEvent.ZOOM, e, false); + vue.margeXCentre = (wv - wd / e) / 2; + repere.ajouteTransformation(RepereEvent.TRANS_X, _boite.o_.x_ / e - vue.margeXCentre - margeGauche, false); + vue.margeYCentre = (hv - hd / e) / 2; + repere.ajouteTransformation(RepereEvent.TRANS_Y, _boite.o_.y_ / e - vue.margeYCentre - margeBas, false); + repere.ajouteTransformation(RepereEvent.TRANS_Z, 0., false); + repere.ajouteTransformation(RepereEvent.ROT_X, 0., false); + repere.ajouteTransformation(RepereEvent.ROT_Y, 0., false); + if (_changeZ) { + repere.ajouteTransformation(RepereEvent.ROT_Z, _rz, false); + } + return repere; + } + +} Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BVueCalque.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BVueCalque.java 2015-04-23 12:50:42 UTC (rev 9122) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/BVueCalque.java 2015-05-11 21:32:55 UTC (rev 9123) @@ -69,8 +69,8 @@ boolean noRepaintTask_; final RepereMouseKeyController repereController_; GrVecteur vect_ = new GrVecteur(); - private double margeXCentre; - private double margeYCentre; + public double margeXCentre; + public double margeYCentre; public BVueCalque(final BCalque _c) { repere_ = new double[4][3]; @@ -291,6 +291,21 @@ changeRepere(_source, _boite, _rz, _mrg, _mrg, _rapide, changeZ); } + public void changeRepereZoom(final Object _source, final GrBoite _boite, final double _rz, final int mrgHorizontal, final int mrgVertical, + final boolean _rapide, final boolean _changeZ, boolean zoomX) { + if (_boite == null) { + return; + } + if (!checkBoite(_boite, true, true)) { + return; + } + AxeZoomProcessor redi = new AxeZoomProcessor(); + RepereEvent repere = redi.process(_source, _boite, _rz, mrgHorizontal, mrgVertical, _rapide, _changeZ, this, zoomX); + + repereModifie(repere); + + } + public void changeRepere(final Object _source, final GrBoite _boite, final double _rz, final int mrgHorizontal, final int mrgVertical, final boolean _rapide, final boolean _changeZ) { if (_boite == null) { @@ -309,6 +324,7 @@ int margeBas = mrgVertical; if (insets_ != null) { + margeGauche = insets_.left; margeDroite = insets_.right; margeHaut = insets_.top; @@ -842,4 +858,8 @@ public Cursor getDefaultCursor() { return new Cursor(Cursor.CROSSHAIR_CURSOR); } + + public Insets getCalqueInsets() { + return insets_; + } } Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGrille.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGrille.java 2015-04-23 12:50:42 UTC (rev 9122) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGrille.java 2015-05-11 21:32:55 UTC (rev 9123) @@ -1,14 +1,14 @@ /* * @file BCalqueGrille.java - * + * * @creation 1998-09-03 - * + * * @modification $Date: 2008-02-20 10:14:40 $ - * + * * @license GNU General Public License 2 - * + * * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne - * + * * @mail de...@fu... */ package org.fudaa.ebli.calque; @@ -36,12 +36,13 @@ /** * Un calque d'affichage d'une grille. - * + * * @version $Revision: 1.11.6.1 $ $Date: 2008-02-20 10:14:40 $ by $Author: bmarchan $ * @author Guillaume Desnoix */ @SuppressWarnings("serial") public class ZCalqueGrille extends ZCalqueAffichageDonnees { + /** * caratere visible de l'axe x */ @@ -153,7 +154,7 @@ } private void computeXValues(final GrBoite _zv, final Graphics2D _g, final TDoubleArrayList _xValue, - final TIntArrayList _xStrWidth, final List _xString) { + final TIntArrayList _xStrWidth, final List _xString) { final Font font = getFont(); if (font != null) { @@ -161,7 +162,9 @@ } final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); TickIterator it = createXTickIterator(_zv); - if (it == null) { return; } + if (it == null) { + return; + } // _it= while (it.hasNext()) { final double x = it.currentValue(); @@ -180,7 +183,7 @@ } private double computeYValues(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _yValue, - final TIntArrayList _yStrWidth, final List _yString) { + final TIntArrayList _yStrWidth, final List _yString) { final Font font = getFont(); if (font != null) { _g.setFont(font); @@ -189,7 +192,9 @@ double yMax = 0; TickIterator it = createYIterator(_zv); - if (it == null) { return 0; } + if (it == null) { + return 0; + } while (it.hasNext()) { @@ -244,7 +249,7 @@ } private void drawXAxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, - final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, final double _maxXForAxe) { + final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, final double _maxXForAxe) { int minXDraw = _absyAxe; int maxXDraw = (int) _maxXForAxe; @@ -254,8 +259,8 @@ } private void drawYaxe(final Graphics2D _g, final GrBoite _zv, final TDoubleArrayList _xValue, - final TDoubleArrayList _yValue, final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, - final double _minYForAxe) { + final TDoubleArrayList _yValue, final GrMorphisme _versEcran, final int _absyAxe, final int _ordxAxe, + final double _minYForAxe) { int minYDraw = _ordxAxe; int maxYDraw = (int) _minYForAxe; @@ -300,7 +305,7 @@ } void fillXZone(final Graphics2D _g, final GrBoite _targetBoite, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite) { + final GrBoite _ecranBoite) { if (_ecranBoite.getMaxY() > _ordxAxe) { _g.setColor(vue_.getBackground()); _g.fillRect(_absyAxe, _ordxAxe, (int) _targetBoite.getMaxX() - _absyAxe, (int) _targetBoite.getMaxY() - _ordxAxe); @@ -308,8 +313,8 @@ } protected void drawYGraduations(final Graphics2D _g, final TDoubleArrayList _yValue, final TIntArrayList _yStrWidth, - final List _yString, final GrMorphisme _versEcran, final int _marge, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite, final double _maxXForAxe) { + final List _yString, final GrMorphisme _versEcran, final int _marge, final int _absyAxe, final int _ordxAxe, + final GrBoite _ecranBoite, final double _maxXForAxe) { final int nb = _yString.size(); final int tiret = getTiretLength(); final Font font = getFont(); @@ -324,7 +329,7 @@ tmp_.y_ = _yValue.getQuick(i); tmp_.z_ = 0; tmp_.autoApplique(_versEcran); - + if (tmp_.y_ > _ordxAxe) { continue; } @@ -357,8 +362,8 @@ } private void drawXGraduations(final Graphics2D _g, final GrBoite _targetBoite, final TDoubleArrayList _xValue, - final TIntArrayList _xStrWidth, final List _xString, final int _absyAxe, final int _ordxAxe, - final GrBoite _ecranBoite, final double _minYForAxe, final int _ordXString) { + final TIntArrayList _xStrWidth, final List _xString, final int _absyAxe, final int _ordxAxe, + final GrBoite _ecranBoite, final double _minYForAxe, final int _ordXString) { int idxStr = -1; final GrMorphisme versEcran = getVersEcran(); @@ -372,7 +377,7 @@ tmp_.y_ = 0; tmp_.z_ = 0; tmp_.autoApplique(versEcran); - + if (tmp_.x_ < _absyAxe) { continue; } @@ -396,7 +401,7 @@ } if (w > 0) { final int start = (int) (tmp_.x_ - w / 2D); - if ( start > idxStr + 1 && start + w < _targetBoite.getMaxX()) { + if (start > idxStr + 1 && start + w < _targetBoite.getMaxX()) { _g.setColor(fg); _g.drawString((String) _xString.get(i), start, _ordXString); idxStr = start + w; @@ -434,8 +439,8 @@ } /** - * - */ + * + */ @Override public TraceLigneModel getLineModel(int _idx) { return _idx == 0 ? super.ligneModel_ : traceSousGraduations_; @@ -456,21 +461,51 @@ @Override public Object getProperty(String _name) { - if (GRID_VISIBLE.equals(_name)) { return Boolean.valueOf(gridDraw_); } - if (AXIS_X_VISIBLE.equals(_name)) { return Boolean.valueOf(xDraw_); } - if (AXIS_Y_VISIBLE.equals(_name)) { return Boolean.valueOf(yDraw_); } - if (GRADUATION_X_MODE_AUTO.equals(_name)) { return Boolean.valueOf(xModeAuto_); } - if (GRADUATION_Y_MODE_AUTO.equals(_name)) { return Boolean.valueOf(yModeAuto_); } - if (MINOR_GRADUATION_Y_VISIBLE.equals(_name)) { return Boolean.valueOf(yMinorDraw_); } - if (MINOR_GRADUATION_X_VISIBLE.equals(_name)) { return Boolean.valueOf(xMinorDraw_); } - if (GRADUATION_X_MODE_LENGTH.equals(_name)) { return Boolean.valueOf(xModeLongueur_); } - if (GRADUATION_Y_MODE_LENGTH.equals(_name)) { return Boolean.valueOf(yModeLongueur_); } - if (GRADUATION_X_LENGTH.equals(_name)) { return Double.valueOf(xLength_); } - if (GRADUATION_Y_LENGTH.equals(_name)) { return Double.valueOf(yLength_); } - if (GRADUATION_X_NB.equals(_name)) { return Integer.valueOf(xNbGraduation_); } - if (GRADUATION_Y_NB.equals(_name)) { return Integer.valueOf(yNbGraduation_); } - if (MINOR_GRADUATION_X_NB.equals(_name)) { return Integer.valueOf(xMinorGraduationNb_); } - if (MINOR_GRADUATION_Y_NB.equals(_name)) { return Integer.valueOf(yMinorGraduationNb_); } + if (GRID_VISIBLE.equals(_name)) { + return Boolean.valueOf(gridDraw_); + } + if (AXIS_X_VISIBLE.equals(_name)) { + return Boolean.valueOf(xDraw_); + } + if (AXIS_Y_VISIBLE.equals(_name)) { + return Boolean.valueOf(yDraw_); + } + if (GRADUATION_X_MODE_AUTO.equals(_name)) { + return Boolean.valueOf(xModeAuto_); + } + if (GRADUATION_Y_MODE_AUTO.equals(_name)) { + return Boolean.valueOf(yModeAuto_); + } + if (MINOR_GRADUATION_Y_VISIBLE.equals(_name)) { + return Boolean.valueOf(yMinorDraw_); + } + if (MINOR_GRADUATION_X_VISIBLE.equals(_name)) { + return Boolean.valueOf(xMinorDraw_); + } + if (GRADUATION_X_MODE_LENGTH.equals(_name)) { + return Boolean.valueOf(xModeLongueur_); + } + if (GRADUATION_Y_MODE_LENGTH.equals(_name)) { + return Boolean.valueOf(yModeLongueur_); + } + if (GRADUATION_X_LENGTH.equals(_name)) { + return Double.valueOf(xLength_); + } + if (GRADUATION_Y_LENGTH.equals(_name)) { + return Double.valueOf(yLength_); + } + if (GRADUATION_X_NB.equals(_name)) { + return Integer.valueOf(xNbGraduation_); + } + if (GRADUATION_Y_NB.equals(_name)) { + return Integer.valueOf(yNbGraduation_); + } + if (MINOR_GRADUATION_X_NB.equals(_name)) { + return Integer.valueOf(xMinorGraduationNb_); + } + if (MINOR_GRADUATION_Y_NB.equals(_name)) { + return Integer.valueOf(yMinorGraduationNb_); + } return null; } @@ -480,8 +515,8 @@ } /** - * - */ + * + */ @Override public String getSetTitle(int _idx) { return EbliLib.getS(_idx == 0 ? "Graduations principales" : "Graduations mineures"); @@ -573,9 +608,9 @@ public boolean isDrawY() { return yDraw_; } - - public boolean isAxisPainted(){ - return isDrawX()|| isDrawY(); + + public boolean isAxisPainted() { + return isDrawX() || isDrawY(); } public boolean isModeAutomatiqueX() { @@ -606,22 +641,26 @@ @Override public void paintAllInImage(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, - final GrBoite _clipReel) { - // super.paintAllInImage(_g, _versEcran, _versReel, _clipReel); + final GrBoite _clipReel) { + // super.paintAllInImage(_g, _versEcran, _versReel, _clipReel); } @Override public void paintDonnees(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, - final GrBoite _clipReel) { + final GrBoite _clipReel) { GrBoite domaine = vue_.getAbstractCalque().getDomaine(); final GrBoite zv = _clipReel.intersectionXY(domaine); - if (zv == null) { return; } + if (zv == null) { + return; + } final GrBoite targetBoite = new GrBoite(); targetBoite.ajuste(0, 0, 0); // la boite d'affichage - if (!_versEcran.isSame(getVersEcran())) { return; } + if (!_versEcran.isSame(getVersEcran())) { + return; + } targetBoite.ajuste(getWidth(), getHeight(), 0); final Color old = _g.getColor(); final Font oldFont = _g.getFont(); @@ -652,6 +691,121 @@ // boolean rapide = isRapide(); final GrMorphisme versEcran = _versEcran; final int tiret = getTiretLength(); + //-- ahx: item 1.1.3 enlever espace inutile car le nouveau besoin est d'avoir un rep\xE8re qui tombe juste. + final int marge = 0;//1; + int absyAxe = (int) (targetBoite.getMinX() + yMax + 2 * marge + tiret); + final int margeBas = (font == null ? 0 : font.getSize()) + 2 * marge + tiret; + + int margeToRemoveXAxe = (font == null ? 0 : font.getSize()) + 2 + tiret; + int ordxAxe = (int) (targetBoite.getMaxY() - margeToRemoveXAxe); + // la marge droite doit etre calculee pour afficher la derniere graduation. + //int margeDroit = getLastNonZero(xStrWidth) / 2 + 3; + int top = 1;//Math.max(3, font == null ? 3 : font.getSize()); + //-- ahx: item 1.1.3 enlever espace inutile car le nouveau besoin est d'avoir un rep\xE8re qui tombe juste. + int left = absyAxe;//+ 5; + int bottom = margeBas;// + 5; + int right = 1;//Math.max(margeDroit, 3); + //the insets must be determined in order to keep the ratio w/h: + //int heightInsets = top + bottom; + //int widthInsets = right + left; + //CtuluRatio ratio = new CtuluRatio(vue_.getSize()); + /* + if (ratio.toY(widthInsets) > heightInsets) { + top = (int) (ratio.toY(widthInsets) - bottom); + } else if (ratio.toX(heightInsets) > widthInsets) { + right = (int) (ratio.toX(heightInsets) - left); + } + */ + vue_.setUserInsets(new Insets(top, left, bottom, right)); + // we get again the domain after the userInsets modification + domaine = vue_.getAbstractCalque().getDomaine(); + final GrBoite ecranBoite = domaine.applique(_versEcran); + //-- ahx: item 1.1.3 enlever espace inutile car le nouveau besoin est d'avoir un rep\xE8re qui tombe juste. + /* + if (ecranBoite.getMinX() - 5 > absyAxe) { + absyAxe = (int) (ecranBoite.getMinX() - 5); + } + if (ecranBoite.getMaxY() + 5 < ordxAxe) { + ordxAxe = (int) (ecranBoite.getMaxY() + 5); + } + */ + if (isXPainted) { + fillXZone(_g, targetBoite, absyAxe, ordxAxe, ecranBoite); + + } + + // l'axe des x + final double maxXForAxe = ecranBoite.getMaxX() - marge; + + // l'axe des y + final double minYForAxe = ecranBoite.getMinY() + marge; + // les graduation en x + + final int ascent = fm == null ? 0 : fm.getAscent(); + final int ordXString = ordxAxe + tiret + ascent; + + //first y: + if (isYPainted) { + fillYZone(_g, targetBoite, absyAxe, ecranBoite); + drawYaxe(_g, zv, xValue, yValue, versEcran, absyAxe, ordxAxe, minYForAxe); + drawYGraduations(_g, yValue, yStrWidth, yString, versEcran, marge, absyAxe, ordxAxe, ecranBoite, maxXForAxe); + } + + //then x + if (isXPainted) { + drawXAxe(_g, zv, xValue, versEcran, absyAxe, ordxAxe, maxXForAxe); + drawXGraduations(_g, targetBoite, xValue, xStrWidth, xString, absyAxe, ordxAxe, ecranBoite, minYForAxe, + ordXString); + } + _g.setColor(old); + _g.setFont(oldFont); + } + + public void paintDonneesOLD(final Graphics2D _g, final GrMorphisme _versEcran, final GrMorphisme _versReel, + final GrBoite _clipReel) { + GrBoite domaine = vue_.getAbstractCalque().getDomaine(); + final GrBoite zv = _clipReel.intersectionXY(domaine); + + if (zv == null) { + return; + } + final GrBoite targetBoite = new GrBoite(); + targetBoite.ajuste(0, 0, 0); + // la boite d'affichage + + if (!_versEcran.isSame(getVersEcran())) { + return; + } + targetBoite.ajuste(getWidth(), getHeight(), 0); + final Color old = _g.getColor(); + final Font oldFont = _g.getFont(); + // la fonte + final Font font = getFont(); + if (font != null) { + _g.setFont(font); + } + final FontMetrics fm = font == null ? null : _g.getFontMetrics(font); + final TDoubleArrayList xValue = new TDoubleArrayList(20); + final TIntArrayList xStrWidth = new TIntArrayList(20); + final List xString = new ArrayList(20); + + final boolean isXPainted = xDraw_ && zv.getMinX() < zv.getMaxX() && xNbGraduation_ > 0; + + if (isXPainted) { + computeXValues(zv, _g, xValue, xStrWidth, xString); + } + double yMax = 0; + final TDoubleArrayList yValue = new TDoubleArrayList(20); + final TIntArrayList yStrWidth = new TIntArrayList(20); + final List yString = new ArrayList(20); + final boolean isYPainted = yDraw_ && zv.getMinY() < zv.getMaxY() && yNbGraduation_ > 0; + if (isYPainted) { + yMax = computeYValues(_g, zv, yValue, yStrWidth, yString); + } + + // boolean rapide = isRapide(); + final GrMorphisme versEcran = _versEcran; + final int tiret = getTiretLength(); final int marge = 1; int absyAxe = (int) (targetBoite.getMinX() + yMax + 2 * marge + tiret); final int margeBas = (font == null ? 0 : font.getSize()) + 2 * marge + tiret; @@ -696,29 +850,32 @@ final int ascent = fm == null ? 0 : fm.getAscent(); final int ordXString = ordxAxe + tiret + ascent; - //first y: - + //first y: if (isYPainted) { fillYZone(_g, targetBoite, absyAxe, ecranBoite); drawYaxe(_g, zv, xValue, yValue, versEcran, absyAxe, ordxAxe, minYForAxe); drawYGraduations(_g, yValue, yStrWidth, yString, versEcran, marge, absyAxe, ordxAxe, ecranBoite, maxXForAxe); } - + //then x if (isXPainted) { drawXAxe(_g, zv, xValue, versEcran, absyAxe, ordxAxe, maxXForAxe); drawXGraduations(_g, targetBoite, xValue, xStrWidth, xString, absyAxe, ordxAxe, ecranBoite, minYForAxe, - ordXString); + ordXString); } _g.setColor(old); _g.setFont(oldFont); } int getLastNonZero(TIntArrayList l) { - if (l == null || l.isEmpty()) { return 0; } + if (l == null || l.isEmpty()) { + return 0; + } for (int i = l.size() - 1; i >= 0; i--) { int value = l.getQuick(i); - if (value > 0) { return value; } + if (value > 0) { + return value; + } } return 0; } @@ -726,9 +883,8 @@ // Icon /** * Dessin de l'icone. - * - * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null</I>. Il - * est ignore ici. + * + * @param _c composant dont l'icone peut deriver des proprietes (couleur, ...). Ce parametre peut etre <I>null</I>. Il est ignore ici. * @param _g le graphics sur lequel dessiner l'icone * @param _x lieu cible de l'icone (x) * @param _y lieu cible de l'icone (y) @@ -753,7 +909,8 @@ @Override public void doPaintSelection(final Graphics2D _g, final ZSelectionTrace _trace, final GrMorphisme _versEcran, - final GrBoite _clipReel) {} + final GrBoite _clipReel) { + } @Override public EbliUIProperties saveUIProperties() { @@ -871,11 +1028,13 @@ } /** - * - */ + * + */ @Override public boolean setProperty(String _name, Object _value) { - if (_value == null) { return false; } + if (_value == null) { + return false; + } if (GRID_VISIBLE.equals(_name)) { setDrawGrid((Boolean) _value); return true; @@ -967,7 +1126,9 @@ public void setXLength(final double _lenghtSteps) { if (xLength_ != _lenghtSteps) { double l = Math.abs(_lenghtSteps); - if (CtuluLib.isZero(l)) { return; } + if (CtuluLib.isZero(l)) { + return; + } double old = xLength_; xLength_ = _lenghtSteps; grilleChanged(GRADUATION_X_LENGTH, old, xLength_); @@ -993,7 +1154,9 @@ public void setYLength(final double _lenghtSteps) { if (yLength_ != _lenghtSteps) { double l = Math.abs(_lenghtSteps); - if (CtuluLib.isZero(l)) { return; } + if (CtuluLib.isZero(l)) { + return; + } double old = yLength_; yLength_ = _lenghtSteps; grilleChanged(GRADUATION_Y_LENGTH, old, yLength_); @@ -1019,4 +1182,8 @@ } } + public BVueCalque getVue_() { + return vue_; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2017-05-04 12:21:07
|
Revision: 9549 http://sourceforge.net/p/fudaa/svn/9549 Author: bmarchan Date: 2017-05-04 12:21:04 +0000 (Thu, 04 May 2017) Log Message: ----------- Amelioration affichage legende ZCalqueFleche Modified Paths: -------------- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFleche.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueSegment.java Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java 2017-04-26 08:33:05 UTC (rev 9548) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java 2017-05-04 12:21:04 UTC (rev 9549) @@ -115,7 +115,9 @@ * Les objets du calques sont-ils selectionnables */ protected boolean isSelectable_ = true; + /** La palette de couleurs. Peut \xEAtre null */ protected BPalettePlageAbstract paletteCouleur_; + /** Le panneau de l\xE9gende associ\xE9 au calque. Peut \xEAtre null */ protected BPalettePlageLegende paletteLegende_; public ZCalqueAffichageDonneesAbstract() { Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFleche.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFleche.java 2017-04-26 08:33:05 UTC (rev 9548) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFleche.java 2017-05-04 12:21:04 UTC (rev 9549) @@ -205,7 +205,7 @@ } } - private ZCalqueFlecheLegend flecheLegend_; + protected ZCalqueFlecheLegend flecheLegend_; final FlecheScaleData scale_ = new FlecheScaleData(this); final FlecheGrilleData grille_ = new FlecheGrilleData(this); @@ -271,12 +271,18 @@ @Override protected void construitLegende() { + final BCalqueLegende l = getLegende(); + if (l == null) { + return; + } + if (paletteLegende_ == null) { - paletteCouleur_ = new BPalettePlage(new BPlageInterface[0]); - paletteCouleur_.setTitre(getTitle()); - paletteLegende_ = new BPalettePlageLegende(paletteCouleur_); + paletteLegende_ = new BPalettePlageLegende(); paletteLegende_.addUserComponent(flecheLegend_.getFlecheComponent()); } + + paletteLegende_.setModel(paletteCouleur_); + super.construitLegende(); updateLegendeTitre(); } Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueSegment.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueSegment.java 2017-04-26 08:33:05 UTC (rev 9548) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueSegment.java 2017-05-04 12:21:04 UTC (rev 9549) @@ -239,11 +239,23 @@ } protected final Color getPaletteColorFor(final GrSegment _s) { - return ((BPalettePlage) paletteCouleur_).getColorFor(_s.longueurXY()); + // BM : Evite les traceback si la palette n'est pas une palette plage. + if (paletteCouleur_ instanceof BPalettePlage) { + return ((BPalettePlage) paletteCouleur_).getColorFor(_s.longueurXY()); + } + else { + return ligneModel_.getCouleur(); + } } public final Color getPaletteColorFor(final double _l) { - return ((BPalettePlage) paletteCouleur_).getColorFor(_l); + // BM : Evite les traceback si la palette n'est pas une palette plage. + if (paletteCouleur_ instanceof BPalettePlage) { + return ((BPalettePlage) paletteCouleur_).getColorFor(_l); + } + else { + return ligneModel_.getCouleur(); + } } public final boolean isPaletteUsed() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2017-06-01 15:48:34
|
Revision: 9622 http://sourceforge.net/p/fudaa/svn/9622 Author: bmarchan Date: 2017-06-01 15:48:31 +0000 (Thu, 01 Jun 2017) Log Message: ----------- Fix : Quand on trace la legende fleche suivant une norme fixe, on modifie le PixelParUnit pour que la fleche representative ne sorte pas de la legende. Modified Paths: -------------- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/FlecheScaleData.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFlecheLegend.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFlecheScaleSection.java Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/FlecheScaleData.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/FlecheScaleData.java 2017-05-30 15:49:16 UTC (rev 9621) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/FlecheScaleData.java 2017-06-01 15:48:31 UTC (rev 9622) @@ -120,7 +120,10 @@ public double getDefaultFacteur(final Graphics _g) { final GrBoite b = support_.getClipReel(_g); - final int nombre = support_.modele_.getNombre(); + int nombre = 0; + if (support_.modele_!=null) + nombre=support_.modele_.getNombre(); + double maxNormAuCarre = 0; for (int i = 0; i < nombre; i++) { // recuperation du polygone Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFlecheLegend.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFlecheLegend.java 2017-05-30 15:49:16 UTC (rev 9621) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFlecheLegend.java 2017-06-01 15:48:31 UTC (rev 9622) @@ -208,6 +208,15 @@ } else { val = fixRealNorm; } + + // B.M. 01/06/2017 : On fait en sorte que la norme ne sorte pas du cadre de la l\xE9gende. + double pixParUnit = 20; + final Insets set=lbfleche_.getInsets(); + if (set!=null) { + max=max-(set.left+set.right); + pixParUnit = max/fixRealNorm; + } + support_.getScaleData().setPixelPerUnit(pixParUnit); } // La fleche legende est trac\xE9e pour tenir dans les dimensions du composant Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFlecheScaleSection.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFlecheScaleSection.java 2017-05-30 15:49:16 UTC (rev 9621) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueFlecheScaleSection.java 2017-06-01 15:48:31 UTC (rev 9622) @@ -11,14 +11,10 @@ */ package org.fudaa.ebli.calque; -import com.memoire.bu.BuRadioButton; -import com.memoire.bu.BuResource; -import com.memoire.bu.BuTextField; -import com.memoire.bu.BuToolButton; -import com.memoire.bu.BuValueValidator; import java.awt.Font; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; + import javax.swing.AbstractButton; import javax.swing.ButtonGroup; import javax.swing.JSpinner; @@ -25,6 +21,7 @@ import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; + import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibString; import org.fudaa.ebli.commun.EbliLib; @@ -35,6 +32,13 @@ import org.fudaa.ebli.controle.BSelecteurSpinner; import org.fudaa.ebli.controle.BSelecteurTextField; +import com.memoire.bu.BuCheckBox; +import com.memoire.bu.BuRadioButton; +import com.memoire.bu.BuResource; +import com.memoire.bu.BuTextField; +import com.memoire.bu.BuToolButton; +import com.memoire.bu.BuValueValidator; + /** * @author fred deniger * @version $Id: ZCalqueFlecheScaleSection.java,v 1.4 2007-06-28 09:26:47 deniger Exp $ @@ -60,7 +64,7 @@ public BSelecteurInterface createLegendSelecteur(boolean addListenerToTarget) { final BSelecteurCheckBox selectUseFixNorm = new BSelecteurCheckBox( - FlecheScaleData.PROP_LEGEND_USE_CONSTANT_NORM_VALUE, new BuRadioButton(addListenerToTarget?CtuluLibString.EMPTY_STRING:EbliLib.getS("Utiliser une taille fixe"))); + FlecheScaleData.PROP_LEGEND_USE_CONSTANT_NORM_VALUE, new BuCheckBox(addListenerToTarget?CtuluLibString.EMPTY_STRING:EbliLib.getS("Utiliser une taille fixe"))); selectUseFixNorm.setTooltip(EbliLib.getS("S\xE9lectionner pour utiliser une norme fixe pour la l\xE9gende")); final BSelecteurTextField selectNorm = new BSelecteurTextField(FlecheScaleData.PROP_LEGEND_CONSTANT_NORM_VALUE, BuTextField.createDoubleField()); @@ -191,7 +195,7 @@ BuRadioButton bt=new BuRadioButton(CtuluLibString.EMPTY_STRING); final BSelecteurInterface createRelativeSelecteur = createRelativeSelecteur(createLegendSelecteur,bt); return new BSelecteurInterface[] { /** font, **/ - createRelativeSelecteur, createFixedSelecteur(bt), tfMinNorm, createLegendSelecteur }; + createRelativeSelecteur, createFixedSelecteur(bt), createLegendSelecteur, tfMinNorm }; } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2017-06-01 15:50:27
|
Revision: 9623 http://sourceforge.net/p/fudaa/svn/9623 Author: bmarchan Date: 2017-06-01 15:50:25 +0000 (Thu, 01 Jun 2017) Log Message: ----------- Ajout de la configuration des labels pour le calque ZCalqueEditable Modified Paths: -------------- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometry.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometryLabelConfigure.java trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometry.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometry.java 2017-06-01 15:48:31 UTC (rev 9622) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometry.java 2017-06-01 15:50:25 UTC (rev 9623) @@ -165,7 +165,7 @@ protected void drawLabelOnAtomic(final FontMetrics fm, String s, final GrPoint ptDest, final Color bgColor, final Graphics2D _g, final Color fgColor) { int stringWidth = fm.stringWidth(s); int x = (int) (ptDest.x_ - stringWidth / 2); - int y = (int) (ptDest.y_ - 5); + int y = (int) (ptDest.y_ - 10); if (bgColor != null) { _g.setColor(bgColor); _g.fillRect(x, y - fm.getAscent(), stringWidth, fm.getHeight() + 2); @@ -677,7 +677,7 @@ @Override protected BConfigurableInterface getAffichageConf() { - final BConfigurableInterface[] sect = new BConfigurableInterface[3 + getNbSet()]; + final BConfigurableInterface[] sect = new BConfigurableInterface[2 + getNbSet()]; sect[0] = new ZCalqueAffichageDonneesConfigure(this); sect[1] = new ZCalqueGeometryLabelConfigure(this); for (int i = 2; i < sect.length; i++) { Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometryLabelConfigure.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometryLabelConfigure.java 2017-06-01 15:48:31 UTC (rev 9622) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometryLabelConfigure.java 2017-06-01 15:50:25 UTC (rev 9623) @@ -11,6 +11,8 @@ import java.awt.Font; import java.util.ArrayList; import java.util.List; + +import org.fudaa.ebli.calque.edition.ZCalquePointEditable; import org.fudaa.ebli.commun.EbliLib; import org.fudaa.ebli.controle.BSelecteurColorChooserBt; import org.fudaa.ebli.controle.BSelecteurFont; @@ -26,11 +28,11 @@ public static final String PROPERTY_LABELS_FOREGROUND = "labelsForegroundColor"; public static final String PROPERTY_LABELS_BACKGROUND = "labelsBackgroundColor"; - public ZCalqueGeometryLabelConfigure(final ZCalqueGeometry _target, final boolean _addVisible) { + public ZCalqueGeometryLabelConfigure(final ZCalqueAffichageDonneesAbstract _target, final boolean _addVisible) { super(_target, EbliLib.getS("Labels")); } - public ZCalqueGeometryLabelConfigure(final ZCalqueGeometry _target) { + public ZCalqueGeometryLabelConfigure(final ZCalqueAffichageDonneesAbstract _target) { this(_target, false); } @@ -41,11 +43,23 @@ return true; } if (PROPERTY_LABELS_FOREGROUND.equals(_key)) { - ((ZCalqueGeometry) target_).setLabelsForegroundColor(((Color) _newProp)); + if (target_ instanceof ZCalqueGeometry) { + ((ZCalqueGeometry) target_).setLabelsForegroundColor(((Color) _newProp)); + } + // Etendu aux ZCalquePointEditable, qui devraient d\xE9river de ZCalqueGeometry + else if (target_ instanceof ZCalquePointEditable) { + ((ZCalquePointEditable) target_).setLabelsForegroundColor(((Color) _newProp)); + } return true; } if (PROPERTY_LABELS_BACKGROUND.equals(_key)) { - ((ZCalqueGeometry) target_).setLabelsBackgroundColor(((Color) _newProp)); + if (target_ instanceof ZCalqueGeometry) { + ((ZCalqueGeometry) target_).setLabelsBackgroundColor(((Color) _newProp)); + } + // Etendu aux ZCalquePointEditable, qui devraient d\xE9river de ZCalqueGeometry + else if (target_ instanceof ZCalquePointEditable) { + ((ZCalquePointEditable) target_).setLabelsBackgroundColor(((Color) _newProp)); + } return true; } return false; @@ -57,10 +71,22 @@ return ((ZCalqueAffichageDonneesAbstract) target_).getFont(); } if (PROPERTY_LABELS_FOREGROUND.equals(_key)) { - return ((ZCalqueGeometry) target_).getLabelsForegroundColor(); + if (target_ instanceof ZCalqueGeometry) { + return ((ZCalqueGeometry) target_).getLabelsForegroundColor(); + } + // Etendu aux ZCalquePointEditable, qui devraient d\xE9river de ZCalqueGeometry + else if (target_ instanceof ZCalquePointEditable) { + return ((ZCalquePointEditable) target_).getLabelsForegroundColor(); + } } if (PROPERTY_LABELS_BACKGROUND.equals(_key)) { - return ((ZCalqueGeometry) target_).getLabelsBackgroundColor(); + if (target_ instanceof ZCalqueGeometry) { + return ((ZCalqueGeometry) target_).getLabelsBackgroundColor(); + } + // Etendu aux ZCalquePointEditable, qui devraient d\xE9river de ZCalqueGeometry + else if (target_ instanceof ZCalquePointEditable) { + return ((ZCalquePointEditable) target_).getLabelsBackgroundColor(); + } } return null; } Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java =================================================================== --- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java 2017-06-01 15:48:31 UTC (rev 9622) +++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java 2017-06-01 15:50:25 UTC (rev 9623) @@ -7,13 +7,11 @@ */ package org.fudaa.ebli.calque.edition; -import com.memoire.fu.FuLog; -import com.vividsolutions.jts.geom.Geometry; -import gnu.trove.TObjectIntHashMap; import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics2D; + import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; import org.fudaa.ctulu.CtuluCommandComposite; @@ -25,6 +23,8 @@ import org.fudaa.ctulu.CtuluUI; import org.fudaa.ctulu.gis.GISAttributeInterface; import org.fudaa.ctulu.gis.GISZoneCollection; +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesConfigure; +import org.fudaa.ebli.calque.ZCalqueAffichageDonneesTraceConfigure; import org.fudaa.ebli.calque.ZCalqueGeometry.SelectionMode; import org.fudaa.ebli.calque.ZCalqueGeometryLabelConfigure; import org.fudaa.ebli.calque.ZCalquePoint; @@ -34,6 +34,9 @@ import org.fudaa.ebli.calque.find.CalqueFindActionAtomic; import org.fudaa.ebli.calque.find.CalqueFindPointExpression; import org.fudaa.ebli.commun.EbliLib; +import org.fudaa.ebli.commun.EbliUIProperties; +import org.fudaa.ebli.controle.BConfigurableComposite; +import org.fudaa.ebli.controle.BConfigurableInterface; import org.fudaa.ebli.find.EbliFindExpressionContainerInterface; import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.geometrie.GrMorphisme; @@ -41,8 +44,14 @@ import org.fudaa.ebli.geometrie.GrPoint; import org.fudaa.ebli.geometrie.GrSegment; import org.fudaa.ebli.trace.TraceIcon; +import org.fudaa.ebli.trace.TraceLigneModel; import org.nfunk.jep.Variable; +import com.memoire.fu.FuLog; +import com.vividsolutions.jts.geom.Geometry; + +import gnu.trove.TObjectIntHashMap; + /** * @author Fred Deniger * @version $Id$ @@ -85,7 +94,7 @@ protected void drawLabel(FontMetrics fm, String s, GrPoint pEcran, Color bgColor, Graphics2D _g, Color fgColor) { int stringWidth = fm.stringWidth(s); int x = (int) (pEcran.x_ - stringWidth / 2); - int y = (int) (pEcran.y_ - 5); + int y = (int) (pEcran.y_ - 10); if (bgColor != null) { _g.setColor(bgColor); _g.fillRect(x, y - fm.getAscent(), stringWidth, fm.getHeight() + 2); @@ -185,8 +194,43 @@ } clearCacheAndRepaint(); } + + @Override + protected BConfigurableInterface getAffichageConf() { + final BConfigurableInterface[] sect = new BConfigurableInterface[2 + getNbSet()]; + sect[0] = new ZCalqueAffichageDonneesConfigure(this); + sect[1] = new ZCalqueGeometryLabelConfigure(this); + for (int i = 2; i < sect.length; i++) { + sect[i] = new ZCalqueAffichageDonneesTraceConfigure(this, i - 2); + } + return new BConfigurableComposite(sect, EbliLib.getS("Affichage")); + } @Override + public EbliUIProperties saveUIProperties() { + EbliUIProperties properties = super.saveUIProperties(); + properties.put(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_BACKGROUND, labelsBackgroundColor); + properties.put(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_FOREGROUND, labelsForegroundColor); + return properties; + } + + @Override + public void initFrom(final EbliUIProperties _p) { + if (_p != null) { + super.initFrom(_p); + if (_p.isDefined(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_BACKGROUND)) { + setLabelsBackgroundColor((Color) _p.get(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_BACKGROUND)); + } else { + setLabelsBackgroundColor(null); + } + if (_p.isDefined(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_FOREGROUND)) { + setLabelsForegroundColor((Color) _p.get(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_FOREGROUND)); + } + + } + } + + @Override public void paintDonnees(Graphics2D _g, GrMorphisme _versEcran, GrMorphisme _versReel, GrBoite _clipReel) { super.paintDonnees(_g, _versEcran, _versReel, _clipReel); paintLabelsOnAtomics(_g, _versEcran, _versReel, _clipReel); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |