|
From: <de...@us...> - 2012-07-19 15:21:42
|
Revision: 7515
http://fudaa.svn.sourceforge.net/fudaa/?rev=7515&view=rev
Author: deniger
Date: 2012-07-19 15:21:31 +0000 (Thu, 19 Jul 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeHorizontal.java
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeHorizontal.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeHorizontal.java 2012-07-19 09:08:41 UTC (rev 7514)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeHorizontal.java 2012-07-19 15:21:31 UTC (rev 7515)
@@ -11,6 +11,7 @@
*/
package org.fudaa.ebli.courbe;
+import com.memoire.bu.BuLib;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
@@ -126,7 +127,6 @@
if (traceSousGrille_) {
traceSousGraduations.dessineTrait(_g, xe, y, xe, yMaxGrad);
} else {
-
}
}
}
@@ -137,9 +137,9 @@
}
/**
- * Appelee uniquement si isIntegerStep est true: permet de donner une repr\xE9sentation specifique pour la graduation
- * passee en parametres. Par defaut, l'entier est traduit en string.
- *
+ * Appelee uniquement si isIntegerStep est true: permet de donner une repr\xE9sentation specifique pour la graduation passee en parametres. Par defaut,
+ * l'entier est traduit en string.
+ *
* @param _i la graduation a dessiner
* @return la chaine representant cette graduation
*/
@@ -173,12 +173,14 @@
/**
* Dessine l'axe horizontal.
- *
+ *
* @param _g le graphics cible
* @param _f le repere
*/
public void dessine(final Graphics2D _g, final EGRepere _f) {
- if (!visible_) { return; }
+ if (!visible_) {
+ return;
+ }
final Font old = _g.getFont();
if (font_ != null) {
_g.setFont(font_);
@@ -215,7 +217,11 @@
_g.setColor(lineColor_);
int width = 0;
- final FontMetrics fm = _g.getFontMetrics(getFont());
+ Font font = getFont();
+ if (font == null) {
+ font = BuLib.DEFAULT_FONT;
+ }
+ final FontMetrics fm = _g.getFontMetrics(font);
if (isTitreCentre_) {
String txt = t;
if (unit != null) {
@@ -257,8 +263,10 @@
public int getBottomHeightNeeded(final Graphics2D _g) {
// epaisseur trait
int r = 3;
- if (_g == null) { return r; }
- if (graduations_ || isGridPainted()){
+ if (_g == null) {
+ return r;
+ }
+ if (graduations_ || isGridPainted()) {
if (font_ == null) {
font_ = EGGraphe.DEFAULT_FONT;
}
@@ -273,7 +281,6 @@
return r;
}
-
/**
* @param _g le graphics dessine
* @return l'espace requis a droite de l'axe
@@ -303,7 +310,9 @@
*/
@Override
public String getStringAffiche(final double _val) {
- if (specificFormat_ != null) { return specificFormat_.format(_val); }
+ if (specificFormat_ != null) {
+ return specificFormat_.format(_val);
+ }
return super.getStringAffiche(_val);
}
@@ -312,15 +321,13 @@
}
/**
- * Les graduations peuvent sous forme d'entier. Dans ce cas, la graduation est effectuee en consequence: seul des
- * entiers sont dessin\xE9s.
- *
+ * Les graduations peuvent sous forme d'entier. Dans ce cas, la graduation est effectuee en consequence: seul des entiers sont dessin\xE9s.
+ *
* @return true si la graduation est faite par palier.
*/
/*
* public final boolean isIntegerStep(){ return isIntegerStep_; }
*/
-
@Override
public final boolean isVertical() {
return false;
@@ -347,10 +354,8 @@
* @param _isIntegerStep si la graduation est faite par palier.
*/
/*
- * public final void setIntegerStep(boolean _isIntegerStep){ isIntegerStep_ = _isIntegerStep; if(axisIterator_!=null)
- * axisIterator_=null; }
+ * public final void setIntegerStep(boolean _isIntegerStep){ isIntegerStep_ = _isIntegerStep; if(axisIterator_!=null) axisIterator_=null; }
*/
-
public EGAxeHorizontal duplicate() {
final EGAxeHorizontal duplic = new EGAxeHorizontal(this);
@@ -372,5 +377,4 @@
duplic.nbSousGraduations_ = nbSousGraduations_;
return duplic;
}
-
}
\ No newline at end of file
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java 2012-07-19 09:08:41 UTC (rev 7514)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java 2012-07-19 15:21:31 UTC (rev 7515)
@@ -910,13 +910,18 @@
titreAxeYVisible.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- EGAxe selectedAxeY = getSelectedAxeY();
- titreAxeYNom.setEnabled(titreAxeYVisible.isSelected() && selectedAxeY != null && selectedAxeY.isTitleModifiable());
+ updateTitreAxeY();
}
});
}
+ updateTitreAxeY();
}
+ protected void updateTitreAxeY() {
+ EGAxe selectedAxeY = getSelectedAxeY();
+ titreAxeYNom.setEnabled(titreAxeYVisible.isSelected() && selectedAxeY != null && selectedAxeY.isTitleModifiable());
+ }
+
private void createAxeYUnitComponents() {
if (uniteAxeY_ == null) {
uniteAxeY_ = new BuTextField();
@@ -928,13 +933,18 @@
uniteAxeYVisible.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- EGAxe selectedAxeY = getSelectedAxeY();
- uniteAxeY_.setEnabled(uniteAxeYVisible.isSelected() && selectedAxeY != null && selectedAxeY.isUniteModifiable());
+ updateUniteAxeY();
}
});
}
+ updateUniteAxeY();
}
+ protected void updateUniteAxeY() {
+ EGAxe selectedAxeY = getSelectedAxeY();
+ uniteAxeY_.setEnabled(uniteAxeYVisible.isSelected() && selectedAxeY != null && selectedAxeY.isUniteModifiable());
+ }
+
private BuLabel createTitleNameLabel() {
return new BuLabel(EbliResource.EBLI.getString("Nom du titre"));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|