Fix [ 1960007 ] Bottom line was always displayed whether or not header lines

Implementing fix proposed by ashley
This commit is contained in:
Carlos Ruiz 2008-05-08 04:49:46 +00:00
parent 5d7be47e19
commit ad86833b08
1 changed files with 42 additions and 31 deletions

View File

@ -1504,37 +1504,48 @@ public class TableElement extends PrintElement
curX, (int)(rowYstart+rowHeight-m_tFormat.getLineStroke().floatValue())); curX, (int)(rowYstart+rowHeight-m_tFormat.getLineStroke().floatValue()));
curX += m_tFormat.getVLineStroke().floatValue(); curX += m_tFormat.getVLineStroke().floatValue();
// X end line // X end line
if (row == m_data.length-1) // last Line if (row == m_data.length-1) // last Line
{ {
g2D.setPaint(m_tFormat.getHeaderLine_Color()); /**
g2D.setStroke(m_tFormat.getHeader_Stroke()); * Bug fix - Bottom line was always displayed whether or not header lines was set to be visible
g2D.drawLine(origX, curY, // -> - (last line) * @author ashley
(int)(origX+colWidth-m_tFormat.getVLineStroke().floatValue()), curY); */
curY += (2 * m_tFormat.getLineStroke().floatValue()); // thick if (m_tFormat.isPaintHeaderLines())
} {
else g2D.setPaint(m_tFormat.getHeaderLine_Color());
{ g2D.setStroke(m_tFormat.getHeader_Stroke());
// next line is a funcion column -> underline this g2D.drawLine(origX, curY, // -> - (last line)
boolean nextIsFunction = m_functionRows.contains(new Integer(row+1)); (int)(origX+colWidth-m_tFormat.getVLineStroke().floatValue()), curY);
if (nextIsFunction && m_functionRows.contains(new Integer(row))) curY += (2 * m_tFormat.getLineStroke().floatValue()); // thick
nextIsFunction = false; // this is a function line too }
if (nextIsFunction) else
{ {
g2D.setPaint(m_tFormat.getFunctFG_Color()); curY += m_tFormat.getLineStroke().floatValue();
g2D.setStroke(m_tFormat.getHLine_Stroke()); }
g2D.drawLine(origX, curY, // -> - (bottom) }
(int)(origX+colWidth-m_tFormat.getVLineStroke().floatValue()), curY); else
} {
else if (m_tFormat.isPaintHLines()) // next line is a funcion column -> underline this
{ boolean nextIsFunction = m_functionRows.contains(new Integer(row+1));
g2D.setPaint(m_tFormat.getHLine_Color()); if (nextIsFunction && m_functionRows.contains(new Integer(row)))
g2D.setStroke(m_tFormat.getHLine_Stroke()); nextIsFunction = false; // this is a function line too
g2D.drawLine(origX, curY, // -> - (bottom) if (nextIsFunction)
(int)(origX+colWidth-m_tFormat.getVLineStroke().floatValue()), curY); {
} g2D.setPaint(m_tFormat.getFunctFG_Color());
curY += m_tFormat.getLineStroke().floatValue(); g2D.setStroke(m_tFormat.getHLine_Stroke());
} g2D.drawLine(origX, curY, // -> - (bottom)
(int)(origX+colWidth-m_tFormat.getVLineStroke().floatValue()), curY);
}
else if (m_tFormat.isPaintHLines())
{
g2D.setPaint(m_tFormat.getHLine_Color());
g2D.setStroke(m_tFormat.getHLine_Stroke());
g2D.drawLine(origX, curY, // -> - (bottom)
(int)(origX+colWidth-m_tFormat.getVLineStroke().floatValue()), curY);
}
curY += m_tFormat.getLineStroke().floatValue();
}
} // for all rows } // for all rows
} // printColumn } // printColumn