|
From: <de...@us...> - 2015-05-11 21:41:11
|
Revision: 9126
http://sourceforge.net/p/fudaa/svn/9126
Author: deniger
Date: 2015-05-11 21:41:09 +0000 (Mon, 11 May 2015)
Log Message:
-----------
dev
Modified Paths:
--------------
trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java
Modified: trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java
===================================================================
--- trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 2015-05-11 21:39:31 UTC (rev 9125)
+++ trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/layer/FSigGrillePalette.java 2015-05-11 21:41:09 UTC (rev 9126)
@@ -42,6 +42,7 @@
import org.fudaa.ebli.controle.BSelecteurTargetInterface;
import org.fudaa.ebli.controle.BSelecteurTextField;
import org.fudaa.ebli.geometrie.GrBoite;
+import org.fudaa.ebli.geometrie.GrPoint;
import org.fudaa.ebli.ressource.EbliResource;
/**
@@ -49,10 +50,8 @@
* @version $Id: FSigGrillePalette.java,v 1.2 2007-04-16 16:35:35 deniger Exp $
*/
@SuppressWarnings("serial")
-public final class FSigGrillePalette extends EbliActionPaletteAbstract implements
+public final class FSigGrillePalette extends EbliActionPaletteAbstract implements BSelecteurTargetInterface {
-BSelecteurTargetInterface {
-
ZEbliCalquesPanel panel_;
final ZCalqueGrille target_;
@@ -63,8 +62,7 @@
*/
FSigGrillePalette(final ZCalqueGrille _target, final ZEbliCalquesPanel _panel) {
super(EbliResource.EBLI.getString("Repere"), EbliResource.EBLI.getIcon("repere"),
-
- "CHANGE_REFERENCE");
+ "CHANGE_REFERENCE");
target_ = _target;
panel_ = _panel;
}
@@ -95,8 +93,8 @@
}
BuComboBox createAxeComboBox() {
- return new BuComboBox(new String[] { EbliLib.getS("Graduations manuelles: nombre"),
- EbliLib.getS("Graduations manuelles: longueur"), EbliLib.getS("Graduations automatiques: Nombre") });
+ return new BuComboBox(new String[]{EbliLib.getS("Graduations manuelles: nombre"),
+ EbliLib.getS("Graduations manuelles: longueur"), EbliLib.getS("Graduations automatiques: Nombre")});
}
/**
@@ -142,9 +140,8 @@
void updateMainGraduationType() {
final int selectedIndex = cbGraduationMode_.getSelectedIndex();
setProperty(propMainGraduationModeAuto_, selectedIndex >= 2);
- setProperty(propMainGraduationModeLength_, Boolean.valueOf(selectedIndex == 1 ||
-
- selectedIndex == 3));
+ setProperty(propMainGraduationModeLength_, Boolean.valueOf(selectedIndex == 1
+ || selectedIndex == 3));
if (selectedIndex == 0 || selectedIndex == 2) {
layoutCardX_.show(pnMainGraduation_, CHOOSE_GRADUATION_NB);
} else if (selectedIndex == 1 || selectedIndex == 3) {
@@ -155,7 +152,7 @@
void updateSousGraduation() {
tfMinorGraduation_.setEnabled(cbShowMinorGraduation_.isSelected() && target_.isDrawX()
- && !target_.isModeAutomatiqueX());
+ && !target_.isModeAutomatiqueX());
}
protected JPanel createPanel() {
@@ -165,12 +162,8 @@
cbShowAxe_.setText(titleCbShowAxe_);
cbGraduationMode_ = createAxeComboBox();
- final boolean auto = ((Boolean)
-
- target_.getProperty(propMainGraduationModeAuto_)).booleanValue();
- final boolean length = ((Boolean)
-
- target_.getProperty(propMainGraduationModeLength_)).booleanValue();
+ final boolean auto = ((Boolean) target_.getProperty(propMainGraduationModeAuto_)).booleanValue();
+ final boolean length = ((Boolean) target_.getProperty(propMainGraduationModeLength_)).booleanValue();
if (auto) {
cbGraduationMode_.setSelectedIndex(2);
} else {
@@ -178,8 +171,8 @@
}
cbGraduationMode_.addItemListener(new ItemListener() {
/**
- *
- */
+ *
+ */
@Override
public void itemStateChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
@@ -192,8 +185,7 @@
pnMainGraduation_ = new BuPanel(layoutCardX_);
final BuPanel mainPanel = new BuTitledPanel(cbShowAxe_, new BuGridLayout(2, 5, 5, true,
-
- false, true, true, true));
+ false, true, true, true));
cbShowAxe_.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent _e) {
@@ -209,18 +201,14 @@
final BuTextField tfGraduationNb = (BuTextField) selecteurTextField.getComponents()[0];
tfGraduationNb.setStringValidator(BuStringValidator.INTEGER);
tfGraduationNb.setValueValidator(BuValueValidator.MULTI(BuValueValidator.INTEGER,
-
- BuValueValidator.MINMAX(0, 5000)));
+ BuValueValidator.MINMAX(0, 5000)));
selecteurTextField.updateFromTarget();
// tfGraduationNb.setColumns(5);
pnMainGraduation_.add(tfGraduationNb, CHOOSE_GRADUATION_NB);
selecteurTextField = new BSelecteurTextField(propMainGraduationLength_,
-
- BuValueValidator.DOUBLE);
+ BuValueValidator.DOUBLE);
selecteurTextField.setSelecteurTarget(FSigGrillePalette.this);
- final BuTextField tfMainGraduationLength = (BuTextField)
-
- selecteurTextField.getComponents()[0];
+ final BuTextField tfMainGraduationLength = (BuTextField) selecteurTextField.getComponents()[0];
selecteurTextField.updateFromTarget();
pnMainGraduation_.add(tfMainGraduationLength, CHOOSE_GRADUATION_LENGTH);
// --on affiche le manuel 1 par defaut --//
@@ -231,9 +219,8 @@
cbShowMinorGraduation_ = selectCb.getCb();
cbShowMinorGraduation_.setText(EbliLib.getS("Dessiner les sous-graduations"));
selecteurTextField = new BSelecteurTextField(propMinorGraduationNb_,
+ BuValueValidator.INTEGER);
- BuValueValidator.INTEGER);
-
selecteurTextField.setSelecteurTarget(FSigGrillePalette.this);
tfMinorGraduation_ = (BuTextField) selecteurTextField.getComponents()[0];
tfMinorGraduation_.setStringValidator(BuStringValidator.INTEGER);
@@ -283,9 +270,7 @@
@Override
public void actionPerformed(final ActionEvent _e) {
final JDialog d = new JDialog(CtuluLibSwing.getFrameAncestorHelper(target_));
- final BSelecteurReduitFonteNewVersion ft = new
-
- BSelecteurReduitFonteNewVersion(btFont.getFont(), d);
+ final BSelecteurReduitFonteNewVersion ft = new BSelecteurReduitFonteNewVersion(btFont.getFont(), d);
ft.setTarget(target_);
d.setContentPane(ft.getComponent());
d.setModal(true);
@@ -304,9 +289,7 @@
* @param pn
* @param lineConf
*/
- private void installTraceLigne(final BuPanel pn, final ZCalqueAffichageDonneesLigneConfigure lineConf)
-
- {
+ private void installTraceLigne(final BuPanel pn, final ZCalqueAffichageDonneesLigneConfigure lineConf) {
final BSelecteurInterface[] jc = lineConf.createSelecteurs();
pn.add(new JLabel(lineConf.getTitle()));
final JComponent[] components = jc[0].getComponents();
@@ -332,7 +315,7 @@
* @param tfMaxY
*/
public ZoomContainer(final BuTextField tfMinX, final BuTextField tfMaxX, final BuTextField tfMinY,
- final BuTextField tfMaxY) {
+ final BuTextField tfMaxY) {
super();
this.tfMinX = tfMinX;
this.tfMaxX = tfMaxX;
@@ -356,7 +339,7 @@
return (maxX != null && maxY != null && minX != null && minY != null);
}
- protected void applyToPanel() {
+ protected void applyToPanel(boolean zoomX) {
if (isAllSet()) {
final Double minx = (Double) tfMinX.getValue();
final Double miny = (Double) tfMinY.getValue();
@@ -364,29 +347,46 @@
Double maxy = (Double) tfMaxY.getValue();
final double deltax = Math.abs(maxx - minx);
final double deltay = Math.abs(maxy - miny);
- if (deltay > deltax) {
- maxx = Double.valueOf(minx.doubleValue() + deltay);
- } else if (deltax > deltay) {
- maxy = Double.valueOf(miny.doubleValue() + deltax);
- }
- target_.changeZoom(minx, miny, maxx, maxy);
+ /*
+ if (deltay > deltax) {
+ maxx = Double.valueOf(minx.doubleValue() + deltay);
+ } else if (deltax > deltay) {
+ maxy = Double.valueOf(miny.doubleValue() + deltax);
+ }
+ */
+ target_.getVue().changeRepereZoom(target_, new GrBoite(new GrPoint(minx, miny, 0), new GrPoint(maxx, maxy, 0)), 0, 0, 0, false, false, zoomX);
+ //target_.changeZoom(minx, miny, maxx, maxy);
}
}
}
private BuPanel createZoom() {
- final BuPanel select = new BuPanel(new BuGridLayout(3, 3, 3, false, false, false, false, false));
+ final BuPanel select = new BuPanel(new BuGridLayout(4, 3, 3, false, false, false, false, false));
select.add(new BuLabel(EbliLib.getS("")));
select.add(new BuLabel(EbliLib.getS("Min")));
select.add(new BuLabel(EbliLib.getS("Max")));
+ select.add(new BuLabel(EbliLib.getS("")));
+
select.add(new BuLabel(EbliLib.getS("X")));
final BuTextField tfMinX = addDoubleText(select);
final BuTextField tfMaxX = addDoubleText(select);
+
+ final BuButton btZoomX = new BuButton(EbliLib.getS("Appliquer le zoom sur X"));
+ btZoomX.setIcon(EbliResource.EBLI.getToolIcon("zoom-selection"));
+ btZoomX.setEnabled(true);
+ select.add(btZoomX);
+
select.add(new BuLabel(EbliLib.getS("Y")));
final BuTextField tfMinY = addDoubleText(select);
final BuTextField tfMaxY = addDoubleText(select);
+
+ final BuButton btZoomY = new BuButton(EbliLib.getS("Appliquer le zoom sur Y"));
+ btZoomY.setIcon(EbliResource.EBLI.getToolIcon("zoom-selection"));
+ btZoomY.setEnabled(true);
+ select.add(btZoomY);
+
final ZoomContainer container = new ZoomContainer(tfMinX, tfMaxX, tfMinY, tfMaxY);
final PropertyChangeListener listener = new PropertyChangeListener() {
@@ -395,6 +395,23 @@
container.updateFromView();
}
};
+
+ btZoomX.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(final ActionEvent _e) {
+ container.applyToPanel(true);
+ }
+ });
+
+ btZoomY.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(final ActionEvent _e) {
+ container.applyToPanel(false);
+ }
+ });
+
panel_.getVueCalque().addPropertyChangeListener("repere", listener);
// to update the textfields at construction
container.updateFromView();
@@ -402,20 +419,9 @@
final BuPanel zoom = new BuPanel(new BuVerticalLayout(3, false, false));
zoom.setBorder(CtuluLibSwing.createTitleBorder(EbliLib.getS("Changer le zoom")));
zoom.add(select);
- final BuButton bt = new BuButton(EbliLib.getS("Appliquer le zoom"));
- bt.setIcon(EbliResource.EBLI.getToolIcon("zoom-selection"));
- bt.setEnabled(true);
- bt.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(final ActionEvent _e) {
- container.applyToPanel();
- }
- });
- zoom.add(bt);
final BuButton btRestaurer = new BuButton(EbliResource.EBLI.getIcon("restore"),
-
- EbliResource.EBLI.getString("Restaurer"));
+ EbliResource.EBLI.getString("Restaurer"));
btRestaurer.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent _e) {
@@ -443,18 +449,18 @@
}
/**
- *
- */
+ *
+ */
@Override
public Object getProperty(final String _key) {
return target_.getProperty(_key);
}
/**
- *
- */
+ *
+ */
@Override
public boolean setProperty(final String _key, final Object prop) {
return target_.setProperty(_key, prop);
}
-}
\ No newline at end of file
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|