Author: dandre
Date: Thu Sep 12 23:09:11 2013
New Revision: 4546

Log:
Move 'Table Tab Follows Entity' checkbox from preference to table settings.
Will have to put whole table settings back in preferences system

Modified:
   trunk/AncestrisCore/ancestris.app/src/ancestris/app/OptionDisplayPanel.form
   trunk/AncestrisCore/ancestris.app/src/ancestris/app/OptionDisplayPanel.java
   trunk/AncestrisCore/modules.views.table/src/genj/table/Bundle.properties
   trunk/AncestrisCore/modules.views.table/src/genj/table/Bundle_fr.properties
   trunk/AncestrisCore/modules.views.table/src/genj/table/TableViewSettings.java

Modified: 
trunk/AncestrisCore/ancestris.app/src/ancestris/app/OptionDisplayPanel.form
==============================================================================
--- trunk/AncestrisCore/ancestris.app/src/ancestris/app/OptionDisplayPanel.form 
(original)
+++ trunk/AncestrisCore/ancestris.app/src/ancestris/app/OptionDisplayPanel.form 
Thu Sep 12 23:09:11 2013
@@ -41,12 +41,8 @@
                   </Group>
                   <Component id="jLabel3" alignment="0" min="-2" max="-2" 
attributes="0"/>
                   <Group type="102" alignment="1" attributes="0">
-                      <Component id="jLabel8" min="-2" pref="127" max="-2" 
attributes="0"/>
-                      <EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
-                      <Group type="103" groupAlignment="1" attributes="0">
-                          <Component id="cbTableFollowEntity" alignment="0" 
pref="469" max="32767" attributes="2"/>
-                          <Component id="jCheckBox1" alignment="0" pref="469" 
max="32767" attributes="0"/>
-                      </Group>
+                      <EmptySpace min="-2" pref="130" max="-2" attributes="0"/>
+                      <Component id="jCheckBox1" pref="456" max="32767" 
attributes="0"/>
                   </Group>
                   <Group type="102" alignment="0" attributes="0">
                       <Component id="jLabel4" min="-2" max="-2" 
attributes="0"/>
@@ -92,15 +88,10 @@
                           <Component id="jLabel3" alignment="3" min="-2" 
max="-2" attributes="0"/>
                           <Component id="jCheckBox1" alignment="3" min="-2" 
max="-2" attributes="0"/>
                       </Group>
-                      <EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
-                      <Group type="103" groupAlignment="3" attributes="0">
-                          <Component id="jLabel8" alignment="3" min="-2" 
max="-2" attributes="0"/>
-                          <Component id="cbTableFollowEntity" alignment="3" 
max="32767" attributes="0"/>
-                      </Group>
                   </Group>
                   <Component id="jPanel1" min="-2" pref="219" max="-2" 
attributes="0"/>
               </Group>
-              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <EmptySpace type="separate" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="jCheckBox3" alignment="3" min="-2" max="-2" 
attributes="0"/>
                   <Component id="jLabel4" alignment="3" min="-2" max="-2" 
attributes="0"/>
@@ -114,7 +105,7 @@
               <Component id="cbSplitJuridictions" min="-2" max="-2" 
attributes="0"/>
               <EmptySpace min="-2" max="-2" attributes="0"/>
               <Component id="jCheckBox2" min="-2" max="-2" attributes="0"/>
-              <EmptySpace min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="32767" attributes="0"/>
           </Group>
       </Group>
     </DimensionLayout>
@@ -286,26 +277,6 @@
         </Property>
       </Properties>
     </Component>
-    <Component class="javax.swing.JLabel" name="jLabel8">
-      <Properties>
-        <Property name="font" type="java.awt.Font" 
editor="org.netbeans.beaninfo.editors.FontEditor">
-          <Font name="DejaVu Sans" size="13" style="1"/>
-        </Property>
-        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString bundle="ancestris/app/Bundle.properties" 
key="OptionDisplayPanel.jLabel8.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
-        </Property>
-      </Properties>
-    </Component>
-    <Component class="javax.swing.JCheckBox" name="cbTableFollowEntity">
-      <Properties>
-        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString bundle="ancestris/app/Bundle.properties" 
key="OptionDisplayPanel.cbTableFollowEntity.text" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
-        </Property>
-        <Property name="toolTipText" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString bundle="ancestris/app/Bundle.properties" 
key="OptionDisplayPanel.cbTableFollowEntity.toolTipText" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;)"/>
-        </Property>
-      </Properties>
-    </Component>
     <Component class="javax.swing.JLabel" name="jLabel9">
       <Properties>
         <Property name="font" type="java.awt.Font" 
editor="org.netbeans.beaninfo.editors.FontEditor">

Modified: 
trunk/AncestrisCore/ancestris.app/src/ancestris/app/OptionDisplayPanel.java
==============================================================================
--- trunk/AncestrisCore/ancestris.app/src/ancestris/app/OptionDisplayPanel.java 
(original)
+++ trunk/AncestrisCore/ancestris.app/src/ancestris/app/OptionDisplayPanel.java 
Thu Sep 12 23:09:11 2013
@@ -74,8 +74,6 @@
         jPanel1 = new javax.swing.JPanel();
         jLabel5 = new javax.swing.JLabel();
         jCheckBox1 = new javax.swing.JCheckBox();
-        jLabel8 = new javax.swing.JLabel();
-        cbTableFollowEntity = new javax.swing.JCheckBox();
         jLabel9 = new javax.swing.JLabel();
         jcbOutputLanguage = new 
javax.swing.JComboBox(initLanguages(NbBundle.getMessage(App.class, 
"options.lang.gui")));
 
@@ -140,12 +138,6 @@
         org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, 
org.openide.util.NbBundle.getMessage(OptionDisplayPanel.class, 
"OptionDisplayPanel.jCheckBox1.text")); // NOI18N
         
jCheckBox1.setToolTipText(org.openide.util.NbBundle.getMessage(OptionDisplayPanel.class,
 "OptionDisplayPanel.jCheckBox1.toolTipText")); // NOI18N
 
-        jLabel8.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
-        org.openide.awt.Mnemonics.setLocalizedText(jLabel8, 
org.openide.util.NbBundle.getMessage(OptionDisplayPanel.class, 
"OptionDisplayPanel.jLabel8.text")); // NOI18N
-
-        org.openide.awt.Mnemonics.setLocalizedText(cbTableFollowEntity, 
org.openide.util.NbBundle.getMessage(OptionDisplayPanel.class, 
"OptionDisplayPanel.cbTableFollowEntity.text")); // NOI18N
-        
cbTableFollowEntity.setToolTipText(org.openide.util.NbBundle.getMessage(OptionDisplayPanel.class,
 "OptionDisplayPanel.cbTableFollowEntity.toolTipText")); // NOI18N
-
         jLabel9.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
         org.openide.awt.Mnemonics.setLocalizedText(jLabel9, 
org.openide.util.NbBundle.getMessage(OptionDisplayPanel.class, 
"OptionDisplayPanel.jLabel9.text")); // NOI18N
 
@@ -172,11 +164,8 @@
                         .addComponent(jPanel1, 
javax.swing.GroupLayout.PREFERRED_SIZE, 182, 
javax.swing.GroupLayout.PREFERRED_SIZE))
                     .addComponent(jLabel3)
                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, 
layout.createSequentialGroup()
-                        .addComponent(jLabel8, 
javax.swing.GroupLayout.PREFERRED_SIZE, 127, 
javax.swing.GroupLayout.PREFERRED_SIZE)
-                        .addGap(3, 3, 3)
-                        
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
-                            .addComponent(cbTableFollowEntity, 
javax.swing.GroupLayout.Alignment.LEADING, 
javax.swing.GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE)
-                            .addComponent(jCheckBox1, 
javax.swing.GroupLayout.Alignment.LEADING, 
javax.swing.GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE)))
+                        .addGap(130, 130, 130)
+                        .addComponent(jCheckBox1, 
javax.swing.GroupLayout.DEFAULT_SIZE, 456, Short.MAX_VALUE))
                     .addGroup(layout.createSequentialGroup()
                         .addComponent(jLabel4)
                         .addGap(79, 79, 79)
@@ -213,13 +202,9 @@
                         .addGap(121, 121, 121)
                         
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                             .addComponent(jLabel3)
-                            .addComponent(jCheckBox1))
-                        .addGap(29, 29, 29)
-                        
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                            .addComponent(jLabel8)
-                            .addComponent(cbTableFollowEntity)))
+                            .addComponent(jCheckBox1)))
                     .addComponent(jPanel1, 
javax.swing.GroupLayout.PREFERRED_SIZE, 219, 
javax.swing.GroupLayout.PREFERRED_SIZE))
-                
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGap(18, 18, 18)
                 
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addComponent(jCheckBox3)
                     .addComponent(jLabel4))
@@ -231,7 +216,7 @@
                 .addComponent(cbSplitJuridictions)
                 
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jCheckBox2)
-                .addContainerGap())
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, 
Short.MAX_VALUE))
         );
     }// </editor-fold>//GEN-END:initComponents
 
@@ -254,7 +239,6 @@
         setUndos(gedcomPrefs.get("numberOfUndos", ""));
         
cbSplitJuridictions.setSelected(CoreOptions.getInstance().isSplitJurisdictions());
 //XXX:        setOpenEditor(editPrefs.get("isOpenEditor", ""));
-//XXX:        cbTableFollowEntity.setSelected(TableView.getFollowEntity());
     }
 
     void store() {
@@ -279,7 +263,6 @@
         
CoreOptions.getInstance().setSplitJurisdictions(cbSplitJuridictions.isSelected());
 
 //XXX:        editPrefs.put("isOpenEditor", getOpenEditor());
-//XXX:        TableView.setFollowEntity(cbTableFollowEntity.isSelected());
 
         
StatusDisplayer.getDefault().setStatusText(org.openide.util.NbBundle.getMessage(OptionDisplayPanel.class,
 "OptionPanel.saved.statustext"));
         if (needRestart)
@@ -297,7 +280,6 @@
     }
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JCheckBox cbSplitJuridictions;
-    private javax.swing.JCheckBox cbTableFollowEntity;
     private javax.swing.JCheckBox jCheckBox1;
     private javax.swing.JCheckBox jCheckBox2;
     private javax.swing.JCheckBox jCheckBox3;
@@ -308,7 +290,6 @@
     private javax.swing.JLabel jLabel4;
     private javax.swing.JLabel jLabel5;
     private javax.swing.JLabel jLabel6;
-    private javax.swing.JLabel jLabel8;
     private javax.swing.JLabel jLabel9;
     private javax.swing.JPanel jPanel1;
     private javax.swing.JSpinner jSpinner1;

Modified: 
trunk/AncestrisCore/modules.views.table/src/genj/table/Bundle.properties
==============================================================================
--- trunk/AncestrisCore/modules.views.table/src/genj/table/Bundle.properties    
(original)
+++ trunk/AncestrisCore/modules.views.table/src/genj/table/Bundle.properties    
Thu Sep 12 23:09:11 2013
@@ -12,3 +12,5 @@
 
 mode.tip       = View {0}
 action.stick.tip = freeze table view
+cbTableFollowEntity.text=<html>The Table view must follow the selection of an 
entity made in another view</html>
+cbTableFollowEntity.toolTipText=<html>When this setting is checked, if an 
entity is selected in a view different from the Table\n<br/>View, and that this 
entity is of a different kind of the one selected in the Table view, so 
\n<br/>the Table View will switch to the right tab to show that 
entity.\n<br/>(Ex: If you are in the Table view focussed on the INDIviduals tab 
and you click on a FAMily \n<br/>in the Tree View, the Table will switch to the 
FAMily tab)\n<br/>\n<br/>If you uncheck this setting, the selected tab of the 
Table View will stay displayed on its \n<br/>current value.</html>

Modified: 
trunk/AncestrisCore/modules.views.table/src/genj/table/Bundle_fr.properties
==============================================================================
--- trunk/AncestrisCore/modules.views.table/src/genj/table/Bundle_fr.properties 
(original)
+++ trunk/AncestrisCore/modules.views.table/src/genj/table/Bundle_fr.properties 
Thu Sep 12 23:09:11 2013
@@ -15,3 +15,5 @@
 mode.tip         = Visualisation des {0}
 
 action.stick.tip = Fige la vue Table
+cbTableFollowEntity.text=<html>Basculement de la table quelque soit le type 
d'entit\u00e9 s\u00e9lectionn\u00e9e dans une autre vue</html>
+cbTableFollowEntity.toolTipText=<html>Lorsque cette case est coch\u00e9e, si 
une entit\u00e9 est s\u00e9lectionn\u00e9e dans une autre fen\u00eatre 
que\n<br/>celle de la table, et que cette entit\u00e9 est d'un type 
diff\u00e9rent de l'onglet s\u00e9lectionn\u00e9 de la table\n<br/>alors 
l'onglet de la table est automatiquement chang\u00e9.\n<br/>(Ex: Si vous 
\u00eates dans l'onglet INDIvidus de la Table et que vous cliquez sur une 
FAMille dans\n<br/>la fen\u00eatre de l'Arbre, la vue de la Table basculera sur 
l'onglet FAMille)\n<br/>\n<br/>Si cette option n'est pas coch\u00e9e, l'onglet 
s\u00e9lectionn\u00e9 restera sur sa valeur courante.</html>

Modified: 
trunk/AncestrisCore/modules.views.table/src/genj/table/TableViewSettings.java
==============================================================================
--- 
trunk/AncestrisCore/modules.views.table/src/genj/table/TableViewSettings.java   
    (original)
+++ 
trunk/AncestrisCore/modules.views.table/src/genj/table/TableViewSettings.java   
    Thu Sep 12 23:09:11 2013
@@ -34,6 +34,7 @@
 import java.util.List;
 
 import javax.swing.JButton;
+import javax.swing.JCheckBox;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.event.ChangeEvent;
@@ -126,6 +127,20 @@
     gh.add(new JButton(dn)                                
,1,4,1,1,GridBagHelper.FILL_HORIZONTAL);
     gh.add(new JButton(del)                               
,2,4,1,1,GridBagHelper.FILL_HORIZONTAL);
 
+    final JCheckBox cbTableFollowEntity = new JCheckBox(
+            resources.getString("cbTableFollowEntity.text"),
+            TableView.getFollowEntity());
+    
cbTableFollowEntity.setToolTipText(resources.getString("cbTableFollowEntity.toolTipText"));
    
+    //FIXME: check box is automatically saved on change. 
+    // We should put this dialog in a more traditionnal OK/Cancel dialog box
+    cbTableFollowEntity.addChangeListener(new ChangeListener() {
+
+            @Override
+            public void stateChanged(ChangeEvent e) {
+                TableView.setFollowEntity(cbTableFollowEntity.isSelected());
+            }
+        });
+    gh.add(cbTableFollowEntity                            
,0,5,4,1,GridBagHelper.FILL_HORIZONTAL);
   }
 
   /**

---------------------------------------------------------------------
Site Web Ancestris : http://www.ancestris.org

<*> Pour vous desinscrire de cette liste, envoyez un mail a :
              [email protected]
<*> Pour obtenir de l'aide sur les commandes de la liste :
              [email protected]

Pour obtenir tous les messages lies a ce fil de discussion, cliquez sur le 
lien ci-dessous, cela ouvrira votre logiciel de messagerie. Il vous suffira 
d'envoyer le message :
              [email protected]

Reply via email to