indicator near error toggle button, dunno if a good idea.

This commit is contained in:
Manindra Moharana
2013-08-19 22:56:28 +05:30
parent 0a2f2662cf
commit c8ed546861
4 changed files with 23 additions and 4 deletions

View File

@@ -90,10 +90,22 @@ public class XQConsoleToggle extends JPanel implements MouseListener {
g.fillRect(0, 0, 4, this.getHeight());
g.setColor(Color.WHITE);
}
g.drawString(buttonName, getWidth() / 2 + 2 // + 2 is a offset
- getFontMetrics(getFont()).stringWidth(buttonName) / 2,
this.getHeight() - 6);
if(drawMarker){
g.setColor(markerColor);
g.fillRect(4, 0, 2, this.getHeight());
}
}
boolean drawMarker = false;
protected Color markerColor;
public void updateMarker(boolean value, Color color){
drawMarker = value;
markerColor = color;
repaint();
}
@Override