Skip to content
Snippets Groups Projects
Commit a51a3e31 authored by tcarver's avatar tcarver
Browse files

change the colour of the highlighted segment to red

parent 45115c97
No related branches found
No related tags found
No related merge requests found
...@@ -40,10 +40,8 @@ public class SegmentBorder ...@@ -40,10 +40,8 @@ public class SegmentBorder
private int feature_direction; private int feature_direction;
/** /**
*
* Information stored in this object is used to draw the feature * Information stored in this object is used to draw the feature
* segment borders. * segment borders.
*
* @param highlight_feature true if the feature is highlighted * @param highlight_feature true if the feature is highlighted
* @param highlight_segment true if the segment is highlighted * @param highlight_segment true if the segment is highlighted
* @param draw_arrow true if an arrow is to be drawn on this segment * @param draw_arrow true if an arrow is to be drawn on this segment
...@@ -53,8 +51,9 @@ public class SegmentBorder ...@@ -53,8 +51,9 @@ public class SegmentBorder
* @param feature_direction feature direction * @param feature_direction feature direction
* *
*/ */
public SegmentBorder(boolean highlight_feature, boolean highlight_segment, public SegmentBorder(final boolean highlight_feature,
boolean draw_arrow, int x, int y, int width, final boolean highlight_segment,
final boolean draw_arrow, int x, int y, int width,
int feature_direction) int feature_direction)
{ {
this.highlight_feature = highlight_feature; this.highlight_feature = highlight_feature;
...@@ -71,18 +70,22 @@ public class SegmentBorder ...@@ -71,18 +70,22 @@ public class SegmentBorder
protected void drawSegmentBorder(Graphics g, int height, int arrowWidth) protected void drawSegmentBorder(Graphics g, int height, int arrowWidth)
{ {
Graphics2D g2d = (Graphics2D)g; final Graphics2D g2d = (Graphics2D)g;
if(highlight_feature) // highlight selected features if(highlight_feature) // highlight selected features
{ {
// selected - highlight by drawing a thicker line // selected - highlight by drawing a thicker line
BasicStroke stroke = (BasicStroke)g2d.getStroke(); final BasicStroke stroke = (BasicStroke)g2d.getStroke();
if(highlight_segment) if(highlight_segment)
{
g2d.setColor(new Color(140,25,25));
g2d.setStroke(new BasicStroke(4.f)); g2d.setStroke(new BasicStroke(4.f));
}
else else
g2d.setStroke(new BasicStroke(3.f)); g2d.setStroke(new BasicStroke(3.f));
g2d.drawRect(x, y, width, height); g2d.drawRect(x, y, width, height);
g2d.setColor(Color.black);
g2d.setStroke(stroke); g2d.setStroke(stroke);
} }
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment