|
From: <bma...@us...> - 2008-06-19 10:54:02
|
Revision: 3646
http://fudaa.svn.sourceforge.net/fudaa/?rev=3646&view=rev
Author: bmarchan
Date: 2008-06-19 03:54:10 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
Placement du checkbox visibilit?\195?\169 plus appropri?\195?\169.
Modified Paths:
--------------
branches/Br_FudaaModeleur_TF/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BArbreCalque.java
Modified: branches/Br_FudaaModeleur_TF/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BArbreCalque.java
===================================================================
--- branches/Br_FudaaModeleur_TF/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BArbreCalque.java 2008-06-19 10:52:35 UTC (rev 3645)
+++ branches/Br_FudaaModeleur_TF/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BArbreCalque.java 2008-06-19 10:54:10 UTC (rev 3646)
@@ -204,16 +204,29 @@
// on recupere le rectangle englobant de la cellule
final Rectangle r = getRowBounds(getRowForPath(p));
// calcul de l'enveloppe de la case a cocher
- // la case a cocher est a droite ....
- final int maxX = r.x + r.width;
- final int minX = maxX - cbWidth_;
- final int minY = r.y;
+// // la case a cocher est a droite ....
+// final int maxX = r.x + r.width;
+// final int minX = maxX - cbWidth_;
+// final int minY = r.y;
+// final int maxY = minY + cbHeight_;
+// if (e.getX() >= minX && e.getX() <= maxX && e.getY() >= minY && e.getY() <= maxY) {
+// return true;
+// }
+// // pour modifier le nom
+// else if (e.getClickCount() == 2 && (e.getX() > r.x + cq.getIconWidth()) && (e.getX() < minX)
+// && cq.isTitleModifiable()) {
+// return true;
+// }
+ // la case a cocher est a gauche, pour plus de facilit\xE9 d'acc\xE8s ....
+ final int maxX = r.x + cbWidth_;
+ final int minX = r.x;
+ final int minY = r.y+4;
final int maxY = minY + cbHeight_;
if (e.getX() >= minX && e.getX() <= maxX && e.getY() >= minY && e.getY() <= maxY) {
return true;
}
// pour modifier le nom
- else if (e.getClickCount() == 2 && (e.getX() > r.x + cq.getIconWidth()) && (e.getX() < minX)
+ else if (e.getClickCount() == 2 && (e.getX() > r.x +cbWidth_+ cq.getIconWidth()) && (e.getX() < r.x+r.width)
&& cq.isTitleModifiable()) {
return true;
}
@@ -478,7 +491,7 @@
r2_ = new JLabel(" ");
r2_.setPreferredSize(new Dimension(80, 12));
r3_ = new JLabel(" ");
- r3_.setPreferredSize(new Dimension(25, 25));
+ r3_.setPreferredSize(new Dimension(25,25));
final JPanel r4 = new JPanel(new BuBorderLayout(0, 1, true, true));
r4.add(r1_, BuBorderLayout.CENTER);
r4.add(r2_, BuBorderLayout.SOUTH);
@@ -486,8 +499,8 @@
final BuBorderLayout lay = new BuBorderLayout(2, 1, true, true);
lay.setYAlign(0);
setLayout(lay);
- add(r3_, BuBorderLayout.WEST);
- add(r4, BuBorderLayout.CENTER);
+ add(r3_, BuBorderLayout.CENTER);
+ add(r4, BuBorderLayout.EAST);
if (_editable) {
cbVisible_ = new BuCheckBox();
// pour ne pas tout dessiner
@@ -495,8 +508,8 @@
cbVisible_.setToolTipText(EbliLib.getS("Visible"));
cbVisible_.setVerticalAlignment(SwingConstants.TOP);
cbVisible_.setHorizontalAlignment(SwingConstants.RIGHT);
- cbVisible_.setMargin(new Insets(0, 4, 0, 0));
- r4.add(cbVisible_, BuBorderLayout.EAST);
+ cbVisible_.setMargin(new Insets(8, 0, 0, 0));
+ add(cbVisible_, BuBorderLayout.WEST);
}
setOpaque(true);
}
@@ -514,6 +527,9 @@
if (_value instanceof BCalque) {
final BCalque calque = (BCalque) _value;
r3_.setIcon(calque);
+ // Si on souhaite pouvoir retailler l'icon du calque.
+// r3_.setIcon(CtuluLibImage.resize(calque,r3_.getPreferredSize().width,r3_.getPreferredSize().height));
+
calqueInfo = (String) calque.getClientProperty("CalqueInfo");
if (calqueInfo != null) {
s.append(calqueInfo);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|