private static final int MIN_HEIGHT = 400;
- private final static String BASE_TOOLTIP = MessageManager.getString("label.click_to_edit");
+ private final static String BASE_TOOLTIP = MessageManager
+ .getString("label.click_to_edit");
final FeatureRenderer fr;
default:
break;
}
-
+
return tip;
}
-
/**
* Position the tooltip near the bottom edge of, and half way across, the
table.setDefaultEditor(FeatureMatcherSet.class, new FilterEditor());
table.setDefaultRenderer(FeatureMatcherSet.class, new FilterRenderer());
-
+
TableColumn colourColumn = new TableColumn(COLOUR_COLUMN, 75,
new ColorRenderer(), new ColorEditor());
table.addColumn(colourColumn);
inConstruction = false;
}
- /**
- * Constructs and shows a popup menu of possible actions on the selected row and
- * feature type
- *
- * @param rowSelected
- * @param type
- * @param typeCol
- * @param pt
- */
+ /**
+ * Constructs and shows a popup menu of possible actions on the selected row
+ * and feature type
+ *
+ * @param rowSelected
+ * @param type
+ * @param typeCol
+ * @param pt
+ */
protected void showPopupMenu(final int rowSelected, final String type,
final Object typeCol, final Point pt)
{
MessageManager.getString("label.variable_colour"));
variableColourCB.setSelected(!featureColour.isSimpleColour());
men.add(variableColourCB);
-
+
/*
* checkbox action listener doubles up as listener to OK
* from the variable colour / filters dialog
{
if (e.getSource() == variableColourCB)
{
- men.setVisible(true); // BH 2018 for JavaScript because this is a checkbox
- men.setVisible(false); // BH 2018 for JavaScript because this is a checkbox
+ men.setVisible(true); // BH 2018 for JavaScript because this is a
+ // checkbox
+ men.setVisible(false); // BH 2018 for JavaScript because this is a
+ // checkbox
if (featureColour.isSimpleColour())
{
/*
/*
* toggle variable to simple colour - show colour chooser
*/
- String title = MessageManager.formatMessage("label.select_colour_for", type);
+ String title = MessageManager
+ .formatMessage("label.select_colour_for", type);
ColourChooserListener listener = new ColourChooserListener()
{
@Override
false);
}
};
- JalviewColourChooser.showColourChooser(FeatureSettings.this, title,
- featureColour.getMaxColour(), listener);
+ JalviewColourChooser.showColourChooser(FeatureSettings.this,
+ title, featureColour.getMaxColour(), listener);
}
}
- else
+ else
{
if (e.getSource() instanceof FeatureTypeSettings)
{
FeatureColourI fci = fr.getFeatureColours().get(type);
table.setValueAt(fci, rowSelected, COLOUR_COLUMN);
// BH 2018 setting a table value does not invalidate it.
-// System.out.println("FeatureSettings is valied" + table.isValid());
-// table.validate();
+ // System.out.println("FeatureSettings is valied" +
+ // table.validate();
}
}
}
});
-
+
men.addSeparator();
JMenuItem scr = new JMenuItem(
}
/**
- * Updates 'originalData' (used for restore on Cancel) if we detect that changes
- * have been made outwith this dialog
+ * Updates 'originalData' (used for restore on Cancel) if we detect that
+ * changes have been made outwith this dialog
* <ul>
* <li>a new feature type added (and made visible)</li>
* <li>a feature colour changed (in the Amend Features dialog)</li>
/**
* Remove from the groups panel any checkboxes for groups that are not in the
- * foundGroups set. This enables removing a group from the display when the last
- * feature in that group is deleted.
+ * foundGroups set. This enables removing a group from the display when the
+ * last feature in that group is deleted.
*
* @param foundGroups
*/
chooser.setToolTipText(MessageManager.getString("action.load"));
chooser.setResponseHandler(0, new Runnable()
{
- @Override
- public void run()
- {
- File file = chooser.getSelectedFile();
- load(file);
- }
- });
+ @Override
+ public void run()
+ {
+ File file = chooser.getSelectedFile();
+ load(file);
+ }
+ });
chooser.showOpenDialog(this);
}
if (table != null)
{
resetTable(null);
- Object[][] data = ((FeatureTableModel) table.getModel())
- .getData();
+ Object[][] data = ((FeatureTableModel) table.getModel()).getData();
ensureOrder(data);
updateFeatureRenderer(data, false);
table.repaint();
MessageManager.getString("label.save_feature_colours"));
chooser.setToolTipText(MessageManager.getString("action.save"));
int option = chooser.showSaveDialog(this);
- if (option == JalviewFileChooser.APPROVE_OPTION)
- {
- File file = chooser.getSelectedFile();
- save(file);
- }
+ if (option == JalviewFileChooser.APPROVE_OPTION)
+ {
+ File file = chooser.getSelectedFile();
+ save(file);
+ }
}
/**
ucs.setSchemeName("Sequence Features");
try
{
- PrintWriter out = new PrintWriter(new OutputStreamWriter(
- new FileOutputStream(file), "UTF-8"));
+ PrintWriter out = new PrintWriter(
+ new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
/*
* sort feature types by colour order, from 0 (highest)
FeatureMatcherSetI filter = fr.getFeatureFilter(featureType);
if (filter != null && !filter.isEmpty())
{
- Iterator<FeatureMatcherI> iterator = filter.getMatchers().iterator();
+ Iterator<FeatureMatcherI> iterator = filter.getMatchers()
+ .iterator();
FeatureMatcherI firstMatcher = iterator.next();
jalview.xml.binding.jalview.FeatureMatcherSet ms = jalview.project.Jalview2XML
- .marshalFilter(firstMatcher, iterator,
- filter.isAnded());
+ .marshalFilter(firstMatcher, iterator, filter.isAnded());
Filter filterModel = new Filter();
filterModel.setFeatureType(featureType);
filterModel.setMatcherSet(ms);
else
{
width[i] /= max; // normalize
- fr.setOrder(data[i][TYPE_COLUMN].toString(), width[i]); // store for later
+ fr.setOrder(data[i][TYPE_COLUMN].toString(), width[i]); // store for
+ // later
}
if (i > 0)
{
}
/**
- * Update the priority order of features; only repaint if this changed the order
- * of visible features
+ * Update the priority order of features; only repaint if this changed the
+ * order of visible features
*
* @param data
* @param visibleNew
{
boolean thr = false;
StringBuilder tx = new StringBuilder();
-
+
if (gcol.isColourByAttribute())
{
tx.append(FeatureMatcher
}
@SuppressWarnings("serial")
-class ColorEditor extends AbstractCellEditor
+ class ColorEditor extends AbstractCellEditor
implements TableCellEditor, ActionListener
{
FeatureColourI currentColor;
/*
* simple colour chooser
*/
- String ttl = MessageManager.formatMessage("label.select_colour_for", type);
- ColourChooserListener listener = new ColourChooserListener()
+ String ttl = MessageManager
+ .formatMessage("label.select_colour_for", type);
+ ColourChooserListener listener = new ColourChooserListener()
{
@Override
public void colourSelected(Color c)
table.setValueAt(currentColor, rowSelected, COLOUR_COLUMN);
fireEditingStopped();
}
- @Override
- public void cancel()
- {
- fireEditingStopped();
- }
+
+ @Override
+ public void cancel()
+ {
+ fireEditingStopped();
+ }
};
- JalviewColourChooser.showColourChooser(button, ttl, currentColor.getColour(), listener);
+ JalviewColourChooser.showColourChooser(button, ttl,
+ currentColor.getColour(), listener);
}
else
{
data[COLOUR_COLUMN] = currentColor;
data[FILTER_COLUMN] = currentFilter;
fireEditingStopped();
- // SwingJS needs an explicit repaint() here,
+ // SwingJS needs an explicit repaint() here,
// rather than relying upon no validation having
// occurred since the stopEditing call was made.
// Its laying out has not been stopped by the modal frame
}
/**
- * Override allows access to this method from anonymous inner classes
+ * Override allows access to this method from anonymous inner classes
*/
@Override
- protected void fireEditingStopped()
+ protected void fireEditingStopped()
{
- super.fireEditingStopped();
- }
+ super.fireEditingStopped();
+ }
- // Implement the one CellEditor method that AbstractCellEditor doesn't.
+ // Implement the one CellEditor method that AbstractCellEditor doesn't.
@Override
public Object getCellEditorValue()
{
// Implement the one method defined by TableCellEditor.
@Override
- public Component getTableCellEditorComponent(JTable theTable, Object value,
- boolean isSelected, int row, int column)
+ public Component getTableCellEditorComponent(JTable theTable,
+ Object value, boolean isSelected, int row, int column)
{
currentColor = (FeatureColourI) value;
this.rowSelected = row;
/**
* The cell editor for the Filter column. It displays the text of any filters
- * for the feature type in that row (in full as a tooltip, possible abbreviated
- * as display text). On click in the cell, opens the Feature Display Settings
- * dialog at the Filters tab.
+ * for the feature type in that row (in full as a tooltip, possible
+ * abbreviated as display text). On click in the cell, opens the Feature
+ * Display Settings dialog at the Filters tab.
*/
@SuppressWarnings("serial")
-class FilterEditor extends AbstractCellEditor
+ class FilterEditor extends AbstractCellEditor
implements TableCellEditor, ActionListener
{
{
currentFilter = new FeatureMatcherSet();
}
-
+
Object[] data = ((FeatureTableModel) table.getModel())
.getData()[rowSelected];
data[COLOUR_COLUMN] = currentColor;
data[FILTER_COLUMN] = currentFilter;
fireEditingStopped();
- // SwingJS needs an explicit repaint() here,
+ // SwingJS needs an explicit repaint() here,
// rather than relying upon no validation having
// occurred since the stopEditing call was made.
// Its laying out has not been stopped by the modal frame
}
@Override
- public Component getTableCellEditorComponent(JTable theTable, Object value,
- boolean isSelected, int row, int column)
+ public Component getTableCellEditorComponent(JTable theTable,
+ Object value, boolean isSelected, int row, int column)
{
currentFilter = (FeatureMatcherSetI) value;
this.rowSelected = row;
g.fillRect(s1, 0, e1 - s1, height);
}
g.setColor(gcol.getMaxColour());
-// g.fillRect(0, e1, width - e1, height); // BH 2018
+ // g.fillRect(0, e1, width - e1, height); // BH 2018
g.fillRect(e1, 0, width - e1, height);
}
}