Commit 21d43226 authored by Krzysztof Nowinski's avatar Krzysztof Nowinski

proper 2d/3d font switch, threshold params/widgets substituted by subrange widget

parent 074516d4
......@@ -229,6 +229,9 @@
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="3D texts"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="glyph3DButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
......
......@@ -272,7 +272,7 @@ public class FontGUI extends javax.swing.JPanel
jPanel2.setMinimumSize(new java.awt.Dimension(180, 33));
jPanel2.setOpaque(false);
jPanel2.setPreferredSize(new java.awt.Dimension(100, 35));
jPanel2.setLayout(new java.awt.GridLayout());
jPanel2.setLayout(new java.awt.GridLayout(1, 0));
buttonGroup1.add(glyph2DButton);
glyph2DButton.setText("2D texts");
......@@ -288,6 +288,13 @@ public class FontGUI extends javax.swing.JPanel
buttonGroup1.add(glyph3DButton);
glyph3DButton.setSelected(true);
glyph3DButton.setText("3D texts");
glyph3DButton.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
glyph3DButtonActionPerformed(evt);
}
});
jPanel2.add(glyph3DButton);
gridBagConstraints = new java.awt.GridBagConstraints();
......@@ -352,6 +359,11 @@ public class FontGUI extends javax.swing.JPanel
params.setThreeDimensional(glyph3DButton.isSelected());
}//GEN-LAST:event_glyph2DButtonActionPerformed
private void glyph3DButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_glyph3DButtonActionPerformed
{//GEN-HEADEREND:event_glyph3DButtonActionPerformed
params.setThreeDimensional(glyph3DButton.isSelected());
}//GEN-LAST:event_glyph3DButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox boldBox;
private pl.edu.icm.visnow.datamaps.RGBCorrectionEditor brightnessEditor;
......
......@@ -40,13 +40,16 @@
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Component class="javax.swing.JLabel" name="formatLabel">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="number format"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="9" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="9" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
......@@ -56,7 +59,7 @@
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="3" anchor="10" weightX="1.0" weightY="0.0"/>
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="3" anchor="10" weightX="1.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
......@@ -70,7 +73,7 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="5" gridWidth="2" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="11" insetsLeft="0" insetsBottom="11" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
<GridBagConstraints gridX="0" gridY="4" gridWidth="2" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="11" insetsLeft="0" insetsBottom="11" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
......@@ -85,7 +88,7 @@
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="6" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
<GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
......@@ -134,55 +137,12 @@
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Data threshold"/>
</Border>
</Property>
</Properties>
<Component class="pl.edu.icm.visnow.lib.gui.ComponentBasedUI.range.ComponentSubrangeUI" name="thresholdUI">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="2" gridWidth="2" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Component class="pl.edu.icm.visnow.lib.gui.DataComponentSelector" name="thrComponentSelector">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="thrComponentSelectorStateChanged"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="pl.edu.icm.visnow.gui.widgets.FloatSlider" name="thrSlider">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder/>
</Border>
</Property>
</Properties>
<Events>
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="thrSliderStateChanged"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="3" anchor="10" weightX="1.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
</Component>
</SubComponents>
</Form>
......@@ -81,16 +81,14 @@ public class GUI extends javax.swing.JPanel
java.awt.GridBagConstraints gridBagConstraints;
mapComboBox = new pl.edu.icm.visnow.lib.gui.DataComponentSelector();
jLabel1 = new javax.swing.JLabel();
formatLabel = new javax.swing.JLabel();
formatField = new javax.swing.JTextField();
fontGUI = new pl.edu.icm.visnow.geometries.gui.FontGUI();
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
jPanel1 = new javax.swing.JPanel();
downsizeUI = new pl.edu.icm.visnow.lib.gui.FieldBasedUI.DownsizeUI.DownsizeUI();
cropUI = new pl.edu.icm.visnow.lib.gui.cropUI.CropUI();
jPanel2 = new javax.swing.JPanel();
thrComponentSelector = new pl.edu.icm.visnow.lib.gui.DataComponentSelector();
thrSlider = new pl.edu.icm.visnow.gui.widgets.FloatSlider();
thresholdUI = new pl.edu.icm.visnow.lib.gui.ComponentBasedUI.range.ComponentSubrangeUI();
setLayout(new java.awt.GridBagLayout());
......@@ -112,14 +110,15 @@ public class GUI extends javax.swing.JPanel
gridBagConstraints.weightx = 1.0;
add(mapComboBox, gridBagConstraints);
jLabel1.setText("number format");
formatLabel.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
formatLabel.setText("number format");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 4;
gridBagConstraints.gridy = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 9, 0, 0);
add(jLabel1, gridBagConstraints);
add(formatLabel, gridBagConstraints);
formatField.addActionListener(new java.awt.event.ActionListener()
{
......@@ -130,7 +129,7 @@ public class GUI extends javax.swing.JPanel
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 4;
gridBagConstraints.gridy = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
......@@ -139,14 +138,14 @@ public class GUI extends javax.swing.JPanel
fontGUI.setBorder(javax.swing.BorderFactory.createTitledBorder("glyph font and decoration"));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 5;
gridBagConstraints.gridy = 4;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.insets = new java.awt.Insets(11, 0, 11, 0);
add(fontGUI, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 6;
gridBagConstraints.gridy = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weighty = 1.0;
add(filler1, gridBagConstraints);
......@@ -188,47 +187,12 @@ public class GUI extends javax.swing.JPanel
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
add(jPanel1, gridBagConstraints);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Data threshold"));
jPanel2.setLayout(new java.awt.GridBagLayout());
thrComponentSelector.setPreferredSize(new java.awt.Dimension(200, 45));
thrComponentSelector.addChangeListener(new javax.swing.event.ChangeListener()
{
public void stateChanged(javax.swing.event.ChangeEvent evt)
{
thrComponentSelectorStateChanged(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
jPanel2.add(thrComponentSelector, gridBagConstraints);
thrSlider.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
thrSlider.addChangeListener(new javax.swing.event.ChangeListener()
{
public void stateChanged(javax.swing.event.ChangeEvent evt)
{
thrSliderStateChanged(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 3);
jPanel2.add(thrSlider, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
add(jPanel2, gridBagConstraints);
add(thresholdUI, gridBagConstraints);
}// </editor-fold>//GEN-END:initComponents
/**
......@@ -240,17 +204,14 @@ public class GUI extends javax.swing.JPanel
//TODO: call updateUI from or other method dedicated to update UI (like after loading network from vna)
formatField.setText(params.getFormat());
mapComboBox.setTitle("glyph size component");
thrComponentSelector.setAddNullComponent(true);
thrComponentSelector.setScalarComponentsOnly(true);
thrComponentSelector.setTitle("glyph threshold component");
fontGUI.setInitType(true);
}
private void updateUI(DataArray da)
{
thrSlider.setMin((float)da.getPreferredMinValue());
thrSlider.setMax((float)da.getPreferredMaxValue());
DataArrayType daType = da.getType();
formatLabel.setEnabled(da.isNumeric());
formatField.setEnabled(da.isNumeric());
if ((daType == FIELD_DATA_BYTE || daType == DataArrayType.FIELD_DATA_SHORT ||
daType == FIELD_DATA_INT || daType == DataArrayType.FIELD_DATA_LONG) &&
!format.endsWith("d"))
......@@ -274,16 +235,6 @@ public class GUI extends javax.swing.JPanel
params.setActive(true);
}//GEN-LAST:event_mapComboBoxStateChanged
private void thrSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_thrSliderStateChanged
if (!thrSlider.isAdjusting())
params.setThr(thrSlider.getVal());
}//GEN-LAST:event_thrSliderStateChanged
private void thrComponentSelectorStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_thrComponentSelectorStateChanged
{//GEN-HEADEREND:event_thrComponentSelectorStateChanged
params.setThrComponent(thrComponentSelector.getComponentName());
}//GEN-LAST:event_thrComponentSelectorStateChanged
private void formatFieldActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_formatFieldActionPerformed
{//GEN-HEADEREND:event_formatFieldActionPerformed
String fmt = formatField.getText();
......@@ -312,8 +263,6 @@ public class GUI extends javax.swing.JPanel
params.setActive(false);
inField = newInField;
mapComboBox.setDataSchema(inField.getSchema());
thrComponentSelector.setDataSchema(inField.getSchema());
thrComponentSelector.setComponent(-1);
String s = mapComboBox.getComponentName();
params.setComponent(s);
DataArray da = inField.getComponent(s);
......@@ -336,6 +285,7 @@ public class GUI extends javax.swing.JPanel
this.params = params;
fontGUI.setParams(params.getFontParams());
downsizeUI.setParams(params.getDownsizeParams());
thresholdUI.setComponentValue(params.getThreshold());
}
......@@ -345,11 +295,9 @@ public class GUI extends javax.swing.JPanel
private javax.swing.Box.Filler filler1;
private pl.edu.icm.visnow.geometries.gui.FontGUI fontGUI;
private javax.swing.JTextField formatField;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel formatLabel;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private pl.edu.icm.visnow.lib.gui.DataComponentSelector mapComboBox;
private pl.edu.icm.visnow.lib.gui.DataComponentSelector thrComponentSelector;
private pl.edu.icm.visnow.gui.widgets.FloatSlider thrSlider;
private pl.edu.icm.visnow.lib.gui.ComponentBasedUI.range.ComponentSubrangeUI thresholdUI;
// End of variables declaration//GEN-END:variables
}
......@@ -39,7 +39,6 @@
package pl.edu.icm.visnow.lib.basic.mappers.TextGlyphs;
import java.util.IllegalFormatException;
import javax.media.j3d.*;
import org.apache.log4j.Logger;
import pl.edu.icm.jscic.dataarrays.DataArray;
......@@ -49,7 +48,6 @@ import static pl.edu.icm.jscic.dataarrays.DataArrayType.*;
import pl.edu.icm.jscic.dataarrays.StringDataArray;
import pl.edu.icm.jlargearrays.FloatLargeArray;
import pl.edu.icm.visnow.geometries.objects.DataMappedGeometryObject;
import pl.edu.icm.visnow.geometries.objects.GeometryObject;
import pl.edu.icm.visnow.geometries.objects.generics.OpenBranchGroup;
import pl.edu.icm.visnow.geometries.parameters.FontParams;
import pl.edu.icm.visnow.geometries.textUtils.Texts2D;
......@@ -79,7 +77,7 @@ public class GlyphsObject extends DataMappedGeometryObject
private Field inField = null;
private OpenBranchGroup outGroup = null;
private DataArray glyphDataArray, thresholdDataArray;
private float thr = -Float.MAX_VALUE;
private float thrLow = -Float.MAX_VALUE, thrUp = Float.MAX_VALUE;
private float[] baseCoords = null;
private long[] glyphIn = null;
private int nGlyphs = 0;
......@@ -120,13 +118,13 @@ public class GlyphsObject extends DataMappedGeometryObject
t += v[j] * v[j];
t = sqrt(t);
}
return t > thr;
return t >= thrLow && t <= thrUp;
}
@Override
public void drawLocal2D(J3DGraphics2D vGraphics, LocalToWindow ltw, int width, int height)
{
if (ltw == null || params == null || params.getFontParams().isThreeDimensional())
if (textGlyphs == null || ltw == null || params == null || params.getFontParams().isThreeDimensional())
return;
textGlyphs.draw(vGraphics, ltw, width, height);
}
......@@ -173,10 +171,10 @@ public class GlyphsObject extends DataMappedGeometryObject
glyphDataArray = inField.getComponent(params.getComponent());
if (glyphDataArray == null)
return;
thr = params.getThr();
thrLow = params.getThreshold().getLow();
thrUp = params.getThreshold().getUp();
thresholdDataArray = null;
if (inField.getComponent(params.getThrComponent()) != null)
thresholdDataArray = inField.getComponent(params.getThrComponent());
thresholdDataArray = inField.getComponent(params.getThreshold().getComponentName());
int maxNGlyphs = 1;
if (inField instanceof RegularField) {
int[] low = params.getLowCrop();
......@@ -253,7 +251,7 @@ public class GlyphsObject extends DataMappedGeometryObject
nValidPoints += 1;
if (nValidPoints < inField.getNNodes() / downsize) {
for (long i = 0; i < inField.getNNodes(); i ++)
if (isValid(i)) {
if (isValid(i) && nGlyphs < gl.length) {
gl[nGlyphs] = i;
nGlyphs += 1;
}
......@@ -393,6 +391,7 @@ public class GlyphsObject extends DataMappedGeometryObject
}
}
if (fontParams.isThreeDimensional()) {
textGlyphs = null;
String[] txts = new String[texts.length];
for (int i = 0; i < txts.length; i++)
if (texts[i] != null && texts[i].length > 0)
......
......@@ -43,6 +43,7 @@ import pl.edu.icm.visnow.engine.core.ParameterType;
import pl.edu.icm.visnow.engine.core.Parameters;
import pl.edu.icm.visnow.geometries.parameters.FontParams;
import static org.apache.commons.math3.util.FastMath.*;
import pl.edu.icm.visnow.lib.gui.ComponentBasedUI.range.ComponentSubrange;
import pl.edu.icm.visnow.lib.gui.FieldBasedUI.DownsizeUI.DownsizeParams;
/**
......@@ -56,12 +57,11 @@ public class Params extends Parameters
public static final int GLYPHS_CHANGED = 2;
public static final int COORDS_CHANGED = 1;
protected int change = 0;
protected ComponentSubrange threshold = new ComponentSubrange(true, false, false, true, true, true);
protected FontParams fontParams = new FontParams();
protected DownsizeParams downsizeParams = new DownsizeParams(1, 2000, 50, false);
protected static ParameterEgg[] eggs = new ParameterEgg[]{
new ParameterEgg<String>("component", ParameterType.dependent, ""),
new ParameterEgg<String>("thrComponent", ParameterType.dependent, ""),
new ParameterEgg<Float>("thr", ParameterType.dependent, .1f),
new ParameterEgg<Float>("scale", ParameterType.dependent, .02f),
new ParameterEgg<String>("format", ParameterType.dependent, "%4.1f"),
new ParameterEgg<int[]>("lowCrop", ParameterType.dependent, null),
......@@ -73,6 +73,17 @@ public class Params extends Parameters
setValue("lowCrop", new int[]{0, 0, 0});
setValue("upCrop", new int[]{1, 1, 1});
fontParams.setThreeDimensional(true);
threshold.addChangeListener(new ChangeListener()
{
@Override
public void stateChanged(ChangeEvent e)
{
if (!threshold.isAdjusting()) {
change = COUNT_CHANGED;
fireStateChanged();
}
}
});
fontParams.addChangeListener(new ChangeListener()
{
......@@ -107,29 +118,11 @@ public class Params extends Parameters
fireStateChanged();
}
public String getThrComponent()
{
return (String) getValue("thrComponent");
}
public void setThrComponent(String component)
{
setValue("thrComponent", component);
change = COUNT_CHANGED;
fireStateChanged();
}
public int getDownsize()
public ComponentSubrange getThreshold()
{
return downsizeParams.getDownFactor();
return threshold;
}
public int[] getDown()
{
return downsizeParams.getDown();
}
public String getFormat()
{
return (String) getValue("format");
......@@ -142,18 +135,6 @@ public class Params extends Parameters
fireStateChanged();
}
public float getThr()
{
return (Float) getValue("thr");
}
public void setThr(float thr)
{
setValue("thr", thr);
change = COUNT_CHANGED;
fireStateChanged();
}
public int getChange()
{
return change;
......@@ -194,6 +175,16 @@ public class Params extends Parameters
{
return (int[]) getValue("upCrop");
}
public int[] getDown()
{
return downsizeParams.getDown();
}
public int getDownsize()
{
return downsizeParams.getDownFactor();
}
public void setCrop(int[] lowCrop, int[] upCrop)
{
......
......@@ -116,6 +116,7 @@ public class TextGlyphs extends VisualizationModule //implements RenderWindowLis
params.getDownsizeParams().setFieldData(inField.getNNodes(), ((RegularField)inField).getDims());
else
params.getDownsizeParams().setFieldData(inField.getNNodes(), null);
params.getThreshold().setContainer(inField);
ui.setInData(inField, dataMappingParams);
params.setChange(Params.COUNT_CHANGED);
} else
......@@ -125,12 +126,6 @@ public class TextGlyphs extends VisualizationModule //implements RenderWindowLis
}
else
inField = null;
// if (inField == null ||
// params.getComponent() == null ||
// inField.getComponent(params.getComponent()) == null) {
// glyphObj.clear();
// return;
// }
glyphObj.update(inField, params);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment