*/
final String ft = features.get(featureIndex).getType();
final String type = ft == null ? lastFeatureAdded : ft;
- FeatureTypeSettings fcc = new FeatureTypeSettings(fr, type);
+ FeatureTypeSettings fcc = new FeatureTypeSettings(fr, type,true);
fcc.setRequestFocusEnabled(true);
fcc.requestFocus();
fcc.addActionListener(new ActionListener()
*/
String ttl = MessageManager
.formatMessage("label.select_colour_for", type);
+ Object last=(Boolean)table.getValueAt(selectedRow, SHOW_COLUMN);
+ table.setValueAt(Boolean.TRUE, selectedRow, SHOW_COLUMN);
ColourChooserListener listener = new ColourChooserListener()
{
@Override
{
currentColor = new FeatureColour(c);
table.setValueAt(currentColor, rowSelected, COLOUR_COLUMN);
+ table.setValueAt(Boolean.TRUE, selectedRow, SHOW_COLUMN);
fireEditingStopped();
}
@Override
public void cancel()
{
+ table.setValueAt(last, selectedRow, SHOW_COLUMN);
fireEditingStopped();
}
};
/*
* variable colour and filters dialog
*/
- chooser = new FeatureTypeSettings(fr, type);
+ boolean last=(Boolean)table.getValueAt(selectedRow, SHOW_COLUMN);
+ table.setValueAt(Boolean.TRUE, selectedRow, SHOW_COLUMN);
+ chooser = new FeatureTypeSettings(fr, type,last);
if (!Platform.isJS())
/**
* Java only
{
if (button == e.getSource())
{
- FeatureTypeSettings chooser = new FeatureTypeSettings(fr, type);
+ boolean last = fr.getFeaturesDisplayed().isVisible(type);
+ ((FeatureTableModel) table.getModel()).setValueAt(Boolean.TRUE, rowSelected, SHOW_COLUMN);
+ FeatureTypeSettings chooser = new FeatureTypeSettings(fr, type,last);
chooser.addActionListener(this);
chooser.setRequestFocusEnabled(true);
chooser.requestFocus();
.getData()[rowSelected];
data[COLOUR_COLUMN] = currentColor;
data[FILTER_COLUMN] = currentFilter;
+ data[SHOW_COLUMN] = fr.getFeaturesDisplayed().isVisible(type);
+
fireEditingStopped();
// SwingJS needs an explicit repaint() here,
// rather than relying upon no validation having
private JPanel chooseFiltersPanel;
+ public boolean originalDisplay;
+
/**
* Constructor
*
* @param frender
* @param theType
+ * @param last - visibility of feature prior to adjustment
*/
- public FeatureTypeSettings(FeatureRenderer frender, String theType)
+ public FeatureTypeSettings(FeatureRenderer frender, String theType, boolean last)
{
this.fr = frender;
this.featureType = theType;
ap = fr.ap;
originalFilter = fr.getFeatureFilter(theType);
originalColour = fr.getFeatureColours().get(theType);
-
+ originalDisplay = last;
adjusting = true;
try
{
fr.setColour(featureType, originalColour);
fr.setFeatureFilter(featureType, originalFilter);
+ if (!originalDisplay) {
+ fr.getFeaturesDisplayed().setHidden(featureType);
+ }
refreshDisplay(true);
}