|
From: <bma...@us...> - 2011-04-01 10:50:16
|
Revision: 6203
http://fudaa.svn.sourceforge.net/fudaa/?rev=6203&view=rev
Author: bmarchan
Date: 2011-04-01 10:50:10 +0000 (Fri, 01 Apr 2011)
Log Message:
-----------
ADD : Selecteur de la visibilit?\195?\169 des labels sur points
Modified Paths:
--------------
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGCourbe.java
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGCourbeConfigureTarget.java
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGCourbe.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGCourbe.java 2011-04-01 09:32:50 UTC (rev 6202)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGCourbe.java 2011-04-01 10:50:10 UTC (rev 6203)
@@ -72,6 +72,8 @@
boolean displayTitleOnCurve_;
+ boolean displayPointLabels_;
+
Font font_ = CtuluLibSwing.getMiniFont();
final TraceIconModel iconeModel_;
@@ -305,6 +307,10 @@
return displayTitleOnCurve_;
}
+ public boolean isDisplayPointLabels() {
+ return displayPointLabels_;
+ }
+
protected boolean isSelected(final double _xToTest, final double _yToTest, final int _x, final int _y,
final EGRepere _t, final EGAxeVertical _yaxe, final int _precision) {
return (CtuluLibGeometrie.getDistance(_x, _y, _t.getXEcran(_xToTest), _t.getYEcran(_yToTest, _yaxe)) <= _precision);
@@ -335,6 +341,14 @@
return true;
}
+ public boolean setDisplayPointLabels(final boolean _displayPointLabels) {
+ if (_displayPointLabels == displayPointLabels_) { return false; }
+ displayPointLabels_ = _displayPointLabels;
+ fireCourbeAspectChanged(false);
+ firePropertyChange(EGCourbeConfigureTarget.PROP_DISPLAY_POINT_LABELS, displayPointLabels_);
+ return true;
+ }
+
protected boolean setFont(final Font _font) {
if (_font == font_) { return false; }
font_ = _font;
@@ -468,25 +482,32 @@
if(model_.isPointDrawn(i) && xiVisible && yiVisible) {
// Paint point label
- String pLabel=model_.getPointLabel(i);
- if(pLabel!=null) {
- // Dessin de la boite et du label
- // X
- int xBox;
- if(((int) xie)<=_t.getMinEcranX())
- xBox=((int) xie);
- else if(((int) xie)>=_t.getMaxEcranX())
- xBox=((int) xie)-_g.getFontMetrics().stringWidth(pLabel)-3;
- else
- xBox=((int) xie)-_g.getFontMetrics().stringWidth(pLabel)/2-2;
- // Y
- int yBox;
- if(((int) yie)>=_t.getMaxEcranY())
- yBox=((int) yie)-10;
- else
- yBox=((int) yie)+10;
- // Paint
- tboxLabels_.paintBox(_g, xBox, yBox, pLabel);
+ if (displayPointLabels_) {
+ String pLabel=model_.getPointLabel(i);
+ if (pLabel != null) {
+ // Dessin de la boite et du label
+ // X
+ int xBox;
+ if (((int) xie) <= _t.getMinEcranX()) {
+ xBox=((int) xie);
+ }
+ else if (((int) xie) >= _t.getMaxEcranX()) {
+ xBox=((int) xie) - _g.getFontMetrics().stringWidth(pLabel) - 3;
+ }
+ else {
+ xBox=((int) xie) - _g.getFontMetrics().stringWidth(pLabel) / 2 - 2;
+ }
+ // Y
+ int yBox;
+ if (((int) yie) >= _t.getMaxEcranY()) {
+ yBox=((int) yie) - 10;
+ }
+ else {
+ yBox=((int) yie) + 10;
+ }
+ // Paint
+ tboxLabels_.paintBox(_g, xBox, yBox, pLabel);
+ }
}
// Paint point
if(iconeModel_.getType() != TraceIcon.RIEN) {
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGCourbeConfigureTarget.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGCourbeConfigureTarget.java 2011-04-01 09:32:50 UTC (rev 6202)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGCourbeConfigureTarget.java 2011-04-01 10:50:10 UTC (rev 6203)
@@ -54,6 +54,9 @@
if (_key == PROP_DISPLAY_TITLE_CURVE) {
return Boolean.valueOf(target_.isDisplayTitleOnCurve());
}
+ if (_key == PROP_DISPLAY_POINT_LABELS) {
+ return Boolean.valueOf(target_.isDisplayPointLabels());
+ }
if (_key == BSelecteurReduitFonteNewVersion.PROPERTY) {
return target_.getFont();
}
@@ -80,6 +83,9 @@
if (_key == PROP_DISPLAY_TITLE_CURVE) {
return target_.setDisplayTitleOnCurve(((Boolean) _newProp).booleanValue());
}
+ if (_key == PROP_DISPLAY_POINT_LABELS) {
+ return target_.setDisplayPointLabels(((Boolean) _newProp).booleanValue());
+ }
if (_key == BSelecteurReduitFonteNewVersion.PROPERTY) {
return target_.setFont((Font) _newProp);
}
@@ -93,7 +99,7 @@
}
public BSelecteurInterface[] createSelecteurs() {
- final BSelecteurInterface[] res = new BSelecteurInterface[7];
+ final BSelecteurInterface[] res = new BSelecteurInterface[8];
int idx = 0;
res[idx] = new BSelecteurColorChooserBt();
((BSelecteurColorChooserBt) res[idx]).setAddListenerToTarget(false);
@@ -105,7 +111,9 @@
((BSelecteurCheckBox) res[idx++]).setTitle(EbliLib.getS("Nuage de points"));
res[idx] = new BSelecteurCheckBox(PROP_DISPLAY_TITLE_CURVE);
((BSelecteurCheckBox) res[idx++]).setTitle(EbliLib.getS("Afficher le titre sur la courbe"));
- res[idx] = new BSelecteurFont();
+ res[idx++] = new BSelecteurFont();
+ res[idx] = new BSelecteurCheckBox(PROP_DISPLAY_POINT_LABELS);
+ ((BSelecteurCheckBox) res[idx]).setTitle(EbliLib.getS("Afficher les labels des points"));
return res;
}
@@ -339,6 +347,7 @@
public final static String PROP_DISPLAY_TITLE_CURVE = "courbeDisplayCurve";
public final static String PROP_MARK_MIN = "courbeMarkMin";
public final static String PROP_MARK_LINE = "courbeMarkLine";
+ public final static String PROP_DISPLAY_POINT_LABELS = "courbeDisplayPointsLabels";
//-- proprietes propres aux liste des marqueurs --//
public final static String PROP_MARK_VALUES = "courbeMarkValues";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|