|
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.
|