**/
public void paintTimeLineNode(Graphics2D graphics) {
graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
Font origFont = graphics.getFont();
Time startTime = fModel.getStartTime();
Time endTime = fModel.getEndTime();
if (!((startTime.getValue(Time.SECOND) > fTimeLine.getDisplayEnd().getValue(Time.SECOND)) ||
(endTime.getValue(Time.SECOND) < fTimeLine.getDisplayStart().getValue(Time.SECOND)))) {
calculateNodeDimensions();
float thumbWidth = (fThumbEnd - fThumbBegin);
// draw the thumb
fThumb.height = sThumbHeight;
fThumb.width = thumbWidth;
fThumb.x = fThumbBegin;
fThumb.y = (fTimeLine.getHeight() / 2f - sThumbHeight / 2f);
graphics.setStroke(fDefaultStroke);
graphics.setColor(fUnselectedColor);
graphics.draw(fThumb);
graphics.fill(fThumb);
// this is the bottom shadow line of the thumb
fThumbShadowLine.x1 = fThumb.x;
fThumbShadowLine.y1 = fThumb.y + sThumbHeight;
fThumbShadowLine.x2 = fThumb.x + thumbWidth;
fThumbShadowLine.y2 = fThumb.y + sThumbHeight;
graphics.setStroke(fShadowStroke);
graphics.setColor(Color.black);
graphics.draw(fThumbShadowLine);
// this is the top shadow line of the thumb
fThumbTopShadowLine.x1 = fThumb.x;
fThumbTopShadowLine.y1 = fThumb.y;
fThumbTopShadowLine.x2 = fThumb.x + thumbWidth;
fThumbTopShadowLine.y2 = fThumb.y;
graphics.setStroke(fShadowStroke);
graphics.setColor(Color.white);
graphics.draw(fThumbTopShadowLine);
// this is the left shadow line of the thumb
fThumbLeftShadowLine.x1 = fThumb.x;
fThumbLeftShadowLine.y1 = fThumb.y;
fThumbLeftShadowLine.x2 = fThumb.x;
fThumbLeftShadowLine.y2 = fThumb.y + sThumbHeight;
graphics.setStroke(fShadowStroke);
graphics.setColor(Color.lightGray);
graphics.draw(fThumbLeftShadowLine);
// this is the right shadow line of the thumb
fThumbRightShadowLine.x1 = fThumb.x + thumbWidth;
fThumbRightShadowLine.y1 = fThumb.y;
fThumbRightShadowLine.x2 = fThumb.x + thumbWidth;
fThumbRightShadowLine.y2 = fThumb.y + sThumbHeight;
graphics.setStroke(fShadowStroke);
graphics.setColor(Color.black);
graphics.draw(fThumbRightShadowLine);
// draw start label
DecimalFormat startForm = new DecimalFormat();
startForm.setMaximumFractionDigits(1);
if (startTime.getValue() > fTimeLine.getDisplayStart().getValue()) {
graphics.setFont(TimeLineNode.DEFAULT_FONT);
String startStr = startForm.format(startTime.getValue(Time.MINUTE));
Rectangle2D startBounds = graphics.getFontMetrics().getStringBounds(startStr,
graphics);
graphics.setColor(Color.black);
float startX = fThumb.x - (float) (startBounds.getWidth() / 2.0);
float startY = fThumb.y + sThumbHeight + (float) (startBounds.getHeight() + TimeLineNode.DEFAULT_LABEL_SPACE);
if (startBounds.getWidth() > thumbWidth / 2f) {
graphics.setFont(TimeLineNode.REVERSE_ROTATED_FONT);
}
graphics.drawString(startStr, startX, startY);
graphics.setFont(origFont);
}
// draw end label
if (endTime.getValue() < fTimeLine.getDisplayEnd().getValue()) {
graphics.setFont(TimeLineNode.DEFAULT_FONT);
DecimalFormat endForm = new DecimalFormat();
endForm.setMaximumFractionDigits(1);
String endStr = startForm.format(endTime.getValue(Time.MINUTE));
Rectangle2D endBounds = graphics.getFontMetrics().getStringBounds(endStr,
graphics);
graphics.setColor(Color.black);
float endX = fThumb.x + thumbWidth - (float) (endBounds.getWidth() / 2.0);
float endY = fThumb.y + sThumbHeight + (float) (endBounds.getHeight() + TimeLineNode.DEFAULT_LABEL_SPACE);