}
public void paint(Graphics g)
{
- int width=getWidth(),height=getHeight();
+ Dimension d = getSize();
if (isGcol) {
if (isColourByLabel)
{
g.setColor(Color.white);
- g.fillRect(width/2, 0,width/2, height);
+ g.fillRect(d.width/2, 0,d.width/2, d.height);
g.setColor(Color.black);
Font f=new Font("Verdana", Font.PLAIN,
10);
else
{
g.setColor(maxCol);
- g.fillRect(width/2, 0,width/2, height);
+ g.fillRect(d.width/2, 0,d.width/2, d.height);
}
}
ap.seqPanel.seqCanvas.highlightSearchResults(highlight);
}
- Color col = getColour(name.getText());
+ Object col = getFeatureStyle(name.getText());
if (col == null)
{
col = new jalview.schemes.UserColourScheme()
colourPanel.updateColor(fcol);
dialog.setResizable(true);
// TODO: render the graduated color in the box.
- if (fcol instanceof Color)
- {
- colourPanel.addMouseListener(new java.awt.event.MouseAdapter()
- {
- public void mousePressed(java.awt.event.MouseEvent evt)
- {
- new UserDefinedColours(fr, ap.alignFrame);
- }
- });
-
- }
- else
- {
- colourPanel.addMouseListener(new java.awt.event.MouseAdapter()
+ colourPanel.addMouseListener(new java.awt.event.MouseAdapter()
{
public void mousePressed(java.awt.event.MouseEvent evt)
{
- FeatureColourChooser fcc = new FeatureColourChooser(ap.alignFrame, name.getText());
- fcc.setFocusable(true);
- dialog.transferFocus();
+ if (!colourPanel.isGcol)
+ {
+ new UserDefinedColours(fr, ap.alignFrame);
+ } else {
+ FeatureColourChooser fcc = new FeatureColourChooser(ap.alignFrame, name.getText());
+ dialog.transferFocus();
+ }
}
});
- }
dialog.setVisible(true);
jalview.io.FeaturesFile ffile = new jalview.io.FeaturesFile();
sf.type = lastFeatureAdded;
sf.featureGroup = lastFeatureGroupAdded;
sf.description = lastDescriptionAdded;
- if (fcol instanceof Color) {
+ if (!colourPanel.isGcol) {
// update colour - otherwise its already done.
setColour(sf.type, colourPanel.getBackground());
}
tro[0] = renderOrder[renderOrder.length - 1];
System.arraycopy(renderOrder, 0, tro, 1, renderOrder.length - 1);
renderOrder = tro;
-
- ap.paintAlignment(true);
-
- return true;
}
else
{
+ // no update to the alignment
return false;
}
}
-
+ // refresh the alignment and the feature settings dialog
+ if (av.featureSettings!=null)
+ {
+ av.featureSettings.refreshTable();
+ }
// findAllFeatures();
ap.paintAlignment(true);
public void setUserColour(String feature, Color col)
{
fr.setColour(feature, col);
+ refreshTable();
+ }
+ public void refreshTable() {
featurePanel.removeAll();
resetTable(false);
ap.paintAlignment(true);
public void paint(Graphics g)
{
- int width = getWidth(), height = getHeight();
+ Dimension d = getSize();
if (gcol != null)
{
if (gcol.isColourByLabel())
{
g.setColor(Color.white);
- g.fillRect(width/2, 0,width/2, height);
+ g.fillRect(d.width/2, 0,d.width/2, d.height);
/*g.setColor(Color.black);
Font f=g.getFont().deriveFont(9);
g.setFont(f);
{
Color maxCol = gcol.getMaxColor();
g.setColor(maxCol);
- g.fillRect(width/2, 0,width/2, height);
+ g.fillRect(d.width/2, 0,d.width/2, d.height);
}
}