|
From: <de...@us...> - 2013-01-10 16:32:02
|
Revision: 8199
http://fudaa.svn.sourceforge.net/fudaa/?rev=8199&view=rev
Author: deniger
Date: 2013-01-10 16:31:55 +0000 (Thu, 10 Jan 2013)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometry.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 2013-01-10 16:02:52 UTC (rev 8198)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZCalqueGeometry.java 2013-01-10 16:31:55 UTC (rev 8199)
@@ -564,16 +564,15 @@
}
if (_p.isDefined(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_BACKGROUND)) {
setLabelsBackgroundColor((Color) _p.get(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_BACKGROUND));
- }
- else{
+ } else {
setLabelsBackgroundColor(null);
}
if (_p.isDefined(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_FOREGROUND)) {
setLabelsForegroundColor((Color) _p.get(ZCalqueGeometryLabelConfigure.PROPERTY_LABELS_FOREGROUND));
}
-
+
}
}
@@ -907,30 +906,29 @@
final GrPoint ptDest = new GrPoint();
for (int j = nbPoints - 1; j >= 0; j--) {
modele_.point(ptDest, i, j);
+
+ //pour \xE9viter de redessiner le texte au m\xEAme endroit:
+ Object o = mdl.getObjectValueAt(j);
+ if (o == null) {
+ continue;
+ }
+ String s = o.toString().trim();
+ if (StringUtils.isBlank(s)) {
+ continue;
+ }
if (!_clipReel.contientXY(ptDest)) {
continue;
}
+ ptDest.autoApplique2D(versEcran);
int idxOnScreen = (int) ptDest.x_ + (int) ptDest.y_ * w;
- //pour \xE9viter de redessiner le texte au m\xEAme endroit:
if (idxOnScreen >= 0 && !memory.isSelected(idxOnScreen)) {
memory.add(idxOnScreen);
- Object o = mdl.getObjectValueAt(j);
- if (o == null) {
- continue;
- }
- String s = o.toString().trim();
- if (StringUtils.isBlank(s)) {
- continue;
- }
-
- ptDest.autoApplique2D(versEcran);
- final Rectangle2D rec = fm.getStringBounds(s, _g);
- double x = ptDest.x_ - rec.getWidth() / 2;
- double y = ptDest.y_ - 5;
- rec.setFrame(x, y - fm.getAscent(), rec.getWidth(), fm.getAscent() + 2);
+ int stringWidth = fm.stringWidth(s);
+ int x = (int) (ptDest.x_ - stringWidth / 2);
+ int y = (int) (ptDest.y_ - 5);
if (bgColor != null) {
_g.setColor(bgColor);
- _g.fill(rec);
+ _g.fillRect(x, y - fm.getAscent(), stringWidth, fm.getHeight() + 2);
}
_g.setColor(fgColor);
_g.drawString(s, (int) x, (int) y);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|