Permalink
Browse files

Fix bug 806798

Added configuration option in data laboratory to switch TimeFormat of time intervals between date and double.
  • Loading branch information...
1 parent 1e78291 commit 96e6edfb29ce7524015b9e036042d71d50f281e5 @eduramiba eduramiba committed Jul 7, 2011
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
AutoUpdate-Essential-Module: true
OpenIDE-Module: org.gephi.datalab.plugin
OpenIDE-Module-Localizing-Bundle: org/gephi/datalab/plugin/Bundle.properties
-OpenIDE-Module-Specification-Version: 0.8.0.3
+OpenIDE-Module-Specification-Version: 0.8.0.4
@@ -458,7 +458,7 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) {
private void fileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileButtonActionPerformed
String lastPath = NbPreferences.forModule(ImportCSVUIVisualPanel1.class).get(LAST_PATH, null);
final JFileChooser chooser = new JFileChooser(lastPath);
- chooser.setAcceptAllFileFilterUsed(false);
+ chooser.setAcceptAllFileFilterUsed(true);
DialogFileFilter dialogFileFilter = new DialogFileFilter(NbBundle.getMessage(ImportCSVUIVisualPanel1.class, "ImportCSVUIVisualPanel1.filechooser.csvDescription"));
dialogFileFilter.addExtension("csv");
chooser.addChoosableFileFilter(dialogFileFilter);
@@ -3,5 +3,5 @@ AutoUpdate-Essential-Module: true
OpenIDE-Module: org.gephi.desktop.datalab
OpenIDE-Module-Layer: org/gephi/desktop/datalab/layer.xml
OpenIDE-Module-Localizing-Bundle: org/gephi/desktop/datalab/Bundle.properties
-OpenIDE-Module-Specification-Version: 0.8.0.3
+OpenIDE-Module-Specification-Version: 0.8.0.4
@@ -45,3 +45,4 @@ DataTableTopComponent.availableColumnsButton.toolTipText=Configure displayed col
AvailableColumnsPanel.title=Display settings
AvailableColumnsPanel.descriptionLabel.text=Choose the columns to display:
AvailableColumnsPanel.maximum-available-columns.info=Maximum number of columns reached
+ConfigurationPanel.timeIntervalsAsDates.text=Time intervals as dates
@@ -74,3 +74,5 @@ AvailableColumnsPanel.title=Columnas disponibles
AvailableColumnsPanel.descriptionLabel.text=Escoge las columnas que deber\u00edan estar disponibles\:
AvailableColumnsPanel.maximum-available-columns.info=N\u00famero m\u00e1ximo de columnas disponibles alcanzado
+
+ConfigurationPanel.timeIntervalsAsDates.text=Intervalos temporales como fechas
@@ -16,15 +16,18 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
+ <Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="1" max="-2" attributes="0">
- <Component id="onlyVisibleCheckBox" alignment="0" max="32767" attributes="1"/>
- <Component id="useSparklinesCheckBox" alignment="0" max="32767" attributes="1"/>
- <Component id="showEdgesNodesLabelsCheckBox" alignment="0" max="32767" attributes="1"/>
- <Component id="timeIntervalsGraphicsCheckBox" alignment="0" max="32767" attributes="1"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="103" groupAlignment="1" max="-2" attributes="0">
+ <Component id="onlyVisibleCheckBox" alignment="0" max="32767" attributes="1"/>
+ <Component id="useSparklinesCheckBox" alignment="0" max="32767" attributes="1"/>
+ <Component id="showEdgesNodesLabelsCheckBox" alignment="0" max="32767" attributes="1"/>
+ <Component id="timeIntervalsGraphicsCheckBox" alignment="0" max="32767" attributes="1"/>
+ </Group>
+ <Component id="timeIntervalsAsDates" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
- <EmptySpace pref="44" max="32767" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -36,6 +39,8 @@
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="useSparklinesCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
+ <Component id="timeIntervalsAsDates" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
<Component id="timeIntervalsGraphicsCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="showEdgesNodesLabelsCheckBox" min="-2" max="-2" attributes="0"/>
@@ -85,5 +90,15 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="timeIntervalsGraphicsCheckBoxActionPerformed"/>
</Events>
</Component>
+ <Component class="javax.swing.JCheckBox" name="timeIntervalsAsDates">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/gephi/desktop/datalab/Bundle.properties" key="ConfigurationPanel.timeIntervalsAsDates.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="timeIntervalsAsDatesActionPerformed"/>
+ </Events>
+ </Component>
</SubComponents>
</Form>
@@ -20,20 +20,27 @@
*/
package org.gephi.desktop.datalab;
+import org.gephi.dynamic.api.DynamicController;
+import org.gephi.dynamic.api.DynamicModel;
+import org.openide.util.Lookup;
+
/**
* Configurations dialog for DataTableTopComponent
* @author Eduardo Ramos <eduramiba@gmail.com>
*/
public class ConfigurationPanel extends javax.swing.JPanel {
private DataTableTopComponent dataTableTopComponent;
+ private DynamicController dynamicController;
/** Creates new form ConfigurationPanel */
public ConfigurationPanel(DataTableTopComponent dataTableTopComponent) {
this.dataTableTopComponent=dataTableTopComponent;
+ dynamicController=Lookup.getDefault().lookup(DynamicController.class);
initComponents();
onlyVisibleCheckBox.setSelected(dataTableTopComponent.isShowOnlyVisible());
useSparklinesCheckBox.setSelected(dataTableTopComponent.isUseSparklines());
+ timeIntervalsAsDates.setSelected(dynamicController.getModel().getTimeFormat()!=DynamicModel.TimeFormat.DOUBLE);
timeIntervalsGraphicsCheckBox.setSelected(dataTableTopComponent.isTimeIntervalGraphics());
showEdgesNodesLabelsCheckBox.setSelected(dataTableTopComponent.isShowEdgesNodesLabels());
}
@@ -51,6 +58,7 @@ private void initComponents() {
useSparklinesCheckBox = new javax.swing.JCheckBox();
showEdgesNodesLabelsCheckBox = new javax.swing.JCheckBox();
timeIntervalsGraphicsCheckBox = new javax.swing.JCheckBox();
+ timeIntervalsAsDates = new javax.swing.JCheckBox();
onlyVisibleCheckBox.setText(org.openide.util.NbBundle.getMessage(ConfigurationPanel.class, "ConfigurationPanel.onlyVisibleCheckBox.text")); // NOI18N
onlyVisibleCheckBox.addActionListener(new java.awt.event.ActionListener() {
@@ -80,18 +88,27 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});
+ timeIntervalsAsDates.setText(org.openide.util.NbBundle.getMessage(ConfigurationPanel.class, "ConfigurationPanel.timeIntervalsAsDates.text")); // NOI18N
+ timeIntervalsAsDates.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ timeIntervalsAsDatesActionPerformed(evt);
+ }
+ });
+
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
- .addComponent(onlyVisibleCheckBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(useSparklinesCheckBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(showEdgesNodesLabelsCheckBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(timeIntervalsGraphicsCheckBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addContainerGap(44, Short.MAX_VALUE))
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
+ .addComponent(onlyVisibleCheckBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(useSparklinesCheckBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(showEdgesNodesLabelsCheckBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(timeIntervalsGraphicsCheckBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addComponent(timeIntervalsAsDates))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -101,6 +118,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(useSparklinesCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(timeIntervalsAsDates)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(timeIntervalsGraphicsCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(showEdgesNodesLabelsCheckBox)
@@ -124,10 +143,16 @@ private void showEdgesNodesLabelsCheckBoxActionPerformed(java.awt.event.ActionEv
dataTableTopComponent.setShowEdgesNodesLabels(showEdgesNodesLabelsCheckBox.isSelected());
}//GEN-LAST:event_showEdgesNodesLabelsCheckBoxActionPerformed
+ private void timeIntervalsAsDatesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeIntervalsAsDatesActionPerformed
+ dynamicController.setTimeFormat(timeIntervalsAsDates.isSelected() ? DynamicModel.TimeFormat.DATE : DynamicModel.TimeFormat.DOUBLE);
+ dataTableTopComponent.refreshCurrentTable();
+ }//GEN-LAST:event_timeIntervalsAsDatesActionPerformed
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox onlyVisibleCheckBox;
private javax.swing.JCheckBox showEdgesNodesLabelsCheckBox;
+ private javax.swing.JCheckBox timeIntervalsAsDates;
private javax.swing.JCheckBox timeIntervalsGraphicsCheckBox;
private javax.swing.JCheckBox useSparklinesCheckBox;
// End of variables declaration//GEN-END:variables

0 comments on commit 96e6edf

Please sign in to comment.